From e54b8cbff7835b764c49c368d29a770eb18b589a Mon Sep 17 00:00:00 2001 From: Deena Sun Date: Thu, 16 Jan 2025 09:38:10 -0800 Subject: [PATCH] [chore] added comments to clarify what merge function fix does --- api/webscraper/utils/scraper_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/webscraper/utils/scraper_utils.py b/api/webscraper/utils/scraper_utils.py index 9b2c819..cc2bdae 100644 --- a/api/webscraper/utils/scraper_utils.py +++ b/api/webscraper/utils/scraper_utils.py @@ -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