Skip to content

Commit

Permalink
code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmednasserswe committed Aug 23, 2024
1 parent 1762b68 commit da294e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/model/yake_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ def keep_largest_overlapped_keywords(self, keywords):
if keep_keyword:
cleaned_keywords.append(keywords[i])
return cleaned_keywords

def normalize_special_characters(self, text):
replacement = {"`": "'",
"‘": "'",
"’": "'",
"“": "\"",
"”": "\""}


for k, v in replacement.items():
text = text.replace(k, v)
return text
Expand Down
1 change: 1 addition & 0 deletions test/lib/model/test_yake_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_run_yake_real(self):
})
results = self.yake_model.run_yake(**self.yake_model.get_params(message))
self.assertEqual(results, {"keywords": [('love Meedan', 0.0013670273525686505)]})

def test_keep_largest_overlapped_keywords(self):
keywords_test = [('Alegre', 0),('Alegre', 0),('Timpani', 0), ('Presto Timpani', 0), ('AlegreAlegre', 0), ('Alegre Alegre', 0), ("Presto", 0)]
expected = [('Presto Timpani', 0), ('AlegreAlegre', 0), ('Alegre Alegre', 0)]
Expand Down

0 comments on commit da294e1

Please sign in to comment.