This is still beta software. As such you should assume that the schema can and will change.
yufa is my latest attempt to try to make a more human-readable natural language grammar description framework. I say more human-readable cause GrammaticalFramework is technically human readable. It is also driven by my desire to codeify the rules to conjugation and declension as I learn them and have a method of validating that I have in fact learned the rules correctly.
TODO :)
yufa uses textX to parse the description language. It also has some great visualization tools, with the help of graphviz (which provides the dot program).
>>> from textx.export import model_export
>>> meta = metamodel_from_file('Rules.tx')
>>> model = meta.model_from_file('{path to ruleset}')
>>> model_export(model, 'program.dot')
$ dot -Tpng program.dot -O program.dot.png
python parser.py {language} {word} {pronoun} {ruleset} {additional args}[optional]
If an additional arg is prefixed with a +
it is treated as a suffix. Ex. +REFL
would be treated as the reflexive suffix (assuming it is defined) and added after the verb is conjugated.
For example:
python parser.py dutch nemen 1sg prs
will result inneem
.python parser.py lithuanian dirba 1sg prs A
will result indirbu
. TheA
indicates that the verb dirbti (seen there in the 3 person present form) is an A class verb.python parser.py russian работать 1sg prs
will result inработаю
.python parser.py russian говорить 1pl prs +REFL
will result inговоримся
.
Tests with nose: python -m nose2