edu.stanford.nlp.trees
Class TagMapper

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byedu.stanford.nlp.trees.TagMapper
All Implemented Interfaces:
Cloneable, Function, Map, Serializable

public class TagMapper
extends HashMap
implements Function

A POS tag to POS tag mapper. Both 1->many and 1->1 mappings are supported. Current implementation doesn't allow for sensitivity to the specific word being mapped. Considerable room exists for refinement.

Author:
Roger Levy
See Also:
Serialized Form

Constructor Summary
TagMapper()
          The 0-argument constructor is a default map for crude BNC->Penn Treebank tagset mapping.
TagMapper(HashMap t)
          The 1-argument constructor allows you to use your own tagmap
 
Method Summary
 Object apply(Object in)
          appy() is based on the 1->1 mapping.
static void main(String[] args)
           
 String[] mapTagOneToMany(String l)
          The one to many map is straightforward, but at time of writing (December 5, 2002) doesn't have any multi-tagged word class to plug into.
 String mapTagOneToOne(String l)
          one to one map is achieved by just taking the first tag from the list of possible tags and making it the new tag.
 
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
 

Constructor Detail

TagMapper

public TagMapper(HashMap t)
The 1-argument constructor allows you to use your own tagmap


TagMapper

public TagMapper()
The 0-argument constructor is a default map for crude BNC->Penn Treebank tagset mapping.

Method Detail

mapTagOneToMany

public String[] mapTagOneToMany(String l)
The one to many map is straightforward, but at time of writing (December 5, 2002) doesn't have any multi-tagged word class to plug into.


mapTagOneToOne

public String mapTagOneToOne(String l)
one to one map is achieved by just taking the first tag from the list of possible tags and making it the new tag. Lots of refinement could be done.


apply

public Object apply(Object in)
appy() is based on the 1->1 mapping.

Specified by:
apply in interface Function

main

public static void main(String[] args)


Stanford NLP Group