Class: SpellCheck::Filter
- Inherits:
-
Object
- Object
- SpellCheck::Filter
- Defined in:
- lib/spellcheck/filter.rb
Constant Summary collapse
- TYPO_PATTERN_LIST =
{}
Class Method Summary collapse
-
.spellcheck(word) ⇒ Hash
Check result.
Class Method Details
.spellcheck(word) ⇒ Hash
Returns check result.
11 12 13 14 15 16 17 18 19 |
# 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 |