I need to create some algorithm that will count the level of similarity of two strings with equal size.
For example we have one string with size 10. And several strings with size 10 that we should measure.
First has one part of 9 symbol similar (9 from 10)
Second has two parts of 7 and 2 symbols
Third has 3 parts for (4, 3, 1) symbols
4th 8 symbols
5th has one part with 6 symbols
I need some algorithm that will range all this strings for the level of similarity. As i understand the longer one part is the more similar are strings. But for example what is better one part with 8 elements or two with 7 and 2 elements. One part with 6 element or 3 parts with 4, 3, 1 segments that have 8 symbols at sum. Any advice?
P.S. guys, i dont need algoritm how tp compare strings, i need algoritm how to count difference, how to define similarity if i have already several common parts in two strings.
Initial string "i like apple"
- "apple i like" (apple i like)
- "i like appel" (i like app l e)
- "i like papel" (i like ap p l e)
- "i like pleap" (i like ap ple)
- "i like mango" (i like a)
It should be some math that count general length of string, length of parts that "cover" initial string and maybe some additio al parameter (if less parts - than better for similarity !!maybe!!)