Max Williams wrote:
> Max Williams wrote:
>> Max Williams wrote:
>> 
>>>         return string_array_proximity
>> oops this should have been
>>   return string_array_proximity(self, other)
>> 
>> You get the idea anyway.
> 
> oh and in case you don't have a string comparison method yet there's a 
> nice gem called amatch which implements many different string proximity 
> algorithms, eg levenshtein distance etc.

Max,

Many thanks for your replies.

I like your approach because it makes it easy to metacode the proximity 
module, that is to allow users to define metaobjects by something like:

class txtwords < Factfile
   basetype Array

   porximate_to Array,Array_Array_proxy
   proximate_to String,Array_String proxy

...


So every call to the proximate_to function will actually re-program the 
case part of the module (would appreciate any ideas about how to best 
implement that...).

Also, many thanks for the reference to the amatch module. I am quite a 
lazy person so I would be happy to re-use anything that already exists 
:-)

Best,

Oren
-- 
Posted via http://www.ruby-forum.com/.