Sha256: 2ef436583538b0b1de880fccb8a9d7ed2c33c0a088e15b6f41dd1341f57f523b
Contents?: true
Size: 922 Bytes
Versions: 4
Compression:
Stored size: 922 Bytes
Contents
# frozen_string_literal: true require_relative '../phonetics' require_relative 'c_levenshtein' # Using the Damerau version of the Levenshtein algorithm, with phonetic feature # count used instead of a binary edit distance calculation # # This implementation was dually inspired by the damerau-levenshtein gem # (https://github.com/GlobalNamesArchitecture/damerau-levenshtein/tree/master/ext/damerau_levenshtein). # and "Using Phonologically Weighted Levenshtein Distances for the Prediction # of Microscopic Intelligibility" by Lionel Fontan, Isabelle Ferrané, Jérôme # Farinas, Julien Pinquier, Xavier Aumont, 2016 # https://hal.archives-ouvertes.fr/hal-01474904/document module Phonetics module Levenshtein extend ::PhoneticsLevenshteinCBinding def self.distance(str1, str2, verbose = false) return if str1.nil? || str2.nil? internal_phonetic_distance(str1, str2, verbose) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
phonetics-3.0.7 | lib/phonetics/levenshtein.rb |
phonetics-3.0.6 | lib/phonetics/levenshtein.rb |
phonetics-3.0.5 | lib/phonetics/levenshtein.rb |
phonetics-3.0.4 | lib/phonetics/levenshtein.rb |