Is Out‑of‑Order Parsing OK? My Experience with a Greedy, Destructive N‑Gram Parser

Sometimes having a very basic, non-complex, rudimentary parser can make something which would’ve been difficult to program with a more advanced system, very easy.

On the simplest level, the system I regularly use (Gilsoft’s PAWS) basically just pattern matches the first verb and first noun it finds, no matter the order.

Which was useful when I wanted to “break” the system and create an adventure with half the game set in a mirror realm.

It was very easy to get the parser to cope with both VERB NOUN and NUON BREV.

1 Like

I’m pretty interested in what noobs do when playing a parser for the first time, so I sometimes take my laptop into random bars and show it to people. One mistake I notice people make a lot is they ask the computer questions, like “is there anything else in the room?” I think it would be cool if there was a natural way to redirect them. But I also like stripping out punctuation, (otherwise I’d just have it check for a question mark) so I’m not really sure what to do with this information. I’m a bit of a noob myself.

1 Like

Detecting questions in English isn’t trivial the way it is in some languages, but there are some good heuristics you can use: a form of “be”, “do”, “have”, or a wh-word (who, what, etc) will usually be at the start of a question sentence, and seldom at the start of a declarative sentence.

(English typically marks questions by hoisting an auxiliary verb to the front of the sentence. If there’s no auxiliary verb, you can add “do” as a last resort, which is an auxiliary that doesn’t mean much of anything but fills in that slot. So “he is nice” → “is he nice”, “you have eaten” → “have you eaten”, and “she likes cats” → “she does like cats” → “does she like cats”. If there’s also a wh-word, that gets hoisted even higher toward the front: “you are going there” → “are you going there” → “where are you going”.)

3 Likes