mrmaxguns / wonderwordsmodule

Generate random words and sentences with ease in Python. Be on the lookout for bugfixes and speed improvements in 2.3
https://wonderwords.readthedocs.io
MIT License
53 stars 11 forks source link

Optional parameter part_of_speech #4

Closed mrmaxguns closed 4 years ago

mrmaxguns commented 4 years ago

I added an optional parameter called part_of_speech to all three functions in random_word.py so that the user could specify a part of speech for the random word if necessary. The default value of part_of_speech is None but can be set in the following way:

'noun' # Setting part_of_speech to noun will only return nouns
'verb' # Setting part_of_speech to verb will only return verbs
'adjective' # Setting part_of_speech to adjective will only return adjectives