#PyHugeConnector
Simple Connector for the BigHugeThesaaurus
##Installation
pip install pyhugeconnector
##Example Usage
>>> from pyhugeconnector import pyhugeconnector
>>> pyhugeconnector.thesaurus_entry(
word='python',
api_key='<YOUR-API-KEY>',
pos_tag='n',
ngram=2,
relationship_type='syn'
)
['disembodied spirit', 'mythical creature', 'mythical monster']
##Notes
- Works with NLTK WordNet PoS Tags (i.e. 'n' or
nltk.coprpus.wordnet.NOUN
) as well as the Big Huge Thesaurus PoS Tags. - By default, it uses
json
and returns a list of results. pyhugeconnector.thesaurus_entry_raw(…)
can be used to retrieve the raw entry returned from the API. NB: While forjson
responses the return type is a Pythondict
, forxml
orphp
responses the return type is astr
.- And no, neither
xml
norphp
are altered/parsed/touched in any way, what you receive is the rawstr
as returned by the API. - If you want to run the tests locally you need to pass your API key, i.e.:
python test.py <YOUR-API-KEY>
. - If you want to test with
nose
, you should installnose-testconfig
(pip install nose-testconfig
) and create a file callednose_config.yaml
. The contents of the File should simply beapi_key: <Your API Key>
. You can then run the nose tests withnosetests -s --tc-file nose_config.yaml --tc-format yaml
.
Currently available from here