unobliged / plymlet

plymlet rails test code
http://plymlet.herokuapp.com
0 stars 0 forks source link

create a helper function: definition_for_word #4

Closed dpaola2 closed 12 years ago

dpaola2 commented 12 years ago

This should be a function that accepts a string and attempts to return a definition for that word.

unobliged commented 12 years ago

I managed to get the rwordnet gem (wordnet gem bundled with dictionary) to work for my define_word function, though I had to do some error catching to handle instances where it could not find anything. Also, apparently many dictionaries omit prepositions and other transition words (e.g., a, at, by). I can safely say I do NOT want to use WordNet in any of its incarnations for this, though working with it helped me appreciate the problems associated with using sources that draw from it. I looked at the wikitionary/mediawiki api but it seemed horribly complex and I am not sure where to start. I downloaded a flat file dictionary for english from there to play around with though.