There are many algorithms including Edclidean Distance, Pearson Distance, Jaccard, Cosin Distance and Levenshtein. For these five algorithms, I have the actual code in Java. the first four are comparing Integers in two arrays, but I believe it is very simple for us to convert it to String (based on each char's ASCII code). And the Levenshtein is for two strings already.
I expect more communication with you!
Looking forward for you reply!