fido.linguistic.components
Class NounPhrase
java.lang.Object
|
+--fido.linguistic.components.NounPhrase
- All Implemented Interfaces:
- Noun
- public class NounPhrase
- extends java.lang.Object
- implements Noun
Represents a noun, with all associated components such as an
optional article, all of the adjectives, and all prepositional
phrases.
|
Field Summary |
static int |
CREATE_INSTANCE
Constant used by getAction() and setAction() |
static int |
EXISTING_CLASS
Constant used by getAction() and setAction() |
static int |
EXISTING_INSTANCE
Constant used by getAction() and setAction() |
|
Constructor Summary |
NounPhrase()
Creates a new NounPhrase object with no adjectives or prepositional
phrases. |
|
Method Summary |
void |
addAdjective(AdjectiveClass adj)
Adds an AdjectiveClass to this noun phrase. |
void |
addPrepositionalPhrase(PrepositionalPhrase phrase)
Adds an PrepositionalPhrase to this noun phrase. |
int |
getAction()
Returns the action the system should perform when resolving this
noun phrase. |
java.util.Iterator |
getAdjectives()
Returns an Iterator over all of the AdjectiveClass modifying
this noun phrase. |
int |
getArticleType()
Returns the type of the article. |
NounClass |
getNounClass()
Returns the NounClass for this noun phrase. |
java.util.Iterator |
getPrepositionalPhrases()
Returns an Iterator over all of the PrepositionalPhrases modifying
this noun phrase. |
void |
setAction(int action)
When resolving nouns in the Resolver module, this method is used to
store the action the system should take when resolving the noun. |
void |
setArticleType(int type)
Sets the type for the article. |
void |
setNounClass(NounClass noun)
Sets the NounClass for this noun phrase. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXISTING_INSTANCE
public static final int EXISTING_INSTANCE
- Constant used by getAction() and setAction()
- See Also:
- Constant Field Values
CREATE_INSTANCE
public static final int CREATE_INSTANCE
- Constant used by getAction() and setAction()
- See Also:
- Constant Field Values
EXISTING_CLASS
public static final int EXISTING_CLASS
- Constant used by getAction() and setAction()
- See Also:
- Constant Field Values
NounPhrase
public NounPhrase()
- Creates a new NounPhrase object with no adjectives or prepositional
phrases. Sets the article to none.
getAction
public int getAction()
- Returns the action the system should perform when resolving this
noun phrase. For a detail description on the value returned, see
setAction().
- Returns:
- The action for the system to perform for this noun phrase.
- See Also:
setAction(int)
setAction
public void setAction(int action)
- When resolving nouns in the Resolver module, this method is used to
store the action the system should take when resolving the noun. The
system could do the following:
- Create an instance - For a noun with an indefinite article,
the system will create a new instance for the noun to reference.
An example sentence: John bought a dog. Since the speaker
used an indefinte article for the noun phrase a dog, the
listener assumes this is a dog that speaker and listener has not
discussed before. Therefore, the system needs to create a new
instance of dog.
- Use an existing instance - For a noun with a definite article,
the system will search for an existing instance for the noun to
reference. An example sentence The dog chased the ball.
Since the speaker used the definite article for both the dog
and the ball, the listener can assume both objects are already
known. Therefore, the system needs to search for an instance
in the Discourse and the Object Tree.
- Use an existing class - Certain times a noun carries an
indefinite article, the noun phrase will refer to a class of objects.
An example sentence: The dog is a Poodle. Here the noun
phrase a Poodle refers to a class. The eventual action
of the sentence will be to create an instance of the Poodle class.
See the resolve() method in the NounResolver module for a detain description
on Sentence Patterns and how Nouns are resolved.
- See Also:
Discourse,
ObjectTable,
NounResolver.resolve(NounPhrase)
getArticleType
public int getArticleType()
- Returns the type of the article. Constant values are defined in
ArticleTable.
- Returns:
- The type of article for this noun phrase.
- See Also:
ArticleTable
setArticleType
public void setArticleType(int type)
- Sets the type for the article. Constant values are defined in
ArticleTable.
- See Also:
ArticleTable
getNounClass
public NounClass getNounClass()
- Returns the NounClass for this noun phrase. This is the actual
noun string and any associated Morphology tags.
- Returns:
- The NounClass for this noun phrase.
setNounClass
public void setNounClass(NounClass noun)
- Sets the NounClass for this noun phrase. This is the actual
noun string and any associated Morphology tags.
- Parameters:
noun - The NounClass for this noun phrase.
getAdjectives
public java.util.Iterator getAdjectives()
- Returns an Iterator over all of the AdjectiveClass modifying
this noun phrase.
- Returns:
- An Iterator of AdjectiveClass classes.
addAdjective
public void addAdjective(AdjectiveClass adj)
- Adds an AdjectiveClass to this noun phrase. The AdjectiveClass
represents an adjective modifying the noun.
- Parameters:
adj - Adjective to add.
getPrepositionalPhrases
public java.util.Iterator getPrepositionalPhrases()
- Returns an Iterator over all of the PrepositionalPhrases modifying
this noun phrase.
- Returns:
- An Iterator of PrepositionalPhrase classes.
addPrepositionalPhrase
public void addPrepositionalPhrase(PrepositionalPhrase phrase)
- Adds an PrepositionalPhrase to this noun phrase. The PrepositionalPhrase
represents an adjectivial prepositional phrase modifying the noun.
- Parameters:
phrase - PrepositionalPhrase to add.