Class Lexicon

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byLexicon
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Direct Known Subclasses:
AugmentedLexicon

public class Lexicon
extends java.util.HashMap

A Lexicon is a set of Constituents indexed by word. There can be more than one Constituent for a word (corresponding to different senses of the word).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Field Summary
(package private)  java.lang.String description
          The text description of this Lexicon.
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
Lexicon()
           
 
Method Summary
 void add(Symbol word, Constituent constit)
          Add Constituent to list of entries for word, creating the list if necessary.
 void dump()
          Dump the contents of this Lexicon to System.out.
 void dump(java.io.PrintStream stream)
          Dump the contents of this Lexicon to the given PrintStream.
 java.lang.String getDescription()
          Returns the text description of this Lexicon.
 java.util.List getEntriesForWord(Symbol word)
          Retrieve the List of Constituents associated with WORD.
 void readFile(java.lang.String filename)
          Read the given filename and augment this Lexicon.
 void setDescription(java.lang.String description)
          Sets the text description of this Lexicon.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

description

java.lang.String description
The text description of this Lexicon. This may be useful in displays, tools, or just as a comment in the files.

Constructor Detail

Lexicon

public Lexicon()
Method Detail

add

public void add(Symbol word,
                Constituent constit)
Add Constituent to list of entries for word, creating the list if necessary.


getEntriesForWord

public java.util.List getEntriesForWord(Symbol word)
Retrieve the List of Constituents associated with WORD.


dump

public void dump()
Dump the contents of this Lexicon to System.out.


dump

public void dump(java.io.PrintStream stream)
Dump the contents of this Lexicon to the given PrintStream.


getDescription

public java.lang.String getDescription()
Returns the text description of this Lexicon.


setDescription

public void setDescription(java.lang.String description)
Sets the text description of this Lexicon.


readFile

public void readFile(java.lang.String filename)
              throws java.io.IOException
Read the given filename and augment this Lexicon.

Throws:
java.io.IOException
See Also:
LexiconFileHandler