Class: Gamefic::Scanner::Fuzzy
- Defined in:
- lib/gamefic/scanner/fuzzy.rb
Overview
Fuzzy token matching.
An entity will match a word in a fuzzy scan if it matches the beginning of one of the entity’s keywords, e.g., ‘pen` is a fuzzy token match for the keyword `pencil`.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Strict
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gamefic::Scanner::Base
Instance Method Details
#match_word(available, word) ⇒ Object
12 13 14 |
# File 'lib/gamefic/scanner/fuzzy.rb', line 12 def match_word available, word available.select { |obj| obj.keywords.any? { |wrd| wrd.start_with?(word) } } end |