I started writing these rudimentary algorithms to parse log files and group similar log entries by some fuzzy string distance metric. If you're looking for clustering alorithms, don't use this code and check out Cluster Analysis algorithms on Wikipedia.
you'll need the levenshtein gem: gem install levenshtein
.