コード例 #1
0
def main():
    run(grammar_path='/Users/vitaliyvrublevskiy/projects/Grammar/rules.cfg',
        s=build_sentence(get_sentence()),
        debug=False,
        start_rule='ROOT',
        lazy=True
        # lazy=False
        )
コード例 #2
0
def parse(s):
    run(
        grammar_path=
        '/Users/vitaliyvrublevskiy/projects/Grammar/rules_transitive.cfg',
        s=build_sentence(s),
        debug=False,
        start_rule='ROOT',
        # lazy=True
        lazy=False)
コード例 #3
0
def main_artificial():
    s = 'a/a<A> b/b<B> b/b<B>'
    run('/Users/vitaliyvrublevskiy/projects/Grammar/rules_artificial.cfg', s,
        True, 'ROOT')
コード例 #4
0
def main_nltk_rules():
    run('/Users/vitaliyvrublevskiy/projects/Grammar/rules_nltk.cfg',
        build_sentence(get_sentence()), False, 'S')
コード例 #5
0
def main_mini():
    run('/Users/vitaliyvrublevskiy/projects/Grammar/rules_mini.cfg',
        build_sentence(get_sentence()), False, 'ROOT', True)