only alphalower words

This commit is contained in:
Daniel Tsvetkov 2022-01-17 12:42:35 +01:00
parent eae0d2a2cf
commit 387fd7f2f0

2
lib.py
View File

@ -16,5 +16,5 @@ def cat_words(dictionary=DICTIONARY):
# remove end of line
word = word[:-1]
# filter out five letter words
if len(word) == WORD_LENGTH and "'" not in word and not word[0].isupper():
if len(word) == WORD_LENGTH and all([letter.isalpha() and letter.islower() for letter in word]):
yield word