或或 I''m looking for a method to compare two strings and grade them forsimilarity.My idea is to strip out common words and punctuation and create a checksumof each remaining string. I would then compare the checksums and if they areclose then there''s a potential match (to be judged by user interaction.)Can someone suggest an existing function or class to perform such a task?Thanks! 解决方案 http://docs.php.net/en/function.levenshtein.htmlor http://docs.php.net/en/function.similar-text.htmlCheers,Nhcholas Sherlock http://docs.php.net/en/function.levenshtein.html or http://docs.php.net/en/function.similar-text.html Cheers, Nhcholas SherlockNhcholas, I''m embarrassed to say that I didn''t check php.net before postingmy message. Shame on me, but thanks for the tip! http://docs.php.net/en/function.levenshtein.html or http://docs.php.net/en/function.similar-text.html Cheers, Nhcholas Sherlock 这篇关于字符串相似性比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 06:39