Class: Amatch::JaroWinkler
- Inherits:
-
Object
- Object
- Amatch::JaroWinkler
- Defined in:
- ext/amatch_ext.c,
ext/amatch_ext.c
Overview
This class computes the Jaro-Winkler metric for two strings. The Jaro-Winkler metric computes the similarity between 0 (no match) and 1 (exact match) by looking for matching and transposed characters.
It is a variant of the Jaro metric, with additional weighting towards common prefixes.
Instance Method Summary collapse
-
#ignore_case ⇒ Object
call-seq: ignore_case -> true/false.
-
#ignore_case= ⇒ Object
call-seq: ignore_case=(true/false).
- #initialize ⇒ Object constructor
- #match ⇒ Object (also: #similar)
-
#pattern ⇒ Object
call-seq: pattern -> pattern string.
-
#pattern= ⇒ Object
call-seq: pattern=(pattern).
-
#scaling_factor ⇒ Object
call-seq: scaling_factor -> weight.
-
#scaling_factor= ⇒ Object
call-seq: scaling_factor=(weight).
Constructor Details
#initialize ⇒ Object
Instance Method Details
#ignore_case ⇒ Object
call-seq: ignore_case -> true/false
Returns whether case is ignored when computing matching characters.
#ignore_case= ⇒ Object
call-seq: ignore_case=(true/false)
Sets whether case is ignored when computing matching characters.
#match ⇒ Object Also known as: similar
#pattern ⇒ Object
call-seq: pattern -> pattern string
Returns the current pattern string of this instance.
#pattern= ⇒ Object
call-seq: pattern=(pattern)
Sets the current pattern string of this instance to pattern
.
#scaling_factor ⇒ Object
call-seq: scaling_factor -> weight
The scaling factor is how much weight to give common prefixes. Default is 0.1.
#scaling_factor= ⇒ Object
call-seq: scaling_factor=(weight)
Sets the weight to give common prefixes.