- public class NounResolver
- extends java.lang.Object
Resolve a NounPhrase to one instance in the ObjectTable.
- See Also:
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public NounResolver(Discourse discourse)
- Creates a new NounResolver instance.
discourse - Discourse object used in resolving nouns
public ResolvedNoun resolve(NounPhrase np)
- Searches for an instance in the ObjectTable that the NounPhrase
representes. Each part of the NounPhrase changes the search:
- Noun - The noun class will have the name of the class in the
Noun hierarchy that was assigned by the Grammar module from the
Dictionary table. This is the starting point.
This is a class, never an instance.
- Article - The two types of articles:
- Definite - Signifies the noun should be resolved
to an instance that is already defined in the discourse. For
example, the dog is outside refers to a specific instance
of a dog, not just any dog, but one the user and the computer
has referred to before.
- Indefinte - Signifies a new instance. For example,
A dog bit me refers to an
actual dog, but one that the user and computer has not spoken
about previously. This will create a new instance of dog
within the hierarchy.
- Along with the two above rules, there is an exception called
generics. Generics allow a noun to refer to a whole
class of nouns. For example:
In the above, lion refers to all lions, not just a
specific one. See the section below called Sentence Patterns.
- Lions are dangerous.
- The lion is a dangerous animal.
- A lion can be dangerous.
- Adjectives - If the article was a definite article, adjectives
can narrow the number of matching instances by applying constraints.
For example, if the system has a couple of dog instances in the
hierarchy, the phrase the white dog narrows the number of
dogs by putting a constraint on the fur color. Indefinite articles
causes adjectives to be added as attributes to newly created
- Prepositional Phrases - Prepositional phrases perform the
same function as adjectives, but establish a relationship between
the main noun and the noun object of the preposition. For example
the dog with the blue collar establishes a HASA relationship
between the dog and a blue collar. The system will search for any
dog instance with a HASA relationship with the blue collar noun
|Sentence Pattern||N1 Type||N2 Type||Example
|the N1 AV the N2||EI||EI
||The shark eat the seal|
|the N1 AV a N2||EI||CI
||The man bought a car|
|a N1 AV the N2||CI||EI
||A boy broke the window|
|a N1 AV a N2||CI||CI
||A lion killed a gazel|
|the N1 LV the N2||EI||EI
||The problem is the process|
|the N1 LV a N2||EI||C
||The dog is a Poodle|
|a N1 LV a N2||C||C
||A lion is a cat|
|PN1 LV PN2||C||C
||Wolves are hunters|
|PN1 AV PN2||C||C
||Sharks attack seals|
Legend: LV = linking verb, AV = action verb, PN = plural noun,
EI = existing instance, CI = create instance, C = class
np - NounPhrase to resolve
- A ResolvedNoun class that the NounPhrase represents
FidoException - General exception thrown if the NounPhrase could not
be processed. The exception will contain a wrapped
exception that is the root cause.