Today at work I introduced a new feature that is exceptionally cool. For a certain reason we need to group database records without primary/foreign keys. The lack of restrictions allows more flexibility to the user, but comes at the expense of uncertainty. The goal was to develop a fuzzy match that would demonstrate an acceptable level of accuracy. In this particular case, the primary point of comparison is a person’s name (the only required field), but the requirement is to account for naturally occurring variations in the spelling, including typos, or simply guesses.
irb> Text::Metaphone.metaphone('Tony Targonski')
=> "TN TRKNSK"
What this means is that even a horribly misspelled variation of my name will match, as long as it sounds somewhat like TN TRKNSK
irb> Text::Metaphone.metaphone('Tony Targonski') ==
Throw in some Levenshtein distance to sort the results based on how far off they are from the original query, and we’ve got a very impressive functionality, developed by a co-op student. A round of applause for very little new code, so — what exactly did I do?
A year old IBM commercial comes to mind.
Look at the guy who invented sliced bread. He didn’t invent bread. He didn’t invent slicing. He just applied new technology to an age old problem.
Alright, so this isn’t exactly new technology, or an age old problem, though this does demonstrate the point of the other side of Computer Science – practical application of algorithms. You’ve memorized a bubble sort, great! Now learn to apply it. Find out what actual problems are solved with new concepts that you are currently learning, and it will be understood and retained so much better.