jan-Lope / Toki_Pona-Parser

Toki Pona is a constructed, minimal language. This parser based on swi-prolog and definite clause grammars (dcg) and supports spelling, grammar check and ambiguity check of Toki Pona sentences.
GNU General Public License v3.0
49 stars 5 forks source link

simple tests #7

Closed heuchi closed 7 years ago

heuchi commented 7 years ago

test all lines in file toki-pona-sentences-right.txt to succeed. test all lines in file toki-pona-sentences-wrong.txt to fail.

to run use: swipl -s toki-pona-test-files.pro

This will, however not work completely currently, because the line

ni li jan tu tu tu tu.

in file toki-pona-sentences-right.txt leads to an error:

|:ni li jan tu tu tu tu.
ERROR: number_radix_2/3: Undefined procedure: removing_extraneous_tree_nodes_abcde/3
ERROR:   However, there are definitions for:
ERROR:         removing_extraneous_tree_nodes_abcd/5
ERROR:         removing_extraneous_tree_nodes_abcde/6
ERROR:         removing_extraneous_tree_nodes_abcdef/7
   Exception: (17) removing_extraneous_tree_nodes_abcde(_G1363, numeral(tu), epsilon) ?

But when you remove that line, the test runs fine. There are some lines, that should fail which don't and many lines that should succeed, but don't. A lot of the lines wrongly failing seem to be caused by missing/wrong punctuation marks.

And hey, it's Prolog only... ;-)

jan-Lope commented 7 years ago

Many thanks! I've fixed the number_radix_2 bug. Now "ni li jan tu tu tu tu." is ok. I have go the tests.