Compare strings. How much alike are 2 strings. Pseudo semantic analysis. Levenshtein distance.
however the wikipedia entry (http://en.wikipedia.org/wiki/Levenshtein_distance) specifies some obvious optimization of the levenshtein distance algorithm
you can store only the current and previous row to minimize memory requirement. thus optimizing the memory allocation for your calculations: