If you just want to check if you can use one word as a noun, the fastest way would be to assemble many nouns, and then just check the word for membership in this set.
For a list of all nouns, you can use WordNet corpus (which can be accessed, for example, via NLTK):
>>> from nltk.corpus import wordnet as wn >>> nouns = {x.name().split('.', 1)[0] for x in wn.all_synsets('n')} >>> "cook" in nouns True >>> "and" in nouns False
source share