org.hops.og
Class TalpGen

java.lang.Object
  extended by org.hops.og.TalpGen
Direct Known Subclasses:
FREEGen

public class TalpGen
extends java.lang.Object

TalpGen.java

Version:
3.0 This class builts Files and Sentences for the front-ends, This is a superclass. The subclasses implements the channel dependent functions. For example, vxml for voice channel, txml for text channel, or only messages xml-free for chat.
Author:
Meritxell Gonzalez

Field Summary
protected  java.lang.String acro
          city acronim for grammars name
protected  java.lang.String city
          city name for language generator
protected  java.lang.Object logger
          logging process
protected  java.lang.String m_channelId
          user channel
protected  java.lang.String m_lang
          user language
protected  HopsLang m_messages
          messages for the Language Generator
protected  AttributesTaxonomy m_taxonomy
          Attributes information
 
Constructor Summary
TalpGen()
          Creates a new instance of TalpGen
TalpGen(og_util.NLPParameters param, HopsLang messages, AttributesTaxonomy taxonomy)
          Creates a new instance of TXMLGen.
 
Method Summary
protected  int extractPageType(stackact next_moves)
          Decides which will be the next page type depending on the moves in the next_moves stack.
protected  ResponseData genErrorResponse(java.lang.String msg)
          Generation of error pages.
protected  ResponseData genLanguageSelectorResponse()
          Generation of language selector page.
protected  ResponseData genMessageResponse(stackact next_moves)
          Generation of End pages If the subclass cannot create the document, an Error page is created.
protected  ResponseData genQueryResponse(stackact next_moves)
          Generation of simple pages If the subclass cannot create the document, an Error page is created.
 ResponseData genResponse(java.lang.String channelId, java.lang.String Lang, stackact next_moves, IS state, UserModel _um)
          Sets the UserModel to the LG module, and selects the type-of-actions next response depending on the actionis in the next_moves stack.
protected  ResponseData genResultsListResponse(stackact next_moves)
          Generation of list of things page If the subclass cannot create the document, an Error page is created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected java.lang.Object logger
logging process


m_messages

protected HopsLang m_messages
messages for the Language Generator


m_taxonomy

protected AttributesTaxonomy m_taxonomy
Attributes information


m_lang

protected java.lang.String m_lang
user language


m_channelId

protected java.lang.String m_channelId
user channel


city

protected java.lang.String city
city name for language generator


acro

protected java.lang.String acro
city acronim for grammars name

Constructor Detail

TalpGen

public TalpGen()
Creates a new instance of TalpGen


TalpGen

public TalpGen(og_util.NLPParameters param,
               HopsLang messages,
               AttributesTaxonomy taxonomy)
Creates a new instance of TXMLGen. Reads the params and store the rest of classes and attributes.

Parameters:
param - the parameters
messages - the Language Generator
taxonomy - the attributes information
Method Detail

genResponse

public ResponseData genResponse(java.lang.String channelId,
                                java.lang.String Lang,
                                stackact next_moves,
                                IS state,
                                UserModel _um)
Sets the UserModel to the LG module, and selects the type-of-actions next response depending on the actionis in the next_moves stack. Then replace the value gaps with the information in the IST-values of the DM current state. If the language has not been setted, the language-selection page is used. If next_moves is null but not language, an error messages are shown.

Parameters:
channelId - the user channel
Lang - the user language
next_moves - the next moves to generate
state - the IST from the DM
_um - the user model
Returns:
ResponseData containing the xml page and the messages
See Also:
ResponseData

extractPageType

protected int extractPageType(stackact next_moves)
Decides which will be the next page type depending on the moves in the next_moves stack. Available type of pages are: paginarion, quiting, asking and answering, error

Parameters:
next_moves - the next moves to generate
Returns:
the page type identification

genQueryResponse

protected ResponseData genQueryResponse(stackact next_moves)
Generation of simple pages If the subclass cannot create the document, an Error page is created.

Parameters:
next_moves - moves to generate
Returns:
txml document

genMessageResponse

protected ResponseData genMessageResponse(stackact next_moves)
Generation of End pages If the subclass cannot create the document, an Error page is created.

Parameters:
next_moves - the stack of moves to generate
Returns:
txml the document

genResultsListResponse

protected ResponseData genResultsListResponse(stackact next_moves)
Generation of list of things page If the subclass cannot create the document, an Error page is created.

Parameters:
next_moves - moves to generate
Returns:
txml document

genErrorResponse

protected ResponseData genErrorResponse(java.lang.String msg)
Generation of error pages. If the subclass cannot create the document, an empty page is created.

Parameters:
msg - the error message
Returns:
the txml page

genLanguageSelectorResponse

protected ResponseData genLanguageSelectorResponse()
Generation of language selector page. If the subclass cannot create the document, an empty page is created.

Returns:
the txml page