Re: String comparisons
- Posted by SDPringle Apr 21, 2018
- 1764 views
Another way of looking at being close matches is the longest common string. This is complex but thanks to James Johnathan Cook, it's just a matter of downloading his include file https://archive.usingeuphoria.com/lcssp.zip and running a routine.
include lcssp.e sequence a = "hello good-night", b = "hello good-bye" -- two strings sequence common_string = LCSubstr_fast(a, b)
The length(common_string) / max(length(a), length(b)) is a measure of similarity. It's value is between 0 to 1 inclusive.