public class ExtendedSearchSpellingStandardizer extends ExtendedSimpleSpellingStandardizer implements SpellingStandardizer
ExtendedSearchSpellingStandardizer uses spelling correction methods to try to find a good list of suggested standardized spellings.
| Modifier and Type | Field and Description |
|---|---|
protected DoubleMetaphone |
doubleMetaphone
Double metaphone encoder.
|
protected SpellingChecker |
spellingChecker
Spelling checker.
|
gapFilleralternateSpellingsWordClasses, defaultSpellingsByWordClassFileName, lexicon, logger, mappedSpellings, spellingsByWordClass, standardSpellingSet| Constructor and Description |
|---|
ExtendedSearchSpellingStandardizer()
Create extended search spelling standardizer.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
applyHeuristics(java.lang.String spelling)
Apply heuristics to spellings to see if we can find a match..
|
void |
createDictionaries()
Creates dictionaries from spelling lists.
|
java.lang.String |
getBestSuggestedSpelling(java.lang.String spelling)
Get best suggested spelling.
|
java.util.List<ScoredString> |
getScoredSuggestedSpellings(java.lang.String spelling)
Return suggested spellings.
|
java.lang.String[] |
getSuggestedSpellings(java.lang.String spelling)
Return suggested spellings.
|
void |
loadAlternativeSpellings(java.io.Reader reader,
java.lang.String delimChars)
Loads alternative spellings from a reader.
|
void |
loadStandardSpellings(java.io.Reader reader)
Loads standard spellings from a reader.
|
java.lang.String |
longSVariant(java.lang.String spelling)
Apply "long s" heuristics to a spelling.
|
java.lang.String |
preprocessSpelling(java.lang.String spelling)
Preprocess spelling.
|
java.lang.String |
simpleReplacement(java.lang.String spelling,
java.lang.String pattern,
java.lang.String replacement)
Apply simple string replacement.
|
java.lang.String[] |
standardizeSpelling(java.lang.String spelling)
Returns standard spellings given a spelling.
|
java.lang.String |
toString()
Return standardizer description.
|
doStandardizeSpelling, fixGaps, getGapFiller, setGapFilleraddCachedSpelling, addMappedSpelling, addStandardSpelling, addStandardSpellings, fixCapitalization, getLexicon, getLogger, getMappedSpellings, getNumberOfAlternateSpellings, getNumberOfAlternateSpellingsByWordClass, getNumberOfStandardSpellings, getStandardSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, setLexicon, setLogger, setMappedSpellings, setStandardSpellings, standardizeSpellingcloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddMappedSpelling, addStandardSpelling, addStandardSpellings, fixCapitalization, getMappedSpellings, getNumberOfAlternateSpellings, getNumberOfAlternateSpellingsByWordClass, getNumberOfStandardSpellings, getStandardSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, setMappedSpellings, setStandardSpellings, standardizeSpellingprotected SpellingChecker spellingChecker
protected DoubleMetaphone doubleMetaphone
public ExtendedSearchSpellingStandardizer()
public void createDictionaries()
public void loadAlternativeSpellings(java.io.Reader reader,
java.lang.String delimChars)
throws java.io.IOException
loadAlternativeSpellings in interface SpellingStandardizerloadAlternativeSpellings in class AbstractSpellingStandardizerreader - The reader.delimChars - Delimiter characters separating spelling pairs.java.io.IOExceptionpublic void loadStandardSpellings(java.io.Reader reader)
throws java.io.IOException
loadStandardSpellings in interface SpellingStandardizerloadStandardSpellings in class AbstractSpellingStandardizerreader - The reader.java.io.IOExceptionpublic java.lang.String[] applyHeuristics(java.lang.String spelling)
spelling - Spelling to which to apply heuristics.public java.lang.String simpleReplacement(java.lang.String spelling,
java.lang.String pattern,
java.lang.String replacement)
spelling - The spelling.pattern - String of characters to look for in spelling.replacement - Replacement characters.public java.lang.String longSVariant(java.lang.String spelling)
spelling - Spelling suggestion to which to apply heuristics.public java.lang.String preprocessSpelling(java.lang.String spelling)
preprocessSpelling in interface SpellingStandardizerpreprocessSpelling in class ExtendedSimpleSpellingStandardizerspelling - Spelling to preprocess.public java.lang.String[] standardizeSpelling(java.lang.String spelling)
standardizeSpelling in interface SpellingStandardizerstandardizeSpelling in class ExtendedSimpleSpellingStandardizerspelling - The spelling.public java.lang.String getBestSuggestedSpelling(java.lang.String spelling)
spelling - The spelling for which to return suggestion.public java.util.List<ScoredString> getScoredSuggestedSpellings(java.lang.String spelling)
spelling - The spelling for which to return suggestions.public java.lang.String[] getSuggestedSpellings(java.lang.String spelling)
spelling - The spelling for which to return suggestions.public java.lang.String toString()
toString in class ExtendedSimpleSpellingStandardizer