Sunday, April 6, 2014

English words present in dictionary for Python use

A good resource of English words available in English dictionary is WordNet by Princeton University. Though its primary usage is not for getting the list of English words and their meanings, you can still get that information from WordNet.

Either you could download the WordNet database and do the parsing yourself (or using other pre-existing Python scripts), or use the NLTK natural language processing toolkit in Python. The toolkit provides instructions for using wordnet at WordNet Interface.

You could also use the PyEnchant spell checking library available for Python. Using this you can check whether a word is acceptable as per a specific English dictionary, though you won't get the word meanings.

As stated in [2], the word coverage in WordNet is not complete, but it is very useful. Depending on the use case, one option can be preferred over the other.

References:
1. http://www.velvetcache.org/2010/03/01/looking-up-words-in-a-dictionary-using-python
2. http://stackoverflow.com/questions/3788870/how-to-check-if-a-word-is-an-english-word-with-python
3. http://www.nltk.org/howto/wordnet.html
4. http://pythonhosted.org/pyenchant/

No comments:

Post a Comment