org.pandora.thought.language
Class Comprehension

java.lang.Object
  extended by org.pandora.thought.BasicThought
      extended by org.pandora.thought.SubconsciousThought
          extended by org.pandora.thought.language.Comprehension
All Implemented Interfaces:
Thought

public class Comprehension
extends SubconsciousThought

Analyse input for gramatic rules. Define a language state machine for input response pairs.


Nested Class Summary
static class Comprehension.PathType
          Define the traversal path types for the language state machine.
 
Field Summary
static int MAX_IDENTIFIER
           
 
Fields inherited from class org.pandora.thought.SubconsciousThought
delay, threshold
 
Constructor Summary
Comprehension()
           
 
Method Summary
 boolean checkQuotient(Vertex currentState, Vertex sentence, Vertex questionInput, Vertex responseInput, java.util.Map<Vertex,Vertex> variables, Network network)
          Check if any of the existing quotients match, if none do, then add a new quotient.
 Vertex createFormula(Vertex questionInput, Vertex responseInput, java.util.Map<Vertex,Vertex> variables, Network network)
          Attempt to create a formula response from the question and response.
 boolean isConsciousProcessingRequired()
          The input must be processed by language first to associate the question/response.
 boolean processInput(Vertex input, Network network)
          If the input is a sentence process it for language rules and variable substitution.
 boolean processState(Vertex currentState, java.util.List<Vertex> words, int index, java.lang.String statePath, Comprehension.PathType path, Vertex sentence, Vertex questionInput, Vertex responseInput, java.util.Map<Vertex,Vertex> variables, Network network)
          Check if any of the current states match the next word, if no match, or quotient does not match, add a new case.
 
Methods inherited from class org.pandora.thought.SubconsciousThought
awake, getActiveMemoryBackLog, isConscious, setActiveMemoryBackLog, think
 
Methods inherited from class org.pandora.thought.BasicThought
getName, getPandora, getPrimitive, getShortTermMemory, initialize, log, log, setName, setPandora, stop, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_IDENTIFIER

public static int MAX_IDENTIFIER
Constructor Detail

Comprehension

public Comprehension()
Method Detail

isConsciousProcessingRequired

public boolean isConsciousProcessingRequired()
The input must be processed by language first to associate the question/response.

Overrides:
isConsciousProcessingRequired in class SubconsciousThought

processInput

public boolean processInput(Vertex input,
                            Network network)
If the input is a sentence process it for language rules and variable substitution.

Specified by:
processInput in class SubconsciousThought

processState

public boolean processState(Vertex currentState,
                            java.util.List<Vertex> words,
                            int index,
                            java.lang.String statePath,
                            Comprehension.PathType path,
                            Vertex sentence,
                            Vertex questionInput,
                            Vertex responseInput,
                            java.util.Map<Vertex,Vertex> variables,
                            Network network)
Check if any of the current states match the next word, if no match, or quotient does not match, add a new case. Return if the quotient matched.


checkQuotient

public boolean checkQuotient(Vertex currentState,
                             Vertex sentence,
                             Vertex questionInput,
                             Vertex responseInput,
                             java.util.Map<Vertex,Vertex> variables,
                             Network network)
Check if any of the existing quotients match, if none do, then add a new quotient.


createFormula

public Vertex createFormula(Vertex questionInput,
                            Vertex responseInput,
                            java.util.Map<Vertex,Vertex> variables,
                            Network network)
Attempt to create a formula response from the question and response.