Skip to content

Commit 4772fd0

Browse files
authored
Update word_frequency_functions.py
1 parent 7ef2ffc commit 4772fd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

machine_learning/word_frequency_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def document_frequency(term: str, corpus: str) -> int:
7979
str.maketrans("", "", string.punctuation)
8080
) # strip all punctuation and replace it with ''
8181
documents = corpus_without_punctuation.split("\n")
82-
lowercase_documents = [document.lower() for document in documents]
82+
lowercase_docs = [document.lower() for document in documents]
8383
return (
84-
len([doc for doc in lowercase_documents if term.lower() in doc]),
84+
len([doc for doc in lowercase_docs if term.lower() in doc]),
8585
len(documents),
8686
)
8787

0 commit comments

Comments
 (0)