3 ms·
Fantastically thorough research, the kind of stuff I love to read. However I can't help but feel the much less impressive other answer "Use Levenshtein distance
by eblume 14y ago
Fantastically thorough research, the kind of stuff I love to read. However I can't help but feel the much less impressive other answer "Use Levenshtein distance, here is the link." (paraphrased) is the better answer.
The long-winded answer goes in to a huge amount of details on really interesting pattern matching problems... but not really the specific problem mentioned by the question asker.
I'm glad for a world with Stack Overflow and other similar resources, because I find the long answer fascinating but if I were asking the question I'd much prefer also having access to the shorter, succinct, and also-correct answer beneath it.
- avalenciano 14y agoBTW, Levenshtein distance is implemented in Clojure under the Incanter project (incanter.stats).
- paulsutter 14y agoHe did far more than use Levenshtein distance. He is matching phrases not individual words. He created different metrics based on Levenshtein distance, combined them using a weighted formula, and used an optimization algorithm to choose weights. And he provides great visualizations on how it worked. I've tried several approaches to fuzzy string matching, and I'm impressed with his results and approach. I've bookmarked it for future reference.
- Tloewald 14y agoThis all presupposes that this is what is meant by "closest". The deservedly highly ranked response at least addresses some interesting ways of defining "close" while skipping the most important, and difficult, case -- semantic content. Frederick jumps cows Frederick never jumps cows Fred leaps bovines
- roel_v 14y agoThe main problem is though that he doesn't go into much detail on how specific his set of parameters is to the phrases he's matching against. I suspect that his optimization won't help much when doing a free match against any possible string, in which case the added detail doesn't do much for the person asking (at least not from what we can gather from the question).