Skip to content

Instantly share code, notes, and snippets.

View asdrubalivan's full-sized avatar

Asdrúbal Iván Suárez Rivera asdrubalivan

View GitHub Profile
@asdrubalivan
asdrubalivan / levenshtein.coffee
Created June 7, 2014 16:38
Levenshtein distance algorithm in CoffeeScript
###
# @desc: Recursive Implementation of Levenshtein distance algorithm
# according to Wikipedia's pseudocode implementation of it
# @author: Asdrúbal Suárez (Twitter @asdrubalivan)
###
levenshteinInternal = (s, len_s, t, len_t) ->
if len_s is 0
return len_t
if len_t is 0
return len_s