Liking cljdoc? Tell your friends :D

symspell-clj.core

SymSpell Spell checker

SymSpell Spell checker
raw docstring

ISpellCheckercljprotocol

add-wordclj

(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.

lookupclj

(lookup this input)
(lookup this input opts)

Return suggested terms for a single word input. 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
Return suggested terms for a single word input. 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-compoundclj

(lookup-compound this input)
(lookup-compound this input opts)

Return suggestions for multi-word input. Option may keys 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
Return suggestions for multi-word input. Option may keys 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?clj

(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
source

new-spellcheckerclj

(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 its frequency with a space in between. The default file is a built-in English dictionary. Bigram file is similar, but with two words instead. This 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 its frequency with a
space in between. The default file is a built-in English dictionary.
Bigram file is similar, but with two words instead. This 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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close