Skip to content

Sentence processing

micro222 edited this page Sep 9, 2016 · 4 revisions

WORK IN PROGRESS

The beginning of the program deals with the initial greetings including getting the person to identify themselves.

I think of sentences as fitting into one of 4 categories: statements, questions, commands and miscellaneous. The purpose of statements is to provide the robot with information. The robot can check if that information is new, already known, or contradicts what is already known. New information usually gets stored in the database. With questions, the robot simply retrieves the information from the database. Commands tell the robot to do something. Miscellaneous sentences are things like hi and bye.

Sentence processing is separated into 2 stages. The robot will try to match the sentence with one of the templates in templates.txt. If there's a match, the specified function will deal with the rest of the processing.

Note that templates.txt isn't being used yet. Matching is currently being done using a series of if/else statements in main. Implementing templates.txt is my top priority.


Dealing with sentences that are based on the word "is".

These sentences either deal with how things are classified or what their attributes are.

Ex.: "what is a cat". The user wants to know what group cat is a subset of. The robot can reply with "a cat is an animal"

Ex: "where is the cat". The attribute is location.

Sometimes the attribute is stated in the sentence. "the color is blue" The attribute "color" is specified.

Other times the attribute is implied. "coffee is brown". The word color isn't in the sentence, but brown is listed in the database as a color.

Note: most of this is working.