public abstract class AbstractNameStandardizer extends IsCloseableObject implements NameStandardizer, UsesLogger
| Modifier and Type | Field and Description |
|---|---|
protected static TernaryTrie |
consonantTrie
Consonant trie.
|
protected Logger |
logger
Logger used for output.
|
protected static TernaryTrie |
nameTrie
Proper name trie.
|
| Constructor and Description |
|---|
AbstractNameStandardizer()
Create abstract name matcher.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
dontStandardize(java.lang.String properName)
Check if we should not standardize a name.
|
Logger |
getLogger()
Get the logger.
|
int |
getNumberOfNames()
Return number of names.
|
void |
loadNames(java.util.Collection<java.lang.String> properNamesCollection)
Load names from a collection of names.
|
void |
loadNames(java.lang.String lexiconFileName)
Load name data from lexicon file.
|
void |
loadNamesFromLexicon(Lexicon lexicon)
Load names from a lexicon.
|
java.lang.String |
preprocessProperName(java.lang.String properName)
Preprocess proper name.
|
void |
setLogger(Logger logger)
Set the logger.
|
java.lang.String |
standardizeProperName(java.lang.String properName)
Returns standardized proper name given a proper name.
|
closeprotected static TernaryTrie nameTrie
protected static TernaryTrie consonantTrie
protected Logger logger
public AbstractNameStandardizer()
public void loadNames(java.lang.String lexiconFileName)
throws java.io.IOException
loadNames in interface NameStandardizerlexiconFileName - Lexicon containing name data.java.io.IOExceptionpublic void loadNamesFromLexicon(Lexicon lexicon) throws java.io.IOException
loadNamesFromLexicon in interface NameStandardizerlexicon - The lexicon from which to load names.java.io.IOExceptionpublic void loadNames(java.util.Collection<java.lang.String> properNamesCollection)
loadNames in interface NameStandardizerproperNamesCollection - Collection containing proper names.public int getNumberOfNames()
getNumberOfNames in interface NameStandardizerpublic boolean dontStandardize(java.lang.String properName)
dontStandardize in interface NameStandardizerproperName - Name to check.Names that contain periods are not standardized by default.
public java.lang.String standardizeProperName(java.lang.String properName)
standardizeProperName in interface NameStandardizerproperName - The proper name.public java.lang.String preprocessProperName(java.lang.String properName)
preprocessProperName in interface NameStandardizerproperName - Proper name to preprocess.By default, no preprocessing is applied; the original proper name is returned unchanged.
public Logger getLogger()
getLogger in interface UsesLoggerpublic void setLogger(Logger logger)
setLogger in interface UsesLoggerlogger - The logger.