edu.stanford.nlp.tagger.maxent
Class TTags

java.lang.Object
  extended by 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

Field Summary
static int CLOSED_TAG_THRESHOLD
           
 Index<String> index
           
 
Constructor Summary
TTags()
           
TTags(String language)
           
TTags(TaggerConfig config)
           
 
Method Summary
 int add(String tag)
           
 String[] deterministicallyExpandTags(String[] tags, String word)
          Deterministically adds other possible tags for words given observed tags.
 int getIndex(String tag)
           
 HashSet<String> getOpenTags()
          Returns a list of all open class tags
 int getSize()
           
 String getTag(int i)
           
 boolean isClosed(String tag)
           
 void markClosed(String tag)
           
 void read(InDataStreamFile file)
           
 void read(String filename)
           
 void save(OutDataStreamFile file)
           
 void save(String filename)
           
 void setClosedClassTags(String[] closedClassTags)
           
 void setLearnClosedTags(boolean learn)
           
 void setOpenClassTags(String[] openClassTags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

public Index<String> index

CLOSED_TAG_THRESHOLD

public static int CLOSED_TAG_THRESHOLD
Constructor Detail

TTags

public TTags()

TTags

public TTags(TaggerConfig config)

TTags

public TTags(String language)
Method Detail

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 word
word - The word (currently not a used parameter)
Returns:
A superset of tags


Stanford NLP Group