Module: DamerauLevenshtein

Extended by:
DamerauLevenshteinBinding
Defined in:
lib/damerau-levenshtein.rb,
lib/damerau-levenshtein/differ.rb,
lib/damerau-levenshtein/version.rb,
lib/damerau-levenshtein/formatter.rb

Overview

Damerau Levenshtein algorithm

Defined Under Namespace

Modules: FormatterRaw, FormatterTag Classes: Differ, Formatter

Constant Summary collapse

VERSION =
"1.3.3"

Class Method Summary collapse

Class Method Details

.array_distance(array1, array2, block_size = 1, max_distance = 10) ⇒ Object



27
28
29
# File 'lib/damerau-levenshtein.rb', line 27

def self.array_distance(array1, array2, block_size = 1, max_distance = 10)
  internal_distance(array1, array2, block_size, max_distance)
end

.distance(str1, str2, block_size = 1, max_distance = 10) ⇒ Object



16
17
18
19
20
21
# File 'lib/damerau-levenshtein.rb', line 16

def self.distance(str1, str2, block_size = 1, max_distance = 10)
  internal_distance(
    str1.unpack("U*"), str2.unpack("U*"),
    block_size, max_distance
  )
end

.distance_utf(*args) ⇒ Object

keep backward compatibility - internal_distance was called distance_utf before



33
34
35
# File 'lib/damerau-levenshtein.rb', line 33

def self.distance_utf(*args)
  internal_distance(*args)
end

.string_distance(*args) ⇒ Object



23
24
25
# File 'lib/damerau-levenshtein.rb', line 23

def self.string_distance(*args)
  distance(*args)
end

.versionObject



12
13
14
# File 'lib/damerau-levenshtein.rb', line 12

def self.version
  VERSION
end