r0ller / alice

A Language Interpreter as semantiC Experiment in natural language processing
8 stars 0 forks source link

the algorithm handling syntactically wrong sentences is greedy #50

Closed r0ller closed 9 months ago

r0ller commented 2 years ago

It is greedy in a way that it tries to collect arguments for the parameters of the current node of the parse tree as long as it can. That means if a parameter of a functor can take more than one argument (like an array) the algorithm will try to satisfy that. This may exhaust the possibility to fulfill the requirements of other parameters. E.g. the sentence:

"üzenem xyznek hogy helló"

results in an interpretation where "xyznek" is analysed as a constant. However, as the algorithm tries to collect arguments for the parameters of the main verb, it collects both "xyznek" and "helló" as if they were first and last names (if the functor is set up that way). So no argument is left for "hogy". Thus the expression is not satisfied. One solution could be to try to satisfy the minimal requirements of all functors involved.