OTTAA-Project / Realiser

Repository for OTTAA's realiser algorithm, previously known as NLG, used for the OTTAA Labs option on the app.
GNU General Public License v3.0
0 stars 0 forks source link

infinitives before searching for sequences #4

Closed lopezjuanma96 closed 2 years ago

lopezjuanma96 commented 2 years ago

{ "words": ["yo", "tener", "ganas de", "comer", "una", "hamburguesa"], "types": ["SUBJ", "VERB", "PREP", "VERB", "PREP", "NOUN"], "language": "es", "props": {} }

results in

{ "sentence": [ { "words": [ "yo" ], "types": [ "SUBJ" ], "composed": false, "type": "SUBJ", "children": [], "meta": { "PERSON": "yo", "GENDER": "él" }, "props": {}, "position": 0, "headless": false }, { "words": [ "tengo gano de", "y", "como" ], "types": [ "CON", "VERB" ], "composed": true, "type": "VERB", "children": [ { "position": 0, "type": "SUBJ" } ], "meta": { "PERSON": "yo", "TIME": "presente" }, "props": {}, "position": 1, "headless": true }, { "words": [ "una", "hamburguesa" ], "types": [ "PREP", "NOUN" ], "composed": true, "type": "OBJ", "children": [], "meta": {}, "props": {}, "position": 2, "headless": true } ] }

because sequences are search while doing infinitives after joining verbs, then "tener ganas" is transformed into "tener ganar" even when "ganas de" is set up as a "PREP".

ALSO should look into the types of that verb token which are "CON" and "VERB"

lopezjuanma96 commented 2 years ago

the solution, for now, is to add exception to the infinitivation process depending on the word situation, for example "ganas" is not turned into "ganar" if "de" folllows it. we'll test it and see if it's necessary to do something else.