class Amatch::Jaro
This class computes the Jaro
metric for two strings. The Jaro
metric computes the similarity between 0 (no match) and 1 (exact match) by looking for matching and transposed characters.
Public Class Methods
Creates a new Amatch::Jaro
instance from pattern
.
static VALUE rb_Jaro_initialize(VALUE self, VALUE pattern) { GET_STRUCT(Jaro) Jaro_pattern_set(amatch, pattern); amatch->ignore_case = 1; return self; }
Public Instance Methods
Returns whether case is ignored when computing matching characters.
Sets whether case is ignored when computing matching characters.
Uses this Amatch::Jaro
instance to match Jaro#pattern
against strings
, that is compute the jaro metric with the strings. strings
has to be either a String
or an Array of Strings. The returned results
is either a Float or an Array of Floats respectively.
static VALUE rb_Jaro_match(VALUE self, VALUE strings) { GET_STRUCT(Jaro) return Jaro_iterate_strings(amatch, strings, Jaro_match); }
Returns the current pattern string of this Amatch::Sellers
instance.
Sets the current pattern string of this Amatch::Sellers
instance to pattern
.
Uses this Amatch::Jaro
instance to match Jaro#pattern
against strings
, that is compute the jaro metric with the strings. strings
has to be either a String
or an Array of Strings. The returned results
is either a Float or an Array of Floats respectively.