edu.stanford.nlp.tagger.maxent
Class TTags
java.lang.Object
edu.stanford.nlp.tagger.maxent.TTags
public class TTags
- extends Object
This class holds the POS tags, assigns them unique ids, and knows which tags
are open versus closed class.
Title: StanfordMaxEnt
Description: A Maximum Entropy Toolkit
Company: Stanford University
- Author:
- Kristina Toutanova
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
index
public Index<String> index
CLOSED_TAG_THRESHOLD
public static int CLOSED_TAG_THRESHOLD
TTags
public TTags()
TTags
public TTags(TaggerConfig config)
TTags
public TTags(String language)
getOpenTags
public HashSet<String> getOpenTags()
- Returns a list of all open class tags
- Returns:
add
public int add(String tag)
getTag
public String getTag(int i)
save
public void save(String filename)
save
public void save(OutDataStreamFile file)
read
public void read(String filename)
read
public void read(InDataStreamFile file)
isClosed
public boolean isClosed(String tag)
markClosed
public void markClosed(String tag)
setLearnClosedTags
public void setLearnClosedTags(boolean learn)
setOpenClassTags
public void setOpenClassTags(String[] openClassTags)
setClosedClassTags
public void setClosedClassTags(String[] closedClassTags)
getIndex
public int getIndex(String tag)
getSize
public int getSize()
deterministicallyExpandTags
public String[] deterministicallyExpandTags(String[] tags,
String word)
- Deterministically adds other possible tags for words given observed tags.
For instance, for English with the Penn POS tag, a word with the VB
tag would also be expected to have the VBP tag.
(CDM May 2007: This was putting repeated values into the set of possible
tags, which was bad. Now it doesn't, but the resulting code is a funny
mixture of trying to micro-optimize, and just using equals() inside a
List linear scan....
- Parameters:
tags
- Known possible tags for the wordword
- The word (currently not a used parameter)
- Returns:
- A superset of tags
Stanford NLP Group