This python script can be used to extract synonyms of a word given it’s part-of-speech from WordNet.
Requirement: NLTK is to be installed first