Class: Amatch::JaroWinkler

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeObject

Instance Method Details

#ignore_caseObject

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.

#matchObject Also known as: similar

#patternObject

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_factorObject

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.