[issue21344] save scores or ratios in difflib get_close_matches

2014-04-25 Thread Russell Ballestrini
Russell Ballestrini added the comment: Adding patch to update tests to use Tim Peters suggestion of assertListEqual over assertEqual for list compares. -- Added file: http://bugs.python.org/file35040/diff-lib-tim-peters-assert-list-equals.patch

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-25 Thread Russell Ballestrini
Russell Ballestrini added the comment: Tim, You bring up some great points and insight I was missing. To me the scores just aren't interesting beyond which words' scores exceed a cutoff, and the ordering of words based on their similarity scores - but `get_close_matches()` already captures

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
New submission from Russell Ballestrini: The current implementation of difflib's get_close_matches() function computes computationally complex scores (ratios) but then tosses them out without giving the end-user the chance to have at them. This patch adds an optional scores boolean argument

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini russell.ballestr...@gmail.com: Removed file: http://bugs.python.org/file35022/difflib.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini russell.ballestr...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file35023/difflib-patch-to-save-scores-in-get-close-matches.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: Claudiu.Popa, Yes, that was my first idea on how to tackle this issue. I will create another proper patch that prepares two separate functions: * get_close_matches * get_scored_close_matches Where each are basically wrapper / API functions around

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: New function in difflib: get_scored_matches() This function acts just like the existing get_close_matches() function however instead of returning a list of words, it returns a list of tuples (score, word) pairs. This gives the end-user the ability

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: get_close_matches() doesn't seem to have any tests... I suppose I should write them considering I'm changing the functionality a bit. TODO: write tests for * difflib.get_close_matches() * difflib.get_scored_matches() Determine if docstrings

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini russell.ballestr...@gmail.com: Removed file: http://bugs.python.org/file35023/difflib-patch-to-save-scores-in-get-close-matches.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini russell.ballestr...@gmail.com: Removed file: http://bugs.python.org/file35024/difflib-patch-to-save-scores.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: Ok, this patch is ready for review. -- Added file: http://bugs.python.org/file35033/diff-lib-get-scored-matches-tests-and-docs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: At some point I plan to write a web API that accepts a word, 'doge' and returns a list of possible suggestions and scores. Later a did you mean dog style suggestion could be implemented on top. We compute the scores, and it is computationally taxing, we