|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fido.linguistic.Discourse
This class holds the previous sentence structure and nouns in the previous sentence for use with pronoun resolving.
The Discourse holds the following nouns:
Discourse also holds a pool of nouns that previous sentences have accessed. This is a subset of items that the user and the system have talked about. This provides a smaller, more direct set of objects for the system to search through when resolving a noun.
For example: The user enters: I just bought a dog Then, The dog is white. Without the discourse pool, the phrase the dog would attempt to match any instance of dog in the system. With the pool, the first sentence adds a new dog instance to the pool. If this is the only dog the user has mentioned, the system would quickly match the dog to the dog in the previous sentence.
The Discourse also keeps the mood of the previous sentence. This is used by the Fragment Resolver to resolve fragments and questions.
The final piece of information the Discourse module holds is the previous Phrase Structure. This is used by the Ellipsis module to match to the current structure and fill in parts of the sentence that are missing.
Ellipsis
,
FragmentResolver
Field Summary | |
static int |
COMMAND
Value for setMood(int) |
static int |
NO_DISCOURSE
Value for setMood(int) meaning there was not previous sentence |
static int |
QUESTION
Value for setMood(int) |
Constructor Summary | |
Discourse()
Creates a new Discourse instance |
Method Summary | |
void |
addContextPool(int objectId)
Adds an object id to the context pool. |
java.util.Collection |
getContextPool(int objectRoot)
This method returns all of the objects in the ContextPool that are in the subtree with objectRoot as the root. |
int |
getFemale()
Returns the objectId for the previous female object. |
int |
getMale()
Returns the objectId for the previous male object. |
int |
getNeuter()
Returns the objectId for the previous neuter object. |
int |
getPreviousMood()
Returns the mood of the previous input. |
Sentence |
getPreviousStructure()
Returns the Sentence structure previously saved off. |
java.util.Iterator |
iterateContextPool()
Returns a list of objects in the context pool. |
boolean |
lookupContextPool(int objectId)
Checks if an object id is in the Context pool. |
void |
setFemale(int objectId)
Sets the pronoun antecedent for the previous female object. |
void |
setMale(int objectId)
Sets the pronoun antecedent for the previous male object. |
void |
setNeuter(int objectId)
Sets the pronoun antecedent for objects not either male or female. |
void |
setPreviousMood(int mood)
Sets the mood of the previous input. |
void |
setPreviousStructure(Sentence structure)
Saves the Sentence structure for following commands to use ellipsis. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_DISCOURSE
public static final int COMMAND
public static final int QUESTION
Constructor Detail |
public Discourse()
Method Detail |
public java.util.Iterator iterateContextPool()
public void addContextPool(int objectId)
objectId
- ObjectId to add.public java.util.Collection getContextPool(int objectRoot) throws FidoDatabaseException
objectRoot
- ObjectId of the object at the root
of the subtree to search.
FidoDatabaseException
public boolean lookupContextPool(int objectId)
objectId
- Object id to lookup.
public void setNeuter(int objectId)
objectId
- ObjectId to set as the last neuter objectpublic int getNeuter()
public void setMale(int objectId)
objectId
- ObjectId to set as the last male objectpublic int getMale()
public void setFemale(int objectId)
objectId
- ObjectId to set as the last female objectpublic int getFemale()
public void setPreviousStructure(Sentence structure)
Ellipsis
public Sentence getPreviousStructure()
Ellipsis
public void setPreviousMood(int mood)
mood
- mood of the previous input.public int getPreviousMood()
|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |