|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hops.lg.LanguageGenerator
public class LanguageGenerator
LanguageGenerator.java
Constructor Summary | |
---|---|
LanguageGenerator(java.lang.String nlgmessages,
java.lang.String nlglexic)
creates a new instance of LanguageGenerator |
Method Summary | |
---|---|
java.lang.String |
GenerateValuePhrase(java.util.ArrayList values)
Generates an enumerations of values uses the AND lexic to join the values. |
java.lang.String[] |
getFreePhrases(java.lang.String key,
java.util.ArrayList values,
java.lang.String linki)
returns the phrases stored for the key |
java.lang.String[] |
getMenuPhrases(java.lang.String attribute,
java.util.ArrayList attr_values,
java.util.ArrayList values_phrase)
Generates two menu-sentences. |
java.lang.String |
getPhrase(java.lang.String key,
int ord)
returns the phrase stored for the key |
void |
setDateFormat(java.lang.String _dateformat)
set the date format |
void |
setUserModel(UserModel _um)
set the User Model |
protected java.util.ArrayList |
TranslateDate(java.util.ArrayList values)
Translates the date to the default date format (depends on the language value). |
protected java.lang.String |
translateDate(java.lang.String valuein)
Translates the date to the default date format (depends on the language value). |
protected java.lang.String |
translateValue(java.lang.String valuein)
Translate values using the lexicon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LanguageGenerator(java.lang.String nlgmessages, java.lang.String nlglexic)
nlgmessages
- the file containing the messagesnlglexic
- the file containing lexiconMethod Detail |
---|
public void setUserModel(UserModel _um)
_um
- the user modelpublic void setDateFormat(java.lang.String _dateformat)
_dateformat
- the String of format, for example MMMM dd'th' yyyypublic java.lang.String[] getFreePhrases(java.lang.String key, java.util.ArrayList values, java.lang.String linki)
key
- the action key to searchvalues
- the list of values for the current action
public java.lang.String getPhrase(java.lang.String key, int ord)
key
- the action key to searchord
- the num of phrase we want
public java.lang.String[] getMenuPhrases(java.lang.String attribute, java.util.ArrayList attr_values, java.util.ArrayList values_phrase)
attribute
- the name of the attributeattr_values
- possible values of the attributevalues_phrase
- the phrases for each value
xx.0=Si tiene en mente @value@ diga @get_word()@
xx.1=Si quiere @value@ marque @get_number()@
public java.lang.String GenerateValuePhrase(java.util.ArrayList values)
values
- the array of values
protected java.util.ArrayList TranslateDate(java.util.ArrayList values)
values
- input in VOICESIMPLEDATEFORMAT
protected java.lang.String translateDate(java.lang.String valuein)
valuein
- the date in VOICESIMPLEDATEFORMAT
protected java.lang.String translateValue(java.lang.String valuein)
valuein
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |