public class Utterance
extends java.lang.Object
Constructor and Description |
---|
Utterance(CharTokenizer tokenizer)
Creates an utterance with the given set of tokenized text.
|
Modifier and Type | Method and Description |
---|---|
Relation |
createRelation(java.lang.String name)
Creates a new relation with the given name and adds it to this
utterance.
|
Item |
getItem(java.lang.String relation,
float time)
Returns the Item in the given Relation associated with the given time.
|
Relation |
getRelation(java.lang.String name)
Retrieves a relation from this utterance.
|
boolean |
hasRelation(java.lang.String name)
Determines if this utterance contains a relation with the given name.
|
void |
remove(java.lang.String name)
Removes the named feature from this set of features.
|
void |
setFloat(java.lang.String name,
float value)
Convenience method that sets the named feature as a float.
|
void |
setInt(java.lang.String name,
int value)
Convenience method that sets the named feature as an int.
|
void |
setObject(java.lang.String name,
java.lang.Object value)
Sets the named feature.
|
void |
setString(java.lang.String name,
java.lang.String value)
Convenience method that sets the named feature as a String.
|
public Utterance(CharTokenizer tokenizer)
tokenizer
- tokenizer to use for utterance.public Relation createRelation(java.lang.String name)
name
- the name of the new relationpublic Relation getRelation(java.lang.String name)
name
- the name of the Relationpublic boolean hasRelation(java.lang.String name)
name
- the name of the relation of interest.public void remove(java.lang.String name)
name
- the name of the feature of interestpublic void setInt(java.lang.String name, int value)
name
- the name of the featurevalue
- the value of the featurepublic void setFloat(java.lang.String name, float value)
name
- the name of the featurevalue
- the value of the featurepublic void setString(java.lang.String name, java.lang.String value)
name
- the name of the featurevalue
- the value of the featurepublic void setObject(java.lang.String name, java.lang.Object value)
name
- the name of the featurevalue
- the value of the featurepublic Item getItem(java.lang.String relation, float time)
relation
- the name of the relationtime
- the time