--1394090772-989359847-1071506166963
Content-Type: MULTIPART/MIXED; BOUNDARY="1394090772-989359847-1071506166=:3963"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime / docserver.cac.washington.edu for more info.

--1394090772-989359847-1071506166963
Content-Type: TEXT/PLAIN; charset=US-ASCII


I've probably spent about 2 hours trying it out.  There's a flag in it for
how close a match is required (you can make something line "asdeflk" match
String#detect if you set it low enough), and it seems to work reasonable
well if that value is set to something high (in the range 0 - 1.0), like
0.5 - 0.75.

I've attached the source.  FuzzyMatch.rb is from rubyforge.org (in the
code snippets) section, slightly modified.

On Mon, 15 Dec 2003, T. Onoma wrote:

> On Monday 15 December 2003 01:31 am, Derek Lewis wrote:
> > This sounds like some "fun" code I was writing the other day, just for the
> > heck of it.  I wrote a module I called CloseCall, and it defined
> > method_missing.  It searches all the methods on the object with the same
> > (or compatible) arity, and uses the String#fuzzy_match method from the
> > code snippets on rubyforge to find a method with a similar name.  When it
> > finds one similar enough, it uses class_eval to define the method, so
> > method_missing doesn't get called the next time.
> >
> > I can post the code if there's any interest, but it's not terribly pretty,
> > as it was more of an experiment than anything. :)
>
> I would certainly enjoy seeing it. How much have you tried it out?
>
> T.
>
>

Derek Lewis

Java Web-Application Developer

      Email    : email / lewisd.com
      Cellular : 604.312.2846
      Website  : http://www.lewisd.com

 "If you've got a 5000-line JSP page that has "all in one" support
 for three input forms and four follow-up screens, all controlled
 by "if" statements in scriptlets, well ... please don't show it
 to me :-).  Its almost dinner time, and I don't want to lose my
 appetite :-)."
      - Craig R. McClanahan

--1394090772-989359847-1071506166963
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="CloseCall.rb"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0312150836060.3963 / stack.f00f.net>
Content-Description: 
Content-Disposition: attachment; filename="CloseCall.rb"

DQpyZXF1aXJlICdGdXp6eU1hdGNoJw0KDQptb2R1bGUgQ2xvc2VDYWxsDQoN
C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QoJ2EnLCAnYicpDQoNCnB1dHMg
dGVzdC5zb21lbWV0aG9kKCdhJykNCg0KcHV0cyB0ZXN0LnNvbWVtZXRob2Qy
KCdiJykNCg0KcHV0cyB0ZXN0LnNvbWVtZXRob2QoJ2EnLCAnYicsICdjJykN
Cg0K
--1394090772-989359847-1071506166963
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="FuzzyMatch.rb"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0312150836061.3963 / stack.f00f.net>
Content-Description: 
Content-Disposition: attachment; filename="FuzzyMatch.rb"

Y2xhc3MgU3RyaW5nDQ0KICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09DQ0KICAgICMgKiAqRnVuY3Rpb24qOiBBIGZ1enp5IG1hdGNoaW5nIG1l
Y2hhbmlzbSAoc3RpbGwgYSBiaXQgcm91Z2gpICAgICAgICAgICAjDQ0KICAg
ICMgQW55IHN1Z2dlc3Rpb25zIGZvciBpbXByb3ZlbWVudCAgYXJlIHdlbGNv
bWUuICAgICAgICAgICAgICAgICAgICAgICAgICAjDQ0KICAgICMgKiAqVXNh
Z2UqICAgOiA8dHQ+ICAiQWxleHNhbmRlciIuZnV6enlfbWF0Y2goICJBbGVr
c2FuZGVyIiApICA8L3R0PiAgICAjDQ0KICAgICMgKiAqQXJncyogICAgOiAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAjDQ0KICAgICMgICAtICtzdHJfaW4rIC0+IFRoZSBzdHJp
bmcgdG8gY29tcGFyZSBhZ2FpbnN0ICAgICAgICAgICAgICAgICAgICAgICAg
ICAjDQ0KICAgICMgKiAqUmV0dXJucyogOiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQ0KICAg
ICMgICAtICtzY29yZSsgLT4gQSBzY29yZSBmcm9tIDAtMSwgYmFzZWQgb24g
dGhlIG51bWJlciBvZiBzaGFyZWQgZWRnZXMgICAjDQ0KICAgICMgKG1hdGNo
ZXMgb2YgYSBzZXF1ZW5jZSBvZiBjaGFyYWN0ZXJzIG9mIGxlbmd0aCAyIG9y
IG1vcmUpICAgICAgICAgICAgICAjDQ0KICAgICMgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAjDQ0KICAgICMgKiAqVGhyb3dzKiA6ICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAjDQ0KICAgICMgICAtICtub25lKyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQ0KICAg
ICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQ0KICAgICMgVGhlIHdh
eSB0aGlzIHdvcmtzOg0NCiAgICAjICAgQ29udmVydHMgZWFjaCBzdHJpbmcg
aW50byBhICJncmFwaCBsaWtlIiBvYmplY3QsIHdpdGggZWRnZXMNDQogICAg
IyAgICAgICAiYWxleHNhbmRlciIgLSA+IFsgYWxleHNhbmRlciwgYWxleHNh
bmQsIGFsZXhzYW4gLi4uIGxleHNhbmQgLi4uIHNhbiAuLi4gYW4sIGV0YyBd
DQ0KICAgICMgICAgICAgImFsZWtzYW5kZXIiIC0gPiBbIGFsZWtzYW5kZXIs
IGFsZWtzYW5kIC4uLiBldGMuIF0NDQogICAgIyAgIFBlcmZvcm0gbWF0Y2gs
IHRoZW4gcmVtb3ZlIGFueSBzdWJzZXRzIGZyb20gdGhpcyBtYXRjaGVkIHNl
dCAoaS5lLiBhIGhpdCBvbiAic2FuIiBpcyBhIHN1YnNldCBvZiBhIGhpdCBv
biAic2FuZGVyIikNDQogICAgIyA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bWNsb25lID0gbWF0Y2hlcy5kdXAN
DQogICAgICAgIG1jbG9uZS5lYWNoX2luZGV4IHsgfGlpfA0NCiAgICAgICAg
ICAgIHJlZyA9IFJlZ2V4cC5jb21waWxlKCBtY2xvbmVbaWldICkNDQogICAg
ICAgICAgICBjb3VudCA9IDAuMA0NCiAgICAgICAgICAgIG1hdGNoZXMuZWFj
aHsgfHh4fA0NCiAgICAgICAgICAgICAgICBjb3VudCArPSAxIGlmIHh4ID1+
IHJlZw0NCiAgICAgICAgICAgIH0NDQogICAgICAgICAgICBtYXRjaGVzLmRl
bGV0ZShtY2xvbmVbaWldKSBpZiBjb3VudCA+IDENDQogICAgICAgIH0NDQog
ICAgICAgIA0NCiAgICAgICAgc2NvcmUgPSAwLjANDQogICAgICAgIG1hdGNo
ZXMuZWFjaHsgfG1tfCBzY29yZSArPSBtbS5sZW5ndGggfQ0NCiAgICAgICAg
DQ0KICAgICAgICBzZWxmLmxlbmd0aCA+IHN0cl9pbi5sZW5ndGggPyBsYXJn
ZXN0ID0gc2VsZi5sZW5ndGggOiBsYXJnZXN0ID0gc3RyX2luLmxlbmd0aCAg
ICAgICAgDQ0KICAgICAgICByZXR1cm4gc2NvcmUvbGFyZ2VzdA0NCiAgICBl
bmQNDQplbmQNDQo--1394090772-989359847-1071506166963--
--1394090772-989359847-1071506166963--