Class: WordFinder::Checker
- Inherits:
-
FFI::Aspell::Speller
- Object
- FFI::Aspell::Speller
- WordFinder::Checker
- Defined in:
- lib/word_finder/checker.rb
Overview
Caching subclass of Aspell.
Instance Method Summary collapse
-
#initialize ⇒ Checker
constructor
A new instance of Checker.
- #word?(str) ⇒ Boolean
Constructor Details
#initialize ⇒ Checker
Returns a new instance of Checker.
14 15 16 17 |
# File 'lib/word_finder/checker.rb', line 14 def initialize(*) super @cache = {} end |
Instance Method Details
#word?(str) ⇒ Boolean
19 20 21 22 |
# File 'lib/word_finder/checker.rb', line 19 def word?(str) @cache[str] = correct?(str) unless @cache.key?(str) @cache[str] end |