edu.stanford.nlp.international.process
Interface Mapper

All Known Implementing Classes:
DefaultLexicalMapper, DefaultMapper, LDCPosMapper

public interface Mapper

Generic interface for mapping one string to another given some contextual evidence.

Author:
Spence Green

Method Summary
 boolean canChangeEncoding(String parent, String child)
          Indicates whether child can be converted to another encoding.
 String map(String parent, String element)
          Maps from one string representation to another.
 void setup(File path, String... options)
          Perform initialization prior to the first call to map.
 

Method Detail

setup

void setup(File path,
           String... options)
Perform initialization prior to the first call to map.

Parameters:
path - A filename for data on disk used during mapping
options - Variable length array for setting options

map

String map(String parent,
           String element)
Maps from one string representation to another.

Parameters:
parent - element's context (e.g., the parent node in a parse tree)
element - The string to be transformed.
Returns:
The transformed string

canChangeEncoding

boolean canChangeEncoding(String parent,
                          String child)
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.

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


Stanford NLP Group