ainslec / adventuron-issue-tracker

Adventuron Issues Tracker
4 stars 0 forks source link

Issues with prepositions in complex commands #513

Open hnejfnvjojgrogjwm opened 1 year ago

hnejfnvjojgrogjwm commented 1 year ago

I am experiencing some issues when I require the player to enter complex sentences that includes prepositions.

I define all the Spanish prepositions in the vocabulary by default, because I don't want the game to take a prep as a noun or an adjective by mistake.

Example1

There is an object called COTA DE MALLA (English CHAIN MAIL, literal translation CHAIN OF MAIL).

Object name: malla_cota (English mail_chain).

If the player types COGER COTA MALLA (GET CHAIN MAIL) it works as intended. COTA is noun1 and MALLA is adjective1.

But if the player types the correct full name COGER COTA DE MALLA (GET CHAIN OF MAIL) the parser turns MALLA (the adjective), into noun2 and the player's command can't be correctly processed. The message displayed is the Spanish equivalent of "Be more specific".

image

Example2

The player have to check under the pillow. Spanish command MIRAR DEBAJO DE LA ALMOHADA (LOOK UNDER THE PILLOW)

The parser understands correctly the verb MIRAR (LOOK). DEBAJO (UNDER) and DE (OF) are both prepositions. But for some reason DEBAJO becomes noun1 too. And ALMOHADA (PILLOW) is now noun2. As a result, the parser can not understand and process correctly the sentence.

image

I know I can manually fix this issue, maybe deleting prepositions from the vocabulary, or using experimental_matching_text_sequences in the first example to understand COTA DE MALLA as a one single name... but I think this issue can happen again, with different sentences, in different adventures, and it may be worthy to make a general fix for everyone instead of manually patching it in every specific situation. Of course, this will depend on how complex is to fix this.

Maybe it can be fixed if the definitions in the vocabulary are more strict? I mean, if a word is a preposition, it is always a preposition and can not be a noun or an adjective, etc. I don't know, just an idea.

Sorry for long and confusing report.

hnejfnvjojgrogjwm commented 1 year ago

Random thought: This and other issues that I experienced with Adventuron may be caused because the parser follows the English grammar, which gives importance to the placement of each particle. In Spanish the grammar is more flexible, and sometimes we can alter the order of nouns, adjectives, prepositions, put two prepositions together, etc... Perhaps some of these problems would be solved by ignoring the order and simply assigning "noun1" to the first name that appears, "adjective1" to the first adjective, etc, regardless of its placement with respect to other language particles. What do you think Chris? Does what I say make sense? Or maybe I just haven't understood the inner workings of the parser?