A simple (slow but beautiful) algorithm to find similar things in ruby