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.
|
gapFiller
alternateSpellingsWordClasses, 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, setGapFiller
addCachedSpelling, addMappedSpelling, addStandardSpelling, addStandardSpellings, fixCapitalization, getLexicon, getLogger, getMappedSpellings, getNumberOfAlternateSpellings, getNumberOfAlternateSpellingsByWordClass, getNumberOfStandardSpellings, getStandardSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, setLexicon, setLogger, setMappedSpellings, setStandardSpellings, standardizeSpelling
close
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addMappedSpelling, addStandardSpelling, addStandardSpellings, fixCapitalization, getMappedSpellings, getNumberOfAlternateSpellings, getNumberOfAlternateSpellingsByWordClass, getNumberOfStandardSpellings, getStandardSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, setMappedSpellings, setStandardSpellings, standardizeSpelling
protected 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 SpellingStandardizer
loadAlternativeSpellings
in class AbstractSpellingStandardizer
reader
- The reader.delimChars
- Delimiter characters separating spelling pairs.java.io.IOException
public void loadStandardSpellings(java.io.Reader reader) throws java.io.IOException
loadStandardSpellings
in interface SpellingStandardizer
loadStandardSpellings
in class AbstractSpellingStandardizer
reader
- The reader.java.io.IOException
public 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 SpellingStandardizer
preprocessSpelling
in class ExtendedSimpleSpellingStandardizer
spelling
- Spelling to preprocess.public java.lang.String[] standardizeSpelling(java.lang.String spelling)
standardizeSpelling
in interface SpellingStandardizer
standardizeSpelling
in class ExtendedSimpleSpellingStandardizer
spelling
- 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