Module: StrMetrics::Levenshtein

Defined in:
lib/str_metrics.rb

Overview

Namespace for Levenshtein

Class Method Summary collapse

Class Method Details

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



42
43
44
# File 'lib/str_metrics.rb', line 42

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