Does anyone know of a good dictionary API or ruby library to lookup the definitions of words?
I'm thinking it should work something like:
Thanks
The Merriam-Webster Dictionary API gives developers access to a comprehensive resource of dictionary and thesaurus content as well as specialized medical, Spanish, ESL, and student-friendly vocabulary.
Unfortunately, like others have said, the Google Dictionary API is deprecated.
Words API lets you retrieve information about English words, including definitions, synonyms, rhymes, pronunciation, syllables, and frequency of usage. It also can tell you about relationships between words, for instance that “math” has categories like “algebra” and “geometry”, or that a “finger” is part of a “hand”.
The Oxford Dictionaries API gives you access to: flexible endpoints including headwords, parts of speech, definitions, translations, audio, example sentences, labels, and more… data expertly pre-processed by our in-house engineers to ensure accuracy and consistency of format.
Wordnik.com has several word-info APIs, including a definitions API. More info is here: http://developer.wordnik.com/
[I work for Wordnik. We will have more APIs soon, let us know what you want!]
I discovered a webservice for this yesterday.
Go to the British Council homepage and double click on any word (that isn't already a hyperlink).
This should open a popup window with a Cambridge Dictionary definition in it. The API is relatively simple (and it is a public API, I checked it yesterday):
http://dictionary.cambridge.org/learnenglish/results.asp?searchword=SEARCH_PHRASE&dict=L
For reference, here's the code they use to launch this on double-click:
/* BC double-click pop-up dictionary */ var NS = (navigator.appName == "Netscape" || navigator.product == 'Gecko') ? 1 : 0; if (NS) document.captureEvents(Event.DBLCLICK); document.ondblclick = dict; var dictvar; function dict() { if (NS) { t = document.getSelection(); pass_to_dictionary(t); } else { t = document.selection.createRange(); if(document.selection.type == 'Text' && t.text != '') { document.selection.empty(); pass_to_dictionary(t.text); } } } function pass_to_dictionary(text) { //alert(text); if (text > '') { window.open('http://dictionary.cambridge.org/learnenglish/results.asp?searchword='+text+ '&dict=L', 'dict_win', 'width=650,height=400,resizable=yes,scrollbars=yes'); } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With