public abstract class AbstractContractionExpander extends IsCloseableObject implements ContractionExpander, UsesLogger
Modifier and Type | Field and Description |
---|---|
protected TaggedStrings |
contractedSpellings
Contracted spelings.
|
protected Logger |
logger
Logger used for output.
|
Constructor and Description |
---|
AbstractContractionExpander()
Create abstract contraction expander.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
expandContraction(java.lang.String spelling)
Returns an expanded spelling for a contracted spelling.
|
Logger |
getLogger()
Get the logger.
|
protected void |
loadContractedSpellings(java.io.Reader reader)
Load map from contracted to expanded spellings.
|
void |
setLogger(Logger logger)
Set the logger.
|
close
protected TaggedStrings contractedSpellings
Contracted spellings are stored as TaggedStrings. The tag is the contracted form. The value is the uncontracted forn.
protected Logger logger
public AbstractContractionExpander()
protected void loadContractedSpellings(java.io.Reader reader) throws java.io.IOException
reader
- Reader from which to read contractions.java.io.IOException
- When contracted spellings cannot be read.public java.lang.String expandContraction(java.lang.String spelling)
expandContraction
in interface ContractionExpander
spelling
- The spelling.public Logger getLogger()
getLogger
in interface UsesLogger
public void setLogger(Logger logger)
setLogger
in interface UsesLogger
logger
- The logger.