Updated has_10_words to has_50_words

This commit is contained in:
Pedro Fonseca
2024-03-24 10:37:02 +00:00
parent 7049fd86d4
commit cc3371c597
2 changed files with 5 additions and 5 deletions

View File

@@ -94,11 +94,11 @@ def has_words(text: str):
words_in_input = text.split()
return any(word.lower() in english_words for word in words_in_input)
def has_10_words(text: str):
def has_50_words(text: str):
english_words = set(words.words())
words_in_input = text.split()
english_word_count = sum(1 for word in words_in_input if word.lower() in english_words)
return english_word_count >= 10
return english_word_count >= 50
def divide_text(text, max_length=3000):
if len(text) <= max_length: