class EnglishSpellcheck
Public Class Methods
new()
click to toggle source
# File lib/english_spellchecker.rb, line 12 def initialize() @spelling = DidYouMean::SpellChecker.new(dictionary: WordsDotDat.words) end
spell(w)
click to toggle source
# File lib/english_spellchecker.rb, line 16 def self.spell(w) r = DidYouMean::SpellChecker.new(dictionary: WordsDotDat.words).correct(w) r.any? ? r.first : nil end
Public Instance Methods
inspect()
click to toggle source
# File lib/english_spellchecker.rb, line 23 def inspect() "<EnglishSpellcheck::#{self.object_id} @spelling=DidYouMean::SpellChecker>" end
spell(w)
click to toggle source
# File lib/english_spellchecker.rb, line 27 def spell(w) r = @spelling.correct w r.any? ? r.first : nil end
Also aliased as: spelling