Class Word

java.lang.Object
  |
  +--Word

public class Word
extends java.lang.Object

Storage for a word in a lexicon. Words have the following information associated with them: the word itself, as represented in English text, and a list of all the word's varying syntactic roles and semantic interpretations.


Constructor Summary
Word(java.lang.String text, Role newRole)
          Creates a word, with a set pronunciation.
 
Method Summary
 void addAllSenses(Word other)
          Adds all the senses of some other word to this word.
 void addRole(Role newRole)
          Adds a new role to a word.
 LexItem[] getLexItems(int begin)
          Makes a bunch of lexical items from this word, one per role.
 LexItem[] getLexItems(int begin, PrologEngine engine)
          Makes a bunch of lexical items from this word, one per role.
 java.lang.String getText()
          Returns the text of this word.
 java.lang.String toString()
          Gets this word as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Word

public Word(java.lang.String text,
            Role newRole)
Creates a word, with a set pronunciation.

Parameters:
text - the English text for the word.
newRole - the role (meaning and syntax) for the word.
Method Detail

addRole

public void addRole(Role newRole)
Adds a new role to a word.

Parameters:
newRole - the new role.

addAllSenses

public void addAllSenses(Word other)
Adds all the senses of some other word to this word. These must be the same word.

Parameters:
other - the other word.
Throws:
java.lang.RuntimeException - if not the same word.

getText

public java.lang.String getText()
Returns the text of this word.


getLexItems

public LexItem[] getLexItems(int begin,
                             PrologEngine engine)
Makes a bunch of lexical items from this word, one per role. Computes the canonical prolog name of each sense by order in iteration through the sense list. This name is ''. Uses parameterized beginning and ending marks.

Parameters:
begin - the beginning.
engine - the prolog engine.
Returns:
an array of LexItems.

getLexItems

public LexItem[] getLexItems(int begin)
Makes a bunch of lexical items from this word, one per role. Computes the canonical prolog name of each sense by order in iteration through the sense list. This name is ''. Held is always false. Uses parameterized beginning and ending marks.

Parameters:
begin - the beginning.
Returns:
an array of LexItems.

toString

public java.lang.String toString()
Gets this word as a string.

Overrides:
toString in class java.lang.Object
Returns:
the string.