edu.stanford.nlp.international.arabic.pipeline
Class LDCPosMapper

java.lang.Object
  extended by edu.stanford.nlp.international.arabic.pipeline.LDCPosMapper
All Implemented Interfaces:
Mapper
Direct Known Subclasses:
UniversalPOSMapper

public class LDCPosMapper
extends java.lang.Object
implements Mapper

Maps pre-terminal ATB morphological analyses to the shortened Bies tag set.

Author:
Spence Green

Field Summary
protected  java.util.regex.Pattern endOfTagMap
           
protected  java.util.regex.Pattern mapping
           
protected  int numExpectedTokens
           
protected  java.util.regex.Pattern startOfTagMap
           
protected  StringMap tagMap
           
protected  java.util.Set<java.lang.String> tagsToEscape
           
 
Constructor Summary
LDCPosMapper()
           
LDCPosMapper(boolean addDeterminer)
           
 
Method Summary
 boolean canChangeEncoding(java.lang.String parent, java.lang.String element)
          Indicates whether child can be converted to another encoding.
static void main(java.lang.String[] args)
           
 java.lang.String map(java.lang.String posTag, java.lang.String terminal)
          Maps from one string representation to another.
 void setup(java.io.File path, java.lang.String... options)
          Perform initialization prior to the first call to map.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startOfTagMap

protected java.util.regex.Pattern startOfTagMap

endOfTagMap

protected java.util.regex.Pattern endOfTagMap

mapping

protected java.util.regex.Pattern mapping

numExpectedTokens

protected int numExpectedTokens

tagMap

protected final StringMap tagMap

tagsToEscape

protected final java.util.Set<java.lang.String> tagsToEscape
Constructor Detail

LDCPosMapper

public LDCPosMapper()

LDCPosMapper

public LDCPosMapper(boolean addDeterminer)
Method Detail

map

public java.lang.String map(java.lang.String posTag,
                            java.lang.String terminal)
Description copied from interface: Mapper
Maps from one string representation to another.

Specified by:
map in interface Mapper
Parameters:
posTag - The preterminal tag
terminal - The optional terminal, which may be used for context
Returns:
The transformed string

setup

public void setup(java.io.File path,
                  java.lang.String... options)
Description copied from interface: Mapper
Perform initialization prior to the first call to map.

Specified by:
setup in interface Mapper
Parameters:
path - A filename for data on disk used during mapping
options - Variable length array of strings for options. Option format may vary for the particular class instance.

canChangeEncoding

public boolean canChangeEncoding(java.lang.String parent,
                                 java.lang.String element)
Description copied from interface: Mapper
Indicates whether child can be converted to another encoding. In the ATB, for example, if a punctuation character is labeled with the "PUNC" POS tag, then that character should not be converted from Buckwalter to UTF-8.

Specified by:
canChangeEncoding in interface Mapper
Parameters:
parent - element's context (e.g., the parent node in a parse tree)
element - The string to be transformed.
Returns:
True if the string encoding can be changed. False otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)


Stanford NLP Group