edu.stanford.nlp.lexgram
Class SimpleLexicon

java.lang.Object
  |
  +--edu.stanford.nlp.lexgram.SimpleLexicon
All Implemented Interfaces:
Lexicon

public final class SimpleLexicon
extends Object
implements Lexicon

Implements a simple lexicon that maps from POS tags to words.


Constructor Summary
SimpleLexicon()
           
 
Method Summary
 void addTagging(Label tag, Word word)
           
 void addTagging(Label tag, Word word, double score)
           
 Collection getAllTags()
           
 Collection getTagsByWord(Word word)
           
 Collection getWordsByTag(Label tag)
           
 void removeTagging(Label tag, Word word)
           
 void removeTagging(Label tag, Word word, double score)
           
 double scoreTagging(Label tag, Word word)
           
 int size()
          Return the number of words in the lexicon
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleLexicon

public SimpleLexicon()
Method Detail

size

public int size()
Return the number of words in the lexicon

Returns:
number of words in lexicon

addTagging

public void addTagging(Label tag,
                       Word word)
Specified by:
addTagging in interface Lexicon

removeTagging

public void removeTagging(Label tag,
                          Word word)
Specified by:
removeTagging in interface Lexicon

addTagging

public void addTagging(Label tag,
                       Word word,
                       double score)

removeTagging

public void removeTagging(Label tag,
                          Word word,
                          double score)

getTagsByWord

public Collection getTagsByWord(Word word)
Specified by:
getTagsByWord in interface Lexicon

getAllTags

public Collection getAllTags()
Specified by:
getAllTags in interface Lexicon

getWordsByTag

public Collection getWordsByTag(Label tag)
Specified by:
getWordsByTag in interface Lexicon

scoreTagging

public double scoreTagging(Label tag,
                           Word word)
Specified by:
scoreTagging in interface Lexicon

toString

public String toString()
Overrides:
toString in class Object


Stanford NLP Group