demo.inpro.system.greifarm
Class NLU

java.lang.Object
  extended by demo.inpro.system.greifarm.NLU

public class NLU
extends java.lang.Object

this encapsulates natural language understanding


Field Summary
private  org.apache.log4j.Logger logger
           
private  java.util.Deque<ActionIU> performedActions
           
private  java.util.Deque<WordIU> unusedWords
           
 
Constructor Summary
NLU(java.util.Deque<WordIU> unusedWords, java.util.Deque<ActionIU> performedActions)
           
 
Method Summary
private  ActionType actionType(WordIU iu)
           
private  void addRepetitiveMaxAction()
          if people say a direction many times in a row, we initiate a MAX-action in that direction, in order to speed things up (and to force them to use the STOP command more often... )
private  ActionStrength getModifierValue(WordIU word, ActionStrength strengthModifier)
          we only interpret the very last modifier word; that is, things like "sehr weit" are handled just like "weit" "ganz weit nach" should really be interpreted like "ganz nach", not like "weit nach" at the same time, "ganz bisschen" *should* be interpreted like "bisschen" in other words: max followed by strong should remain strong.
 void incrementallyUnderstandUnusedWords()
          after each hypothesis, we try to find one (or more) "commands", which we define as "(contentlessWord | modifierWord)* actionWord", i.e. a sequence of words leading up to and including an actionWord.
private  boolean isActionWord(WordIU iu)
           
private  boolean isModifierWord(WordIU iu)
           
 void understandUnusedWordsOnCommit()
          on commit, we try a little harder to interpret any remaining words of the utterance: if no explicit action word is available, we simply assume that CONTINUE was meant and interpret only the WEAK, NORMAL, and STRONG modifiers;; also, and only on commit, we execute a MAX action, if there have been at least three consecutive NORMAL or STRONG actions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private final org.apache.log4j.Logger logger

unusedWords

private final java.util.Deque<WordIU> unusedWords

performedActions

private final java.util.Deque<ActionIU> performedActions
Constructor Detail

NLU

public NLU(java.util.Deque<WordIU> unusedWords,
           java.util.Deque<ActionIU> performedActions)
Method Detail

incrementallyUnderstandUnusedWords

public void incrementallyUnderstandUnusedWords()
after each hypothesis, we try to find one (or more) "commands", which we define as "(contentlessWord | modifierWord)* actionWord", i.e. a sequence of words leading up to and including an actionWord. the action depends on the actionWord's ActionType, and the *last* modifierWord's ActionStrength


understandUnusedWordsOnCommit

public void understandUnusedWordsOnCommit()
on commit, we try a little harder to interpret any remaining words of the utterance: if no explicit action word is available, we simply assume that CONTINUE was meant and interpret only the WEAK, NORMAL, and STRONG modifiers;; also, and only on commit, we execute a MAX action, if there have been at least three consecutive NORMAL or STRONG actions


isActionWord

private boolean isActionWord(WordIU iu)

isModifierWord

private boolean isModifierWord(WordIU iu)

addRepetitiveMaxAction

private void addRepetitiveMaxAction()
if people say a direction many times in a row, we initiate a MAX-action in that direction, in order to speed things up (and to force them to use the STOP command more often... )


getModifierValue

private ActionStrength getModifierValue(WordIU word,
                                        ActionStrength strengthModifier)
we only interpret the very last modifier word; that is, things like "sehr weit" are handled just like "weit" "ganz weit nach" should really be interpreted like "ganz nach", not like "weit nach" at the same time, "ganz bisschen" *should* be interpreted like "bisschen" in other words: max followed by strong should remain strong.

Parameters:
word - the word to be interpreted
strengthModifier - the previous modifier value

actionType

private ActionType actionType(WordIU iu)