stopwords-+40
This commit is contained in:
parent
d113674012
commit
6fffea0df4
|
@ -16,12 +16,10 @@ def check_stopwords(text):
|
|||
Returns:
|
||||
bool: True if any stopword is found in the text, False otherwise.
|
||||
"""
|
||||
# Normalize the text by converting it to lower case and splitting into words
|
||||
words = text.replace(' ', '').lower().split()
|
||||
|
||||
# Iterate through each word and check for stopwords
|
||||
for word in words:
|
||||
if word in stopword_set:
|
||||
for word in stopword_set:
|
||||
if word in text:
|
||||
return True # Stop iteration and return True if a stopword is found
|
||||
|
||||
return False # Return False if no stopwords are found
|
||||
|
|
Loading…
Reference in New Issue
Block a user