GithubHelp home page GithubHelp logo

rinkydevi / apertium-recursive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apertium/apertium-recursive

0.0 0.0 0.0 974 KB

Recursive structural transfer module for Apertium

Home Page: https://wiki.apertium.org/wiki/Apertium-recursive

License: GNU General Public License v3.0

Makefile 0.63% Python 14.75% Lex 0.08% Yacc 2.07% C++ 79.32% Shell 0.32% M4 1.53% C 0.77% Vim Script 0.53%

apertium-recursive's Introduction

Apertium-recursive

A recursive structural transfer module for Apertium

Compiling

./autogen.sh
make

Running

# 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 tabs
    • flat print the tree as text
    • latex print the tree as LaTeX source using the forest library
    • dot print the tree as a Dot graph
    • box 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
  • -F filter branches for things besides parse errors (experimental)

Testing

make test

Using in a Pair

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>

Documentation

apertium-recursive's People

Contributors

mr-martian avatar tinodidriksen avatar nlhowell avatar khannatanmai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.