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.
SimpleLexicon
public SimpleLexicon()
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