ryanjgallagher / shifterator

Interpretable data visualizations for understanding how texts differ at the word level
Apache License 2.0
273 stars 29 forks source link

Wrong dictionary used to store no_score_types in helper.py #30

Closed pverspeelt closed 2 years ago

pverspeelt commented 2 years ago

The issue below doesn't seem to lead to any issues, but for correctness it should be fixed.

In helper.py:

Starting on line 75 when words are checked if there is a score in dictionary 1 but not in dictionary 2 the wrong dictionary is used to put the words in where the missing scores are handled. They should go into the no_score_types dict instead of the filtered_types dict. This occurs on line 86

currently:

        # Word has score in dict1 but not dict2
        ......
              elif handle_missing_scores == "exclude":
                filtered_types.add(t) # <-- should be no_score_types instead of filtered_types
       ......

Should be:

Word has score in dict1 but not dict2

    ......
          elif handle_missing_scores == "exclude":
            no_score_types .add(t) # <-- storing words in correct dictionary
   ......