Did you know ... | Search Documentation: |
Pack logicmoo_nlu -- ext/ace_in_gf/tools/Codeco/README.md |
Works but tokenization should be improved:
grammar.pl
: parser in Codeco format (incl. a small test vocabulary), comes from the AceWiki distribution, but modifiedgrammar_dcg.pl
: parser in DCG (automatically generated, do not edit!)compile.sh
: converts grammar.pl
into grammar_dcg.pl
, only needed if you modify grammar.pl
parse.pl
: parses STDIN using grammar_dcg.pl
sentences.txt
: example input for parse.pl
of
-noun is also a noun and vice versa. This reflects better ACE
where there is no explicit of
-noun category.simple_sentence_1
as its argument (was: simple_sentence_2
),
i.e. `it is false that there is ...` is now possible, as well as
`it is false that it is false that ...`.The output (STDOUT) shows for each input sentence on a separate line its tokenization (where two spaces mark the token border) and a prefix OK or FAIL depending on whether parsing succeeded or not.
echo "Mary is a friend of Mary ." | sh run.sh
OK: Mary is a friend of Mary .
cat sentences | sh run.sh
OK: Mary asks Mary . OK: Mary is a friend of at least 2 women . Mary asks Mary . FAIL: this sentence should fail to parse OK: everybody asks somebody . ...
Parsing the complete test set (19k sentences):
time cat sentences | sh run.sh > out.txt
real 0m21.224s user 0m21.097s sys 0m0.144s