Sha256: 51e92cc9fdaa22c5878e4933fade80bf5578e63fbdf5a5bdb51e47c3200b98d6
Contents?: true
Size: 562 Bytes
Versions: 11
Compression:
Stored size: 562 Bytes
Contents
module BELParser # Adds a levenshtein implementation based on which ruby engine is used. module Levenshtein unless self.methods.include?(:distance) if RUBY_ENGINE =~ /^jruby/i require 'levenshtein' define_singleton_method(:distance) do |string1, string2| ::Levenshtein.distance(string1, string2) end else require "damerau-levenshtein" define_singleton_method(:distance) do |string1, string2| ::DamerauLevenshtein.distance(string1, string2) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems