in reply to Fuzzy Strings

Hi Again

In response to Jeff:

It wasn't that I thought String::Approx was not working it was just that it returned all the matches where as I just want the function to return the highest scoring match.

Orthanc

Replies are listed 'Best First'.
RE: Re: Fuzzy Strings
by merlyn (Sage) on Sep 05, 2000 at 18:15 UTC
    You could reinvoke String::Approx using successively more and more relaxed constraints until it gets some hits. Those hits would then be all equally "the best", unless you have some other criterion in mind. For example, if given "abcd" and the best matches are "abce" or "bbcd", there's no one match that's "best". Perhaps you need to rethink your problem.

    -- Randal L. Schwartz, Perl hacker