Nabeel Alzahrani added the comment:
Here are the steps that I used to calculate 0.2 for the last example:
I used class difflib.HtmlDiff to find the number of changed chars (addedChars,
deletedChars, and changedChars) which is 1172 (let us call it delta)
The size of both strings a and b in
Change by Nabeel Alzahrani :
--
resolution: not a bug ->
status: closed -> open
___
Python tracker
<https://bugs.python.org/issue45180>
___
___
Pyth
Nabeel Alzahrani added the comment:
But when I turn off the "autojunk" feature for the following example, I get the
wrong ratio of 0.5 instead of the correct ratio of 0.2 with autojunk enabled.
a="""
#include
#include
using namespace std;
int main() {
New submission from Nabeel Alzahrani :
The difflib.SequenceMatcher.ratio() gives 0.3 instead of 1.0 or at least 0.9
for the following two strings a and b:
a="""
#include
#include
using namespace std;
int main() {
string userWord;
unsigned int i;