class SpellCheck::Filter

Constants

TYPO_PATTERN_LIST

Public Class Methods

spellcheck(word) click to toggle source

@param [String] string to be checked. @return [Hash] check result.

# File lib/spellcheck/filter.rb, line 11
def self.spellcheck(word)
  expected = TYPO_PATTERN_LIST[word.downcase]

  if expected
    { correct: false, pattern: word, expected: expected }
  else
    { correct: true, pattern: word, expected: '' }
  end
end