Talk:Recursive transfer

From Apertium
Revision as of 18:03, 9 January 2014 by Unhammer (talk | contribs) (testing transfer4)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

testing transfer4

In https://svn.code.sf.net/p/apertium/svn/branches/transfer4 you can do:

cd eng-kaz
make
# might give some warnings

# before and after transfer:
cat input/input.02.txt
cat input/input.02.txt | ./parser 

# /tmp/input.02.parse contains the parse, using parentheses
cat input/input.02.txt | ./parser -p 2>/tmp/input.02.parse

# visualise it with tex:
cat /tmp/input.02.parse | python3 ../brackets-parse.py -x >/tmp/input.02.tex
xelatex /tmp/input.02.tex

# or with graphviz:
cat /tmp/input.02.parse | python3 ../brackets-parse.py >/tmp/input.02.dot
dot -Tpdf /tmp/input.02.dot -o/tmp/input.02.pdf
<spectie> you can also generate a parser from an existing .t1x file 
<spectie> ../AST/create-parser.y
<spectie> ../AST/create-parser.py
<spectie> but it only does 1 level, and also, t1x rule patterns aren't
	  necessarily ideal  [18:59]
<spectie> $ python3 ../AST/create-parser.py <
	  ~/source/apertium/trunk/apertium-sme-nob/apertium-sme-nob.sme-nob.t1x 
<spectie> because they overlap in ambiguous ways  [19:00]