By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,706 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,706 IT Pros & Developers. It's quick & easy.

The "junk" parameter in difflib.sequencematcher

P: n/a

I am confused by the junk parameter in the difflib.sequencematcher. I
thought it would simply ignore everything that's returned true by the
junk function. However, I have results as follows:
sequencematcher(lambda x: x == ' ', "lion", "li on").ratio() 0.88888888888888884 sequencematcher("lion", "li on").ratio() 0.0 sequencematcher(lambda x: x == ' ', "lion", " lion ").ratio()


It's not ignoring the blanks, and when comparing "lion" and "li on",
when nothing is considered junk, the similarity ratio is 0!

What am I missing here?

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.