The most common way that a user sends commands to TAME is via text input, usually at some kind of prompt. Stuff like:
pick up lamp look at dog scream
This text input is sent through a part of TAME called an interpreter. It's the interpreter's job to parse this input and find significant words and phrases in order to divine a meaningful action.
While the module is a giant accumulation of every element in the world, it also contains what the interpreter is supposed to deem significant, mostly by the author assigning names to actions and objects.
No matter the method by which input text is sent to TAME, TAME's interpreter takes the input text and cuts it up into chunks of words called tokens. TAME uses the whitespace between words as the delimiter for these tokens.
For example, the phrase "look at wooden table" would be broken into the tokens "look", "at", "wooden", and "table" before parsing.
TAME always parses input in this manner:
TAME's interpreter is a greedy interpreter, and this affects how words and phrases are matched to actions and objects.
TAME's interpreter is greedy, which means it searches for matches using all of the tokens available. In contrast, a lazy interpreter would stop looking at tokens (and then move on to the next thing to match) the moment that it found a relevant match.
For example, if the input was:
look at wooden table
And "look" and "look at" are actions, and "wooden table" is an object, in a lazy interpreter:
But in a greedy interpreter:
This greedy scan still happens for each subsequent match, including action modes, conjunctions and accessible objects.
Once the interpreter figures out all of the parts of the input, it is bundled into a full action and TAME figures out what blocks to execute. The blocks executed differ depending on context state or action types or target modes or objects with the action.
This documentation has several diagrams that outline this process.
Sometimes the user will input something that will fail to parse completely or result in an action that is unhandled. This, too is handled in module logic in other blocks. Depending on what parts of the input are either incomplete or unresolvable, different blocks will be called.
If a block does not exist that handles these cases, TAME will add an ERROR cue to the response for the missing block.
This documentation has several diagrams that outline this process.