Module: StrMetrics::DamerauLevenshtein

Defined in:
lib/str_metrics.rb

Overview

Namespace for Damerau-Levenshtein

Class Method Summary collapse

Class Method Details

.distance(a, b, ignore_case: false) ⇒ Object



49
50
51
# File 'lib/str_metrics.rb', line 49

def self.distance(a, b, ignore_case: false)
  Native.damerau_levenshtein_distance(a&.to_utf8, b&.to_utf8, ignore_case ? 1 : 0)
end