Skip to content

Commit

Permalink
Update dependencies (closes #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsgoncalves committed Jul 8, 2024
1 parent adbdf54 commit f144581
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
24 changes: 12 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Owlready2~=0.44
owlready2~=0.46
argparse~=1.4.0
pandas~=2.0.3
numpy~=1.24.2
gensim~=4.3.0
scipy~=1.10.1
scikit-learn~=1.2.1
setuptools~=68.2.2
requests~=2.31.0
pandas~=2.2.2
numpy~=1.26.4
gensim~=4.3.2
scipy~=1.12.0
scikit-learn~=1.5.1
setuptools~=70.2.0
requests~=2.32.3
tqdm~=4.66.1
sparse_dot_topn~=0.3.4
bioregistry~=0.10.6
sparse-dot-topn~=1.1.3
bioregistry~=0.11.10
nltk~=3.8.1
rapidfuzz~=2.13.7
rapidfuzz~=3.9.4
shortuuid~=1.0.11
myst_parser~=2.0.0
myst-parser~=2.0.0
2 changes: 1 addition & 1 deletion text2term/config.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "4.1.4"
VERSION = "4.2.0"
9 changes: 4 additions & 5 deletions text2term/syntactic_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,32 +79,31 @@ def compare_levenshtein(self, s1, s2):
Calculates the normalized Levenshtein distance between s1 and s2.
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.string_metric.normalized_levenshtein(s1, s2)/100
similarity = rapidfuzz.distance.Levenshtein.normalized_similarity(s1, s2)
return similarity

def compare_jaro(self, s1, s2):
"""
Calculates the Jaro similarity between s1 and s2.
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.string_metric.jaro_similarity(s1, s2)/100
similarity = rapidfuzz.distance.Jaro.normalized_similarity(s1, s2)
return similarity

def compare_jarowinkler(self, s1, s2):
"""
Calculates the Jaro-Winkler similarity between s1 and s2.
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.string_metric.jaro_winkler_similarity(s1, s2)/100
similarity = rapidfuzz.distance.Jaro.normalized_similarity(s1, s2)
return similarity

def compare_indel(self, s1, s2):
"""
Calculates the normalized Indel distance between s1 and s2.
See: https://maxbachmann.github.io/RapidFuzz/Usage/fuzz.html#ratio
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.fuzz.ratio(s1, s2)/100
similarity = rapidfuzz.distance.Indel.normalized_similarity(s1, s2)
return similarity

def compare_fuzzy_ratio(self, s1, s2):
Expand Down

0 comments on commit f144581

Please sign in to comment.