[ci skip] Update Levenshtein code with better attribution.

Lacks some proper creds to the homies who went the... distance ;)
This commit is contained in:
Kasper Timm Hansen 2016-09-12 21:46:44 +02:00
parent dc75104948
commit 2b5ed618ed
2 changed files with 6 additions and 2 deletions

@ -1,6 +1,8 @@
module RailsGuides
module Levenshtein
# This code is based directly on the Text gem implementation
# This code is based directly on the Text gem implementation.
# Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher.
#
# Returns a value representing the "cost" of transforming str1 into str2
def self.distance(str1, str2)
s = str1

@ -277,7 +277,9 @@ def self.sorted_groups
protected
# This code is based directly on the Text gem implementation
# This code is based directly on the Text gem implementation.
# Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher.
#
# Returns a value representing the "cost" of transforming str1 into str2
def self.levenshtein_distance(str1, str2)
s = str1