Module: DidYou::Spell

Defined in:
lib/did_you.rb

Overview

Defined Under Namespace

Classes: SpellChecker, SpellFinder

Class Method Summary collapse

Class Method Details

.check(error, dictionary) ⇒ Array<String>

Checks mistyped word against provided dictionary.

Parameters:

  • error (String)

    Mistyped word (say, method name).

  • dictionary (Array<String>)

    Dictionary of known words (say, defined methods).

Returns:

  • (Array<String>)

    List of suggested spellings or [] if word is correct or did_you_mean gem is not found.



31
32
33
# File 'lib/did_you.rb', line 31

def check(error, dictionary)
  _check(error, dictionary) - [error]
end