Repository navigation
Conversation
Here I propose a new function, namely .ratio_min(self,m). .ratio_min(self,m) is an extension of the difflib's function .ratio(self). Equivalently to .ratio(self), .ratio_min(self,m) returns a measure of two sequences' similarity (float in [0,1]). In addition to .ratio(), it can ignore matched substrings if these substrings have length less than a given threshold m. m is the second variable of the function. It is very useful to avoid spurious high similarity scores.
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
|
I've added the "DO-NOT-MERGE" label for now, since this suggestion still requires discussion and acceptance. Also, note that (if accepted) this change will need to be made only on the main branch, so this PR will need to be changed accordingly or replaced by a new PR. |
|
I'm closing this for now since nobody has followed up(here or on the issue tracker) and to the best of my understanding this wouldn't be an appropriate addition to the stdlib. This can be re-opened in the future if needed, of course. |
Here I propose a new function, namely .ratio_min(self,m).
.ratio_min(self,m) is an extension of the difflib's function .ratio(self). Equivalently to .ratio(self), .ratio_min(self,m) returns a measure of two sequences' similarity (float in [0,1]). In addition to .ratio(), it can ignore matched substrings if these substrings have length less than a given threshold m. m is the second variable of the function.
It is very useful to avoid spurious high similarity scores.
NEW FUNCTION CODE:
https://bugs.python.org/issue46086