Skip to content

Commit

Permalink
refactor(author-search): 🚧 lowercase and remove special characters wh…
Browse files Browse the repository at this point in the history
…en comparing strings for score
  • Loading branch information
djdembeck committed Oct 3, 2021
1 parent e5d70dd commit 8dfa708
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ def score_author(self, helper, author):
scorebase3 = helper.media.artist
scorebase4 = author
author_score = Util.LevenshteinDistance(
scorebase3, scorebase4
scorebase3.lower()
.replace('-', '').replace(' ', '').replace('.', ''),
scorebase4.lower()
.replace('-', '').replace(' ', '').replace('.', '')
)
log.debug("Score deduction from author: " + str(author_score))
return author_score
Expand Down

0 comments on commit 8dfa708

Please sign in to comment.