Statistical String Comparison


/ Published in: Python
Save to your folder(s)

http://docs.python.org/library/difflib.html


Copy this code and paste it in your HTML
  1. >>> import difflib
  2.  
  3. >>> difflib.SequenceMatcher(None, 'abcde', 'abcde').ratio()
  4. 1.0
  5.  
  6. >>> difflib.SequenceMatcher(None, 'abcde', 'zbcde').ratio()
  7. 0.80000000000000004
  8.  
  9. >>> difflib.SequenceMatcher(None, 'abcde', 'zyzzy').ratio()
  10. 0.0

URL: http://stackoverflow.com/questions/682367/good-python-modules-for-fuzzy-string-comparison

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.