Package opennlp.spellcheck.symspell
Class SymSpellConfig.Builder
java.lang.Object
opennlp.spellcheck.symspell.SymSpellConfig.Builder
- Enclosing class:
SymSpellConfig
Mutable builder for
SymSpellConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()corpusWordCount(long value) Pins the corpus normalization constant N used by the Naive-Bayes word combine/split scoring inSymSpell.lookupCompound(String, int).countThreshold(long value) editDistance(EditDistance value) maxDictionaryEditDistance(int value) prefixLength(int value)
-
Method Details
-
maxDictionaryEditDistance
- Parameters:
value- largest precomputed dictionary edit distance; must be>= 0- Returns:
- this builder
- Throws:
IllegalArgumentException- ifvalueis negative
-
prefixLength
- Parameters:
value- number of leading symbols used for delete generation; must be>= 1and> maxDictionaryEditDistance- Returns:
- this builder
- Throws:
IllegalArgumentException- ifvalueis< 1(the cross-check againstmaxDictionaryEditDistanceis enforced bybuild())
-
countThreshold
- Parameters:
value- minimum corpus count for a term to be indexed; must be>= 1- Returns:
- this builder
- Throws:
IllegalArgumentException- ifvalueis< 1
-
editDistance
- Parameters:
value- verification metric to inject; must not benull- Returns:
- this builder
-
corpusWordCount
Pins the corpus normalization constant N used by the Naive-Bayes word combine/split scoring inSymSpell.lookupCompound(String, int).- Parameters:
value- the corpus word count to pin, orSymSpellConfig.DERIVE_CORPUS_WORD_COUNTto derive N from the loaded dictionary's summed counts; must be>= 0- Returns:
- this builder
- Throws:
IllegalArgumentException- ifvalueis negative
-
build
- Returns:
- the immutable configuration
- Throws:
IllegalArgumentException- ifprefixLengthis not strictly greater thanmaxDictionaryEditDistance
-