Fido Alpha 3.2

fido.db
Class WordSense

java.lang.Object
  |
  +--fido.db.WordSense
All Implemented Interfaces:
java.io.Serializable

public class WordSense
extends java.lang.Object
implements java.io.Serializable

A word sense is a way a word can be used. A word may have multiple word senses. A word sense can be multiple parts of speech. For example:

Each word sense contains a GrammarString and a pointer to a object in the ObjectTable that represents the word sense.

See Also:
ObjectTable, Serialized Form

Constructor Summary
WordSense(BooleanTree grammarTree, java.lang.String grammarString, int object)
          Constructs a new WordSense with the GrammarString grammarString and the pointer to an object in the ObjectTable object.
 
Method Summary
 void addMorphologyTags(java.util.Collection tags)
          Adds a MorphologyTag to this WordSense.
 boolean containsTag(java.lang.String tag)
          Looks for a given morphology tag in this Word Sense.
 java.lang.String getGrammarString()
          Returns the grammar string for this word sense.
 BooleanTree getGrammarTree()
          Returns the grammar tree for this word sense.
 int getRepresentedObject()
          Returns the name of the name of the object in the ObjectTable for this word sense represents.
 java.lang.String getRootForm()
          Returns the root form of the word.
 void setRootForm(java.lang.String str)
          Sets the root form of the word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordSense

public WordSense(BooleanTree grammarTree,
                 java.lang.String grammarString,
                 int object)
Constructs a new WordSense with the GrammarString grammarString and the pointer to an object in the ObjectTable object.

Parameters:
grammarString - String containing the grammar string
grammarTree - BooleanTree representing the grammar string
object - Id of the object in the ObjectList
Throws:
GrammarParseException - thrown if the grammarString cannot be parsed
See Also:
Grammar.insertWord(fido.linguistic.WordPackage)
Method Detail

getGrammarTree

public BooleanTree getGrammarTree()
Returns the grammar tree for this word sense.

Returns:
A BooleanTree of the GrammarString

getGrammarString

public java.lang.String getGrammarString()
Returns the grammar string for this word sense.

Returns:
A String containing the GrammarString

getRepresentedObject

public int getRepresentedObject()
Returns the name of the name of the object in the ObjectTable for this word sense represents.

Returns:
the object id for this WordSense

addMorphologyTags

public void addMorphologyTags(java.util.Collection tags)
Adds a MorphologyTag to this WordSense. If Morphology has to find the root of the word to find it in the DictionaryTable, the tags used to find the root are stored for later processing.

Parameters:
tags - Collection of MorphologyTags used to get the root form of the word
See Also:
LanguageMorphologyTable

containsTag

public boolean containsTag(java.lang.String tag)
Looks for a given morphology tag in this Word Sense. The tag will represent a modification from the surface form.

Returns:
True if the WordSense contains the morphology tag. False otherwise.

setRootForm

public void setRootForm(java.lang.String str)
Sets the root form of the word. The root form is derived from the surface form. The surface form is the actual string from the user input. The root form is realized after any morphology changes.

Parameters:
str - Root form of the word

getRootForm

public java.lang.String getRootForm()
Returns the root form of the word.

Returns:
String containing the root form of the word

Fido Alpha 3.2