[U] A3 P3 Q2 B
This commit is contained in:
@@ -79,7 +79,7 @@ def clean_text(text: str) -> list[str]:
|
|||||||
text = str.replace(text, p, ' ')
|
text = str.replace(text, p, ' ')
|
||||||
|
|
||||||
# Convert text to lowercase
|
# Convert text to lowercase
|
||||||
str.lower(text)
|
text = text.lower()
|
||||||
|
|
||||||
# Split text into words and return
|
# Split text into words and return
|
||||||
return str.split(text)
|
return str.split(text)
|
||||||
@@ -95,7 +95,7 @@ def count_keywords(word_list: list[str]) -> dict[str, int]:
|
|||||||
if word in WORD_TO_INTENSITY:
|
if word in WORD_TO_INTENSITY:
|
||||||
if word not in occurrences_so_far:
|
if word not in occurrences_so_far:
|
||||||
occurrences_so_far[word] = 0
|
occurrences_so_far[word] = 0
|
||||||
occurrences_so_far[word] = occurrences_so_far[word] + 1
|
occurrences_so_far[word] += 1
|
||||||
|
|
||||||
return occurrences_so_far
|
return occurrences_so_far
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user