matching - Best way in php to find most similar strings? -


hell,

php has lot of string functions levenshtein, similar_text , soundex can compare strings similarity. http://www.php.net/manual/en/function.levenshtein.php

which best accuracy , performance?

similar_text has complexity o(max(n,m)**3) , levenshtein complexity of o(m*n), n , m lengths of strings, levenshtein should faster. both 100% accurate, in give same output same input, outputs each function differ. if using different measure of accuracy, you'll have create own comparison function.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -