Skip to content

Commit

Permalink
Update extract_keywords.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasExorde authored Oct 30, 2024
1 parent c211aba commit 9ac7f79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exorde/extract_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def process_keywords(keywords):
else:
# If the keyword is already lowercase, keep it as is
processed_keywords.append(keyword)

# Remove case-sensitive duplicates
return list(dict.fromkeys(processed_keywords))

def extract_keywords(translation: Translation) -> Keywords:
content: str = translation.translation
Expand Down Expand Up @@ -211,4 +214,4 @@ def extract_keywords(translation: Translation) -> Keywords:
keywords_ = process_keywords(keywords_)
except Exception as e:
print(f"Error in advanced keywords extraction: {e}")
return Keywords(list(set(keywords_)))
return Keywords(list(keywords_))

0 comments on commit 9ac7f79

Please sign in to comment.