Spaces:
Runtime error
Runtime error
PFEemp2024
commited on
Commit
•
927d9eb
1
Parent(s):
de5d4b1
Fixing typeError highlitedText bug
Browse files
utils.py
CHANGED
@@ -39,9 +39,11 @@ class SentAttacker:
|
|
39 |
|
40 |
def diff_texts(text1, text2):
|
41 |
d = Differ()
|
|
|
|
|
42 |
return [
|
43 |
(token[2:], token[0] if token[0] != " " else None)
|
44 |
-
for token in d.compare(
|
45 |
]
|
46 |
|
47 |
|
|
|
39 |
|
40 |
def diff_texts(text1, text2):
|
41 |
d = Differ()
|
42 |
+
text1_words = text1.split()
|
43 |
+
text2_words = text2.split()
|
44 |
return [
|
45 |
(token[2:], token[0] if token[0] != " " else None)
|
46 |
+
for token in d.compare(text1_words, text2_words)
|
47 |
]
|
48 |
|
49 |
|