Skip to content

Commit f343de8

Browse files
committed
Fixed similarity edge case
1 parent f732ad3 commit f343de8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

paperqa/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def maybe_is_text(s, thresh=2.5):
1717

1818

1919
def strings_similarity(s1, s2):
20+
if len(s1) == 0 or len(s2) == 0:
21+
return 0
2022
# break the strings into words
2123
s1 = set(s1.split())
2224
s2 = set(s2.split())

0 commit comments

Comments
 (0)