Module: Enumerable
- Defined in:
- lib/fuzzy_tools/core_ext/enumerable.rb
Instance Method Summary collapse
- #fuzzy_find(*args) ⇒ Object
- #fuzzy_find_all(*args) ⇒ Object
- #fuzzy_find_all_with_scores(*args) ⇒ Object
- #fuzzy_index(options = {}) ⇒ Object
Instance Method Details
#fuzzy_find(*args) ⇒ Object
4 5 6 7 |
# File 'lib/fuzzy_tools/core_ext/enumerable.rb', line 4 def fuzzy_find(*args) query, = parse_fuzzy_finder_arguments(args) fuzzy_index().find(query) end |
#fuzzy_find_all(*args) ⇒ Object
9 10 11 12 |
# File 'lib/fuzzy_tools/core_ext/enumerable.rb', line 9 def fuzzy_find_all(*args) query, = parse_fuzzy_finder_arguments(args) fuzzy_index().all(query) end |
#fuzzy_find_all_with_scores(*args) ⇒ Object
14 15 16 17 |
# File 'lib/fuzzy_tools/core_ext/enumerable.rb', line 14 def fuzzy_find_all_with_scores(*args) query, = parse_fuzzy_finder_arguments(args) fuzzy_index().all_with_scores(query) end |
#fuzzy_index(options = {}) ⇒ Object
19 20 21 22 |
# File 'lib/fuzzy_tools/core_ext/enumerable.rb', line 19 def fuzzy_index( = {}) = .merge(:source => self) FuzzyTools::TfIdfIndex.new() end |