Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dictionary API or Library [closed]

Tags:

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:

  1. I call get_definition(word)
  2. It returns the definition for that word (ideally in some way to easily format the definition for display.

Thanks

like image 725
Trey Avatar asked Oct 19 '08 16:10

Trey


People also ask

Is there an API for dictionary?

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.

Does Google Dictionary have an API?

Unfortunately, like others have said, the Google Dictionary API is deprecated.

What is words API?

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”.

What is Oxford API?

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.


2 Answers

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!]

like image 54
Erin Avatar answered Oct 15 '22 15:10

Erin


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');     } } 
like image 45
Ross Avatar answered Oct 15 '22 17:10

Ross