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_directory
Options for rtx-comp
:
-e
don't compile a rule with a particular name-l
load lexicalized weights from a file-s
output summaries of the rules to stderr
Options for trx-comp
:
-l
load lexicalized weights from a file
Options for rtx-proc
:
-a
indicates that the input comes from apertium-anaphora-f
trace which parse branches are discarded-r
print which rules are applying-s
trace the execution of the bytecode interpreter-t
mimic the behavior of apertium-transfer and apertium-interchunk-T
print the parse tree rather than applying output rules-b
print both the parse tree and the output-m
set the mode of tree output, available modes are:nest
(default) print the tree as text indented with tabsflat
print the tree as textlatex
print the tree as LaTeX source using theforest
librarydot
print the tree as a Dot graphbox
print the tree using box-drawing characters
-e
a combination of-f
and-r
- Intended use:
rtx-proc -e -m latex rules.bin < input.txt 2> trace.tex
- Intended use:
-F
filter branches for things besides parse errors (experimental)
make test
In 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 apertium#1
- Examples of functioning rule sets can be found in apertium-eng-kir,
eng-spa.rtx
, andtests/