SymSpell Spell checker
SymSpell Spell checker
(add-word this word)
Add a word to the spell checker at run time. It is responsibility of user
to persist the added words, pass them to :custom-dictionary
when the
spellchcker is initialized next time.
Add a word to the spell checker at run time. It is responsibility of user to persist the added words, pass them to `:custom-dictionary` when the spellchcker is initialized next time.
(get-suggestion this input)
Return a single spell-checked input. This is a user level function that tries to do the sensible things, such as preserving the cases, dealing with punctuation and numbers.
Return a single spell-checked input. This is a user level function that tries to do the sensible things, such as preserving the cases, dealing with punctuation and numbers.
(lookup this input)
(lookup this input opts)
Return suggested terms for a single word input, along with the edit distance for each. Possible option map keys are:
:verbosity
, a keyword value, with possible values:
:all
, return all possible suggestions:closest
, return the closest (w/ minimal edit distance) suggestions:top
, return the top suggestion:threshold
, edit distance threshold, default is 2. This must be no larger
than max-edit-distance
of the spell checker:include-unknown?
, whether to include unknown word in suggestionReturn suggested terms for a single word input, along with the edit distance for each. Possible option map keys are: * `:verbosity`, a keyword value, with possible values: - `:all`, return all possible suggestions - `:closest`, return the closest (w/ minimal edit distance) suggestions - `:top`, return the top suggestion * `:threshold`, edit distance threshold, default is 2. This must be no larger than `max-edit-distance` of the spell checker * `:include-unknown?`, whether to include unknown word in suggestion
(lookup-compound this input)
(lookup-compound this input opts)
Return suggestions for multi-word input, along with the edit distance for each. Option map keys may include:
:threshold
, edit distance threshold per word, default is 2. This must be
no larger than max-edit-distance
of the spell checker:include-unknown?
, whether to include unknown word in suggestionReturn suggestions for multi-word input, along with the edit distance for each. Option map keys may include: * `:threshold`, edit distance threshold per word, default is 2. This must be no larger than `max-edit-distance` of the spell checker * `:include-unknown?`, whether to include unknown word in suggestion
(match-prefix? this input)
Return true if the input matches a prefix in the dictionary
Return true if the input matches a prefix in the dictionary
(new-spellchecker)
(new-spellchecker unigram-file)
(new-spellchecker unigram-file bigram-file)
(new-spellchecker
unigram-file
bigram-file
{:keys [max-edit-distance prefix-length custom-dictionary]
:or {max-edit-distance 2 prefix-length 10 custom-dictionary []}})
Create a spell checker. Unigram file is relative to the classpath. The file should be plain text, UTF-8 encoded without BOM. Each line contains a word and an optional frequency with a space in between. The default file is a built-in English dictionary. Bigram file is similar, but with two words instead, Bigram file is optional. Possible option map keys are
:max-edit-distance
is the maximum possible edit distance considered by
this spell checker, default 2.:prefix-length
is the length of prefix considered by this spell checker,
default 10.:custom-dictionary
is a vector of additional words for the dictionary.Create a spell checker. Unigram file is relative to the classpath. The file should be plain text, UTF-8 encoded without BOM. Each line contains a word and an optional frequency with a space in between. The default file is a built-in English dictionary. Bigram file is similar, but with two words instead, Bigram file is optional. Possible option map keys are * `:max-edit-distance` is the maximum possible edit distance considered by this spell checker, default 2. * `:prefix-length` is the length of prefix considered by this spell checker, default 10. * `:custom-dictionary` is a vector of additional words for the dictionary.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close