C# Class ElizaCore.ElizaMain

Eliza main class.
Eliza main class. Stores the processed script. Does the input transformations.
Exibir arquivo Open project: xamarin/monotouch-samples

Public Methods

Method Description
ElizaMain ( ) : System
ElizaMain ( ILineSource linesource ) : System
IsFinished ( ) : bool
ProcessInput ( string s ) : string

Process a line of input.

Process a line of input.

Private Methods

Method Description
Assemble ( Decomp d, string reply, Key gotoKey ) : string

Assembly a reply from a decomp rule and the input.

Assembly a reply from a decomp rule and the input. If the reassembly rule is goto, return null and give the gotoKey to use. Otherwise return the response.

Collect ( string s ) : void

Process a line of script input.

Process a line of script input.

Decompose ( Key key, string s, Key gotoKey ) : string

Decompose a string according to the given key.

Decompose a string according to the given key. Try each decomposition rule in order. If it matches, assemble a reply and return it. If assembly fails, try another decomposition rule. If assembly is a goto rule, return null and give the key. If assembly succeeds, return the reply;

ReadScript ( ILineSource linesource ) : int
Sentence ( string s ) : string

Process a sentence.

Process a sentence. (1) Make pre transformations. (2) Check for quit word. (3) Scan sentence for keys, build key stack. (4) Try decompositions for each key.

Method Details

ElizaMain() public method

public ElizaMain ( ) : System
return System

ElizaMain() public method

public ElizaMain ( ILineSource linesource ) : System
linesource ILineSource
return System

IsFinished() public method

public IsFinished ( ) : bool
return bool

ProcessInput() public method

Process a line of input.
Process a line of input.
public ProcessInput ( string s ) : string
s string
return string