Skip to content

Commit

Permalink
fix when score table is none
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatYYX committed May 29, 2020
1 parent dfd677a commit d68993c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rltk/similarity/needleman.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def _get_score(c1, c2, match, mismatch, score_table):
"""
if there's no score found in score_table, match & mismatch will be used.
"""
if c1 in score_table and c2 in score_table[c1]:
if score_table and c1 in score_table and c2 in score_table[c1]:
return score_table[c1][c2]
else:
return match if c1 == c2 else mismatch
Expand Down

0 comments on commit d68993c

Please sign in to comment.