PyThesaurus
- 1 minsDescription
This python package gets you the thesaurus of an inputted word from the best dictionary sites available online.
Why you need this package?
Though python provides lexical resources like WordNet, the variety it can provide is poor. The rich content the Thesaurus.com or the Dictionary.com provides will help the user to enhance their approaches when he/she is dealing with text mining, NLP techniques and much more.
How to install?
Use pip
to install this library.
pip install py_thesaurus
How to use PyThesaurus?
From python shell
from py_thesaurus import Thesaurus
input_word = "dream"
new_instance = Thesaurus(input_word)
# Get the synonyms according to part of speech
# Default part of speech is noun
print(new_instance.get_synonym())
print(new_instance.get_synonym(pos='verb'))
print(new_instance.get_synonym(pos='adj'))
# Get the definitions
print(new_instance.get_definition())
# Get the antonyms
print(new_instance.get_antonym())
From command line
- Positional arguments
word --> Word to get definition/synonym/antonym for.
- Optional arguments
-h or --help Show this help message and exit -d get definition -s {noun,verb,adj} get POS specific synonyms -a get antonyms
- Command
py_thesaurus [-h] [-d] [-s {noun,verb,adj}] [-a] word py_thesaurus -d -s verb -a dream
Contact
-
PyPI link: https://pypi.python.org/pypi/py-thesaurus
-
Bitbucket: https://bitbucket.org/redpills01/py_thesaurus.git
-
Issue tracker: https://bitbucket.org/redpills01/py_thesaurus/issues
-
Email: redpillsworkspace@gmail.com
Made with Love by Redpills