Just another Perl shrine | |
PerlMonks |
Re^2: Fuzzy Searching: Optimizing Algorithm Selectionby hv (Prior) |
on Nov 12, 2004 at 11:48 UTC ( [id://407335]=note: print w/replies, xml ) | Need Help?? |
If you double the number of 25-ers, you double the time. Yes. If you double the average length of the strings, you slightly less than double the time. No: 1 + 50C1 + 50C2 = 1 + 50 + 1225 = 1276, nearly 4 times the 326 different regexps required for a length-25 string. Of course there are two ways of allowing for fuzziness: replace /x/ with /[^x]/, or replace it with /./; the latter approach means you don't also need the 0- and 1-mismatch patterns, leaving 300 patterns (for length-25, up to 2 errors) or 1225 (for length-50). Hugo
In Section
Seekers of Perl Wisdom
|
|