Skip to content

Commit

Permalink
[chore] added comments to clarify what merge function fix does
Browse files Browse the repository at this point in the history
  • Loading branch information
deenasun committed Jan 16, 2025
1 parent 6fa6239 commit e54b8cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/webscraper/utils/scraper_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def find_keyword(project_name):
last_non_digit_index = len(project_name) - 1
while last_non_digit_index > 0 and project_name[last_non_digit_index].isdigit():
last_non_digit_index -= 1

# return the substring up to but not including the last non-digit
# if there are no non-digit characters, return the whole project name
return (
project_name[: last_non_digit_index + 1].strip()
if last_non_digit_index < len(project_name) - 1
Expand Down

0 comments on commit e54b8cb

Please sign in to comment.