eu.semaine.components.dialogue.interpreters
Class UtteranceInterpreter

java.lang.Object
  extended by java.lang.Thread
      extended by eu.semaine.components.Component
          extended by eu.semaine.components.dialogue.interpreters.UtteranceInterpreter
All Implemented Interfaces:
SEMAINEMessageAvailableListener, java.lang.Runnable

public class UtteranceInterpreter
extends Component

This class interprets the dialog and extends it with detected semantic features

Version:
0.1 - dummy class
Author:
Mark tM

Nested Class Summary
 
Nested classes/interfaces inherited from class eu.semaine.components.Component
Component.State
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static long LONG_LENGTH
           
static long SHORT_LENGTH
           
 
Fields inherited from class eu.semaine.components.Component
inputWaiting, isInput, isOutput, log, meta, receivers, senders, state, waitingTime
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UtteranceInterpreter()
          Constructor DialogInterpreter
 
Method Summary
 void act()
          Overrides the act()-method of Component, does nothing currently
 eu.semaine.components.dialogue.datastructures.DialogueAct analyseData(java.lang.String data, long starttime)
          Analyses the given data (the utterance) for features
 boolean detectAboutCurrentCharacter(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the 'aboutCurrentCharacter'-feature in the given DialogueAct
 boolean detectAboutOtherCharacter(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the 'aboutOtherCharacter'-feature in the given DialogueAct Not implemented yet
 boolean detectAboutOtherPeople(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the 'aboutOtherPeople'-feature in the given DialogueAct
 boolean detectAboutOwnFeelings(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the 'aboutOwnFeelings'-feature in the given DialogueAct
 boolean detectAction(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects talking about an action in the given DialogueAct
 boolean detectAgree(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects agreement in the given DialogueAct
 boolean detectChangeSpeaker(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects a request to change the speaker in the given DialogueAct
 boolean detectDisagree(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects disagreement in the given DialogueAct
 boolean detectEvent(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects talking about an event in the given DialogueAct
 boolean detectFuture(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects talking about the future in the given DialogueAct
 eu.semaine.components.dialogue.datastructures.DialogueAct.Length detectLength(eu.semaine.components.dialogue.datastructures.DialogueAct act)
           
 boolean detectPast(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects talking about the past in the given DialogueAct
 int detectPolarity(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the polarity in the given DialogueAct
 boolean detectPragmatic(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the 'pragmatic'-feature in the given DialogueAct
 boolean detectTalkAboutSelf(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the 'talkAboutSelf'-feature in the given DialogueAct
 java.lang.String detectTargetCharacter(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Detects the target character in the given DialogueAct
 int getNumberOfNegWords(java.lang.String utteranceOriginal)
          Returns the number of negative words/phrases in the given string
 int getNumberOfPosWords(java.lang.String utteranceOriginal)
          Returns the number of positive words/phrases in the given string
 java.lang.String getTaggedUtterance(java.lang.String str)
          Returns the utterance tagged with PoS-tags
 java.lang.String[] getTags(java.lang.String taggedUtterance)
          Returns an array with all tags found in the given tagged utterance
 void processHeadMovements(StateInfo stateInfo)
           
 void react(SEMAINEMessage m)
          Called when a new message is received * Checks if the message contains an input-sentence. * Also checks if the user is finished speaking
 void sendDialogueAct(eu.semaine.components.dialogue.datastructures.DialogueAct act)
           
 void sendDialogueActOld(eu.semaine.components.dialogue.datastructures.DialogueAct act)
          Creates an EmmaMessage with the utterance and all detected features
 
Methods inherited from class eu.semaine.components.Component
customStartIO, exitRequested, getMeta, hasSystemJustBecomeReady, messageAvailableFrom, requestExit, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHORT_LENGTH

public static long SHORT_LENGTH

LONG_LENGTH

public static long LONG_LENGTH
Constructor Detail

UtteranceInterpreter

public UtteranceInterpreter()
                     throws JMSException,
                            java.io.IOException
Constructor DialogInterpreter

Throws:
JMSException
java.io.IOException
Method Detail

act

public void act()
         throws JMSException
Overrides the act()-method of Component, does nothing currently

Overrides:
act in class Component
Throws:
JMSException - if communication with the JMS server goes wrong.

react

public void react(SEMAINEMessage m)
           throws JMSException
Called when a new message is received * Checks if the message contains an input-sentence. * Also checks if the user is finished speaking

Overrides:
react in class Component
Throws:
JMSException - if communication with the JMS server goes wrong.

processHeadMovements

public void processHeadMovements(StateInfo stateInfo)
                          throws JMSException
Throws:
JMSException

sendDialogueAct

public void sendDialogueAct(eu.semaine.components.dialogue.datastructures.DialogueAct act)
                     throws JMSException
Throws:
JMSException

sendDialogueActOld

public void sendDialogueActOld(eu.semaine.components.dialogue.datastructures.DialogueAct act)
                        throws JMSException
Creates an EmmaMessage with the utterance and all detected features

Parameters:
act -
Throws:
JMSException

analyseData

public eu.semaine.components.dialogue.datastructures.DialogueAct analyseData(java.lang.String data,
                                                                             long starttime)
Analyses the given data (the utterance) for features

Parameters:
data -
Returns:

detectPolarity

public int detectPolarity(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the polarity in the given DialogueAct

Parameters:
act -
Returns:

detectAgree

public boolean detectAgree(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects agreement in the given DialogueAct

Parameters:
act -
Returns:

detectDisagree

public boolean detectDisagree(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects disagreement in the given DialogueAct

Parameters:
act -
Returns:

detectAboutOtherPeople

public boolean detectAboutOtherPeople(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the 'aboutOtherPeople'-feature in the given DialogueAct

Parameters:
act -
Returns:

detectAboutOtherCharacter

public boolean detectAboutOtherCharacter(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the 'aboutOtherCharacter'-feature in the given DialogueAct Not implemented yet

Parameters:
act -
Returns:

detectAboutCurrentCharacter

public boolean detectAboutCurrentCharacter(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the 'aboutCurrentCharacter'-feature in the given DialogueAct

Parameters:
act -
Returns:

detectAboutOwnFeelings

public boolean detectAboutOwnFeelings(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the 'aboutOwnFeelings'-feature in the given DialogueAct

Parameters:
act -
Returns:

detectPragmatic

public boolean detectPragmatic(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the 'pragmatic'-feature in the given DialogueAct

Parameters:
act -
Returns:

detectTalkAboutSelf

public boolean detectTalkAboutSelf(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the 'talkAboutSelf'-feature in the given DialogueAct

Parameters:
act -
Returns:

detectFuture

public boolean detectFuture(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects talking about the future in the given DialogueAct

Parameters:
act -
Returns:

detectPast

public boolean detectPast(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects talking about the past in the given DialogueAct

Parameters:
act -
Returns:

detectEvent

public boolean detectEvent(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects talking about an event in the given DialogueAct

Parameters:
act -
Returns:

detectAction

public boolean detectAction(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects talking about an action in the given DialogueAct

Parameters:
act -
Returns:

detectChangeSpeaker

public boolean detectChangeSpeaker(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects a request to change the speaker in the given DialogueAct

Parameters:
act -
Returns:

detectTargetCharacter

public java.lang.String detectTargetCharacter(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Detects the target character in the given DialogueAct

Parameters:
act -
Returns:

detectLength

public eu.semaine.components.dialogue.datastructures.DialogueAct.Length detectLength(eu.semaine.components.dialogue.datastructures.DialogueAct act)

getTaggedUtterance

public java.lang.String getTaggedUtterance(java.lang.String str)
Returns the utterance tagged with PoS-tags

Parameters:
str -
Returns:

getTags

public java.lang.String[] getTags(java.lang.String taggedUtterance)
Returns an array with all tags found in the given tagged utterance

Parameters:
taggedUtterance -
Returns:

getNumberOfPosWords

public int getNumberOfPosWords(java.lang.String utteranceOriginal)
Returns the number of positive words/phrases in the given string

Parameters:
utteranceOriginal -
Returns:

getNumberOfNegWords

public int getNumberOfNegWords(java.lang.String utteranceOriginal)
Returns the number of negative words/phrases in the given string

Parameters:
utteranceOriginal -
Returns: