in reply to Tuning an approximate match to prefer closer lengths

In this case, you could add an additional criteria to compare the length of the strings. The one with the length closest to your target string would be 'source1'. I'm not sure if the idea will apply generally, but it's worth investigation.

Update: just noticed you mentioned the same exact thing in your question. Silly me for not reading carefully enough. Sorry about that. :-)

I don't think it would be too particularly "gross", though, to have two passes. After all, this is a heuristic, right? Heuristics are usually messy.

  • Comment on Re: Tuning an approximate match to prefer closer lengths

Replies are listed 'Best First'.
Re^2: Tuning an approximate match to prefer closer lengths
by samtregar (Abbot) on Nov 09, 2005 at 00:12 UTC
    Yes, perhaps you're right. I implemented this approach and it seemed to do the trick.

    -sam