=20
Sigh, maybe it's just my lame quiz writing skills...
=20
Later,
--
Bil
http://fun3d.larc.nasa.gov
=20
Note: posted via newsgroup.
=20
=20
I really want to do this quiz as it looks quite interesting, but I'm
totally swamped with work. I won't have time to do it until next
weekend. But at least some thoughts here:
I would like to write a fdiff i.e. fuzzy-diff. That would behave as follows=
:
1. Specify fuzzycompare fields with regular expressions.
2. When comparing a row first extract the fuzzyfields from the row,
compare both rows and call a user-specified compare function on the
fuzzyfields.
That would allow for a more general compare approach. I.e.
number-diff:
fuzzyfields =3D /number-regexp/
compare =3D proc do | n1, n2| (n1.to_f - n2.to_f).abs < EPSILON end
space-diff:
fuzzyfields =3D /\s+/
compare =3D proc do true end
dist-diff
fuzzyfields =3D /\A.*\Z/
compare =3D proc do | s1, s2 | edit_distance(s1, s2) < 2 end
etc...
regards,
Brian
--=20
http://ruby.brian-schroeder.de/
Stringed instrument chords:
http://chordlist.brian-schroeder.de/