cntr, I think the variable a isn't needed
in String#parse_csv:
class String
def parse_csv
self.scan(
/(?:"((?:(?:\\.)*[^"\\]*)*)"|([^,]*))(?:,|$)/
).flatten.compact
end
end
I'm not that good in programming Perl,
but here is how I'd do it in Ruby:
#!/usr/bin/ruby
arr1 = []
arr2 = []
begin
File.open('alldata.txt') { |f|
f.each_line { |line| arr1 << line.split(/\s+/) }
}
File.open('tworesponses.txt') { |f|
f.each_line { |line| arr2 <<...
I've installed amatch as a RubyGem.
The only documentation I found was the 'amatch.txt.en'
file in the directory of the amatch gem.
This file says that amatch calculates the
Levenstein distance of two strings.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.