module DidYou::Spell

See {.check}

Constants

SpellChecker
SpellFinder

Public Instance Methods

_check(*) click to toggle source
# File lib/did_you.rb, line 41
def _check(*)
  []
end
check(error, dictionary) click to toggle source

Checks mistyped word against provided dictionary.

@param error [String] Mistyped word (say, method name). @param dictionary [Array<String>] Dictionary of known words

(say, defined methods).

@return [Array<String>] List of suggested spellings or `[]`

if word is correct or did_you_mean gem is not found.
# File lib/did_you.rb, line 31
def check(error, dictionary)
  _check(error, dictionary) - [error]
end