how to create english language dictionary application with python (django)?
dictionary, django, python
Solution
You might want to check out http://www.nltk.org/ You could get lots of words and their definitions without having to worry about the implementation details of a database. If you're new to all this stuff, at the very least it would be useful to get you up and going, and then when you've got a working version, start putting in a database.
Here's a quick snippet of how to get all the available meanings of "dog" from that package:
from nltk.corpus import wordnet
for word_meaning in wordnet.synsets('dog'):
print word_meaning.definition
Problem
I would like to create an online dictionary application by using python (or with django). It will be similar to http://dictionary.reference.com/. PS: the dictionary is not stored in a database. it's stored in a text file or gunzip file. Free english dictionary files can be downloaded from this URL: dicts.info/dictionaries.php. The easiest free dictionary file will be in the format of: ``` word1 explanation for word1 word2 explanation for word2 ``` There are some other formats as well. but all are stored in either text file or text.gz file My question is (1) Are there any existing open source python package or modules or application which implements this functionality that I can use or study from? (2) If the answer to the first question is NO. which algorithm should I follow to create such web application? Can I simply use the python built-in dictionary object for this job? so that the dictionary object's key will be the english word and the value will be the explanation. is this OK in term of performance? OR Do I have to create my own Tree Object to speed up the search? or any existing package which handles this job properly? Thank you very much.