Debian Codegraph @

README

raw
1 # Apertium-recursive
2
3 A recursive structural transfer module for Apertium
4
5 Compiling
6 ---------
7
8 ```bash
9 ./autogen.sh
10 make
11 ```
12
13 Running
14 -------
15
16 ```bash
17 # compile the rules file
18 src/rtx-comp rule-file bytecode-file
19
20 # run the rules
21 src/rtx-proc bytecode-file < input
22
23 # decompile the rules and examine the bytecode
24 src/rtx-decomp bytecode-file text-file
25
26 # compile XML rule files
27 src/trx-comp bytecode-file xml-files...
28
29 # generate random sentences from a rules file
30 apertium-recursive/src/randsen.py start_node pair_directory source_language_directory
31 ```
32
33 Options for ```rtx-comp```:
34 - ```-e``` don't compile a rule with a particular name
35 - ```-l``` load lexicalized weights from a file
36 - ```-s``` output summaries of the rules to stderr
37
38 Options for ```trx-comp```:
39 - ```-l``` load lexicalized weights from a file
40
41 Options for ```rtx-proc```:
42 - ```-a``` indicates that the input comes from apertium-anaphora
43 - ```-f``` trace which parse branches are discarded
44 - ```-r``` print which rules are applying
45 - ```-s``` trace the execution of the bytecode interpreter
46 - ```-t``` mimic the behavior of apertium-transfer and apertium-interchunk
47 - ```-T``` print the parse tree rather than applying output rules
48 - ```-b``` print both the parse tree and the output
49 - ```-m``` set the mode of tree output, available modes are:
50 - ```nest``` (default) print the tree as text indented with tabs
51 - ```flat``` print the tree as text
52 - ```latex``` print the tree as LaTeX source using the ```forest``` library
53 - ```dot``` print the tree as a Dot graph
54 - ```box``` print the tree using [box-drawing characters](https://en.wikipedia.org/wiki/Box-drawing_character)
55 - ```-e``` a combination of ```-f``` and ```-r```
56 - Intended use: ```rtx-proc -e -m latex rules.bin < input.txt 2> trace.tex```
57 - ```-F``` filter branches for things besides parse errors (experimental)
58
59 Testing
60 -------
61
62 ```bash
63 make test
64 ```
65
66 Using in a Pair
67 ---------------
68
69 In ```Makefile.am``` add:
70 ```
71 $(PREFIX1).rtx.bin: $(BASENAME).$(PREFIX1).rtx
72 rtx-comp $< $@
73
74 $(PREFIX2).rtx.bin: $(BASENAME).$(PREFIX2).rtx
75 rtx-comp $< $@
76 ```
77
78 and add
79
80 ```
81 $(PREFIX1).rtx.bin \
82 $(PREFIX2).rtx.bin
83 ```
84
85 to ```TARGETS_COMMON```.
86
87 In ```modes.xml```, replace ```apertium-transfer```, ```apertium-interchunk```, and ```apertium-postchunk``` with:
88 ```
89 <program name="rtx-proc">
90 <file name="abc-xyz.rtx.bin"/>
91 </program>
92 ```
93
94 Documentation
95 -------------
96
97 - GSoC project proposal: https://wiki.apertium.org/wiki/User:Popcorndude/Recursive_Transfer
98 - File format documentation: https://wiki.apertium.org/wiki/Apertium-recursive/Formalism
99 - Bytecode documentation: https://wiki.apertium.org/wiki/Apertium-recursive/Bytecode
100 - Progress reports: https://wiki.apertium.org/wiki/User:Popcorndude/Recursive_Transfer/Progress and https://github.com/apertium/apertium-recursive/issues/1
101 - Examples of functioning rule sets can be found in [apertium-eng-kir](https://github.com/apertium/apertium-eng-kir/blob/rtx/apertium-eng-kir.kir-eng.rtx), [`eng-spa.rtx`](eng-spa.rtx), and [`tests/`](tests/)