A recursive structural transfer module for Apertium
./autogen.sh
make# compile the rules file
src/rtx-comp rule-file bytecode-file
# run the rules
src/rtx-proc bytecode-file < input
# decompile the rules and examine the bytecode
src/rtx-decomp bytecode-file text-file
# compile XML rule files
src/trx-comp bytecode-file xml-files...
# generate random sentences from a rules file
apertium-recursive/src/randsen.py start_node pair_directory source_language_directoryOptions for rtx-comp:
-edon't compile a rule with a particular name-lload lexicalized weights from a file-soutput summaries of the rules to stderr
Options for trx-comp:
-lload lexicalized weights from a file
Options for rtx-proc:
-aindicates that the input comes from apertium-anaphora-ftrace which parse branches are discarded-rprint which rules are applying-strace the execution of the bytecode interpreter-tmimic the behavior of apertium-transfer and apertium-interchunk-Tprint the parse tree rather than applying output rules-bprint both the parse tree and the output-mset the mode of tree output, available modes are:nest(default) print the tree as text indented with tabsflatprint the tree as textlatexprint the tree as LaTeX source using theforestlibrarydotprint the tree as a Dot graphboxprint the tree using box-drawing characters
-ea combination of-fand-r- Intended use:
rtx-proc -e -m latex rules.bin < input.txt 2> trace.tex
- Intended use:
-Ffilter branches for things besides parse errors (experimental)
make testIn Makefile.am add:
$(PREFIX1).rtx.bin: $(BASENAME).$(PREFIX1).rtx
rtx-comp $< $@
$(PREFIX2).rtx.bin: $(BASENAME).$(PREFIX2).rtx
rtx-comp $< $@
and add
$(PREFIX1).rtx.bin \
$(PREFIX2).rtx.bin
to TARGETS_COMMON.
In modes.xml, replace apertium-transfer, apertium-interchunk, and apertium-postchunk with:
<program name="rtx-proc">
<file name="abc-xyz.rtx.bin"/>
</program>
- GSoC project proposal: https://wiki.apertium.org/wiki/User:Popcorndude/Recursive_Transfer
- File format documentation: https://wiki.apertium.org/wiki/Apertium-recursive/Formalism
- Bytecode documentation: https://wiki.apertium.org/wiki/Apertium-recursive/Bytecode
- Progress reports: https://wiki.apertium.org/wiki/User:Popcorndude/Recursive_Transfer/Progress and #1
- Examples of functioning rule sets can be found in apertium-eng-kir,
eng-spa.rtx, andtests/