diff --git a/Rakefile b/Rakefile index 41ecf2c..bc21302 100644 --- a/Rakefile +++ b/Rakefile @@ -47,7 +47,7 @@ task compare: :compile do table << %w[--- --- --- --- --- ---] jarow = FuzzyStringMatch::JaroWinkler.create(:native) @ary.each do |str_1, str_2| - table << ["\"#{str_1}\"", "\"#{str_2}\"", JaroWinkler.distance(str_1, str_2).round(4), jarow.getDistance(str_1, str_2).round(4), Hotwater.jaro_winkler_distance(str_1, str_2).round(4), Amatch::Jaro.new(str_1).match(str_2).round(4)] + table << ["\"#{str_1}\"", "\"#{str_2}\"", JaroWinkler.similarity(str_1, str_2).round(4), jarow.getDistance(str_1, str_2).round(4), Hotwater.jaro_winkler_distance(str_1, str_2).round(4), Amatch::Jaro.new(str_1).match(str_2).round(4)] end col_len = [] table.first.length.times{ |i| col_len << table.map{ |row| row[i].to_s.length }.max } diff --git a/benchmark/measure.rb b/benchmark/measure.rb index ebec236..193d619 100644 --- a/benchmark/measure.rb +++ b/benchmark/measure.rb @@ -28,8 +28,8 @@ end if version >= Gem::Version.new('1.4.0') - jobs[:ascii] = -> { n.times { SAMPLES[:ascii].each { |str1, str2| JaroWinkler.distance(str1, str2) } } } - jobs[:utf8] = -> { n.times { SAMPLES[:utf8].each { |str1, str2| JaroWinkler.distance(str1, str2) } } } + jobs[:ascii] = -> { n.times { SAMPLES[:ascii].each { |str1, str2| JaroWinkler.similarity(str1, str2) } } } + jobs[:utf8] = -> { n.times { SAMPLES[:utf8].each { |str1, str2| JaroWinkler.similarity(str1, str2) } } } end # rehearsal diff --git a/benchmark/native.rb b/benchmark/native.rb index ddaa5ce..5fc2ea5 100644 --- a/benchmark/native.rb +++ b/benchmark/native.rb @@ -11,7 +11,7 @@ Benchmark.bmbm do |x| x.report "jaro_winkler (#{`git rev-parse --short HEAD`.chop!})" do - n.times { SAMPLES[:ascii].each { |str1, str2| JaroWinkler.distance(str1, str2) } } + n.times { SAMPLES[:ascii].each { |str1, str2| JaroWinkler.similarity(str1, str2) } } end x.report gem_name_with_version('fuzzy-string-match') do diff --git a/benchmark/pure.rb b/benchmark/pure.rb index 91002d5..0916511 100644 --- a/benchmark/pure.rb +++ b/benchmark/pure.rb @@ -9,7 +9,7 @@ Benchmark.bmbm do |x| x.report "jaro_winkler (#{`git rev-parse --short HEAD`.chop!})" do - n.times { SAMPLES[:ascii].each { |str1, str2| JaroWinkler.distance(str1, str2) } } + n.times { SAMPLES[:ascii].each { |str1, str2| JaroWinkler.similarity(str1, str2) } } end x.report gem_name_with_version('fuzzy-string-match') do