edu.stanford.nlp.international.arabic.pipeline
Class LDCPosMapper
java.lang.Object
edu.stanford.nlp.international.arabic.pipeline.LDCPosMapper
- All Implemented Interfaces:
- Mapper
public class LDCPosMapper
- extends Object
- implements Mapper
Maps pre-terminal ATB morphological analyses to the shortened Bies tag set.
- Author:
- Spence Green
startOfTagMap
protected Pattern startOfTagMap
endOfTagMap
protected Pattern endOfTagMap
comment
protected Pattern comment
mapping
protected Pattern mapping
numExpectedTokens
protected int numExpectedTokens
tagMap
protected final StringMap tagMap
tagsToEscape
protected final Set<String> tagsToEscape
LDCPosMapper
public LDCPosMapper()
LDCPosMapper
public LDCPosMapper(boolean addDeterminer)
map
public String map(String parent,
String element)
- Description copied from interface:
Mapper
- Maps from one string representation to another.
- Specified by:
map
in interface Mapper
- Parameters:
parent
- The preterminal tagelement
- The optional terminal, which may be used for context
- Returns:
- The transformed string
setup
public void setup(File path,
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 mappingoptions
- Variable length array for setting options
canChangeEncoding
public boolean canChangeEncoding(String parent,
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 String toString()
- Overrides:
toString
in class Object
main
public static void main(String[] args)
Stanford NLP Group