oxford-dictionary
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "oxford-dictionary", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "A nodeJS wrapper for using the oxforddictionary.com REST API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# oxford-dictionary | ||
A nodeJS wrapper for using the oxforddictionary.com REST API. | ||
A NodeJS wrapper for using the oxforddictionary.com REST API. | ||
@@ -35,3 +35,3 @@ # Install: | ||
``` | ||
Or, if you want to use filters, regions, or declare a target language for translation, you can use an object with properties. The one required property is word. | ||
Or, if you want to use filters, regions, or declare a target language for translation, you can use an object with properties. The one required property is word. The RESTful endpoints for the API only allow for a filter OR region OR target_language, not a combination of them. | ||
@@ -68,44 +68,55 @@ ``` | ||
# Methods: | ||
.find retrieve available dictionary entries for a given word and language. | ||
Most, but not all RESTful endpoints for the Oxford Dictionary API have a method associated with it in this NodeJS wrapper. More will be added in the future. | ||
## .find | ||
`.find` retrieves available dictionary entries for a given word and language. | ||
A region OR filter can optionally be passed in an object with the word. | ||
``` | ||
dict.find("awesome"); | ||
var lookup = dict.find("awesome"); | ||
``` | ||
.definitions finds available dictionary entries for given word and language and returns the definitions. | ||
## .definitions | ||
`.definitions` retrieves available dictionary entries for given word and language and returns the definitions. | ||
``` | ||
dict.definitions("awesome"); | ||
var lookup = dict.definitions("awesome"); | ||
``` | ||
.inflections Retrieve available lemmas for a given inflected wordform. | ||
## .inflections | ||
`.inflections` retrieves available lemmas for a given inflected wordform. | ||
A filter can optionally be passed in an object with the word. | ||
``` | ||
dict.inflections("awesome"); | ||
var lookup = dict.inflections("awesome"); | ||
``` | ||
.pronunciations Find available dictionary entries for given word and language and returns the pronunciation. | ||
## .pronunciations | ||
`.pronunciations` retrieves available dictionary entries for given word and language and returns the pronunciation. | ||
``` | ||
dict.pronunciations("awesome"); | ||
var lookup = dict.pronunciations("awesome"); | ||
``` | ||
.examples Find available dictionary entries for given word and language and returns only examples. | ||
## .examples | ||
`.examples` retrieves available dictionary entries for given word and language and returns only examples. | ||
``` | ||
dict.examples("awesome"); | ||
var lookup = dict.examples("awesome"); | ||
``` | ||
.synonyms Retrieve available synonyms for a given word and language. | ||
## .synonyms | ||
`.synonyms` retrieves available synonyms for a given word and language. | ||
``` | ||
dict.synonyms("awesome"); | ||
var lookup = dict.synonyms("awesome"); | ||
``` | ||
.antonyms Retrieve available antonyms for a given word and language. | ||
## .antonyms | ||
`.antonyms` retrieves available antonyms for a given word and language. | ||
``` | ||
dict.antonyms("awesome"); | ||
var lookup = dict.antonyms("awesome"); | ||
``` | ||
.thesaurus Retrieve available synonyms AND antonyms for a given word and language. | ||
## .thesaurus | ||
`.thesaurus` retrieves available synonyms AND antonyms for a given word and language. | ||
``` | ||
dict.thesaurus("awesome"); | ||
var lookup = dict.thesaurus("awesome"); | ||
``` | ||
.sentences Retrieve list of sentences and list of senses (English language only). | ||
## .sentences | ||
`.sentences` retrieves list of sentences and list of senses (English language only). | ||
``` | ||
dict.sentences("awesome"); | ||
var lookup = dict.sentences("awesome"); | ||
``` | ||
.translate Retrieve list of sentences and list of senses (English language only). | ||
## .translate | ||
`.translate` retrieves list of sentences and list of senses (English language only). | ||
You must pass in a word and target language. | ||
``` | ||
dict.translate({ | ||
var lookup = dict.translate({ | ||
word: "awesome", | ||
@@ -112,0 +123,0 @@ target_language: "es" |
19238
406