Skip to content

Commit

Permalink
Adds textdistance
Browse files Browse the repository at this point in the history
  • Loading branch information
pythad committed Sep 15, 2021
1 parent d6e50c5 commit b0521e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion harnic/compare/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from difflib import _mdiff

import textdistance


class Comparison:
def __init__(self, equal, strict_equal, diff, score):
Expand Down Expand Up @@ -73,7 +75,7 @@ def qp_compare(qp1, qp2):


def text_compare(t1, t2):
return 1
return textdistance.levenshtein.normalized_similarity(str(t1).splitlines(), str(t2).splitlines())


def content_compare(r1, r2):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ six==1.16.0
tabulate==0.8.9
tqdm==4.62.1
termcolor==1.1.0
textdistance[extras]==4.2.1

0 comments on commit b0521e0

Please sign in to comment.