On 13/09/05, Bil Kleb <Bil.Kleb / nasa.gov> wrote:
> James Edward Gray II wrote:
> > On Sep 12, 2005, at 1:35 PM, Jim Freeze wrote:
> >
> >> Uhm, where are the solutions?
> >>
> >> I usually see solutions posted on Sunday.
> >> Here it is Mon afternoon, and I have not seen
> >> any quiz traffic. Is my email playing tricks on me?
> >
> > Only if my email is broken too.  Haven't had time to fiddle with it
> > myself yet, but it looks like I better find some...  ;)
> 
> Sigh, maybe it's just my lame quiz writing skills...
> 
> Later,
> --
> Bil
> http://fun3d.larc.nasa.gov
> 
> Note: posted via newsgroup.
> 
> 

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 = /number-regexp/
compare = proc do | n1, n2| (n1.to_f - n2.to_f).abs < EPSILON end

space-diff:

fuzzyfields = /\s+/
compare = proc do true end

dist-diff

fuzzyfields = /\A.*\Z/
compare = proc do | s1, s2 | edit_distance(s1, s2) < 2 end

etc...

regards,

Brian

-- 
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/