Friday, July 29, 2011

In development: Parsing statements

The singleton and events have been implemented. It appears to be working.

As I try to create response patterns, I quickly deviated to parsing messages to handle multiple statements. Some helpful code that helps make this easier is comparing strings without case-insensitivity:

return sText01.Contains(sText02, StringComparer.InvariantCultureIgnoreCase);

Another helpful code is the ability to search by specific properties within an object:

Message msg = _Brain.Dialogues[SessionId].History.Find(
delegate(Message msg2)
{
return msg2.Value == "Existing message here";
}
);

Once I attempted to break out any multiple statements, I tried to break statements into subject, verb, etc. Quickly this got out of hand too since I do not have all the information I need.

Focusing back at just giving some simple commands, the next step is to start creating the back-end stuff. This might take a while as I'd like to see the capabilities of linq.

No comments:

Post a Comment