Re: String comparisons

new topic     » goto parent     » topic index » view thread      » older message » newer message

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu