Created
February 8, 2012 14:37
-
-
Save jlecour/1770127 to your computer and use it in GitHub Desktop.
Stress test for Amatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faker' | |
require 'amatch' | |
include Amatch | |
puts "Start" | |
str_ref = Faker::Address.city | |
1_000_000.times do |i| | |
str_comp = Faker::Address.city | |
str_ref.pair_distance_similar(str_comp) | |
str_ref.jarowinkler_similar(str_comp) | |
str_ref.levenshtein_similar(str_comp) | |
str_ref.longest_subsequence_similar(str_comp) | |
str_ref.longest_substring_similar(str_comp) | |
if i % 1_000 == 0 | |
print '.' | |
STDOUT.flush | |
end | |
end | |
puts "" | |
puts "Done !" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment