org.hops.ext
Class parserinterpreter

java.lang.Object
  extended by org.hops.ext.parserinterpreter

public class parserinterpreter
extends java.lang.Object

calls the parser implemented by TALP It is the bridge between DM and NLA


Constructor Summary
parserinterpreter()
          Creates a new instance of generic parser interpreter
parserinterpreter(java.lang.String host, java.lang.String port, java.lang.String path, java.lang.String method, java.lang.String grammars_file)
          Creates a new instance of talp parser
 
Method Summary
 RecognizedUserInput DoAnalyzerCall(java.util.ArrayList expectedAttributes, java.lang.String userinput, java.lang.String lang)
          Gets XML page from parser and extracts the user moves
static utterance GetNextUsrUt(java.lang.String sysmessage, PlanSet plans)
          gets an utterance throw the console
 RecognizedUserInput GetNextUsrUtParser(java.util.ArrayList sysmessage, java.util.ArrayList expectedAttributes, java.lang.String lang)
          Gets the user sentence, calls the parser and generates a RecognizedUserInput
 utterance Interpret(PlanSet plan, RecognizedUserInput userInput, ResponseData lastRD, java.lang.String serviceId)
          Converts the RecognizedUserInput to a utterance object understandable by the DM.
static void Interpret(PlanSet plan, utterance actualut, ResponseData lastRD, java.lang.String serviceId)
          dummy interpret, shows the actualut by the console
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

parserinterpreter

public parserinterpreter(java.lang.String host,
                         java.lang.String port,
                         java.lang.String path,
                         java.lang.String method,
                         java.lang.String grammars_file)
Creates a new instance of talp parser


parserinterpreter

public parserinterpreter()
Creates a new instance of generic parser interpreter

Method Detail

Interpret

public utterance Interpret(PlanSet plan,
                           RecognizedUserInput userInput,
                           ResponseData lastRD,
                           java.lang.String serviceId)
Converts the RecognizedUserInput to a utterance object understandable by the DM. Take into account booleans!! We should differentiate the NO answers from the NEGATION of values

Parameters:
plan - the plans of the DM
userInput - the parser result
lastRD - the last ResponseData generated by the system
Returns:
the new object utterance

GetNextUsrUtParser

public RecognizedUserInput GetNextUsrUtParser(java.util.ArrayList sysmessage,
                                              java.util.ArrayList expectedAttributes,
                                              java.lang.String lang)
Gets the user sentence, calls the parser and generates a RecognizedUserInput

Parameters:
sysmessage - the system message shown to the user
Returns:
the user sentence parsed

DoAnalyzerCall

public RecognizedUserInput DoAnalyzerCall(java.util.ArrayList expectedAttributes,
                                          java.lang.String userinput,
                                          java.lang.String lang)
Gets XML page from parser and extracts the user moves

Parameters:
expectedAttributes - expected attribute from the user
userinput - XML page from parser
Returns:
the user's moves

Interpret

public static void Interpret(PlanSet plan,
                             utterance actualut,
                             ResponseData lastRD,
                             java.lang.String serviceId)
dummy interpret, shows the actualut by the console

Parameters:
plan - the DM plans
actualut - the console utterance got
lastRD - the last system responsedata

GetNextUsrUt

public static utterance GetNextUsrUt(java.lang.String sysmessage,
                                     PlanSet plans)
gets an utterance throw the console

Parameters:
sysmessage - the system supposed message
Returns:
the built utterance