Class: FuzzyWuzzy
- Inherits:
-
Object
- Object
- FuzzyWuzzy
- Defined in:
- lib/match-mate/utils/fuzzy_wuzzy.rb
Instance Method Summary collapse
-
#initialize(value, other_value) ⇒ FuzzyWuzzy
constructor
A new instance of FuzzyWuzzy.
-
#partial_ratio ⇒ Object
Compares partial string similarity.
-
#ratio ⇒ Object
Compares the entire string similarity, in order.
-
#token_set_ratio ⇒ Object
Compares the entire string similarity, ignores word order and duplicated words.
-
#token_sort_ratio ⇒ Object
Compares the entire string similarity, ignores word order.
Constructor Details
#initialize(value, other_value) ⇒ FuzzyWuzzy
Returns a new instance of FuzzyWuzzy.
4 5 6 7 8 |
# File 'lib/match-mate/utils/fuzzy_wuzzy.rb', line 4 def initialize(value, other_value) @values = [value].flatten.map(&:to_s) @other_values = [other_value].flatten.map(&:to_s) PyCall.exec import end |
Instance Method Details
#partial_ratio ⇒ Object
Compares partial string similarity
21 22 23 |
# File 'lib/match-mate/utils/fuzzy_wuzzy.rb', line 21 def partial_ratio run_command :partial_ratio end |
#ratio ⇒ Object
Compares the entire string similarity, in order.
26 27 28 |
# File 'lib/match-mate/utils/fuzzy_wuzzy.rb', line 26 def ratio run_command :ratio end |
#token_set_ratio ⇒ Object
Compares the entire string similarity, ignores word order and duplicated words
11 12 13 |
# File 'lib/match-mate/utils/fuzzy_wuzzy.rb', line 11 def token_set_ratio run_command :token_set_ratio end |
#token_sort_ratio ⇒ Object
Compares the entire string similarity, ignores word order
16 17 18 |
# File 'lib/match-mate/utils/fuzzy_wuzzy.rb', line 16 def token_sort_ratio run_command :token_sort_ratio end |