0.1.2 • Published 4 years ago

oxford-dictionaries-api v0.1.2

Weekly downloads
10
License
ISC
Repository
github
Last release
4 years ago

oxford-dictionaries-api

node module wrapper for Oxford dictionaries api v2

Install

npm install --save oxford-dictionaries-api

Usage

initial

Initialize an instance of the OxfordDictionaries class to use

// need app_id and app_key
const app_id = 'your_appid'
const app_key = 'your_appkey';

let oxford= require('oxford-dictionaries-api');
let oxforddictionaries = new oxford(app_id, app_key);

functions

Note: A lot of the key names for the functions' objects are taken from the oxford docs Here. I might not have updated this readme cause I probably would be working on other things. (I think the biggest thing that people would usually use is entries, which should get you the definition of words)

entries({ word_id, source_lang, fields, grammaticalFeatures, lexicalCategory, domains, registers, strictMatch })

function takes in an object with the following:

KeyTypeOptionalAboutDefaultExample
word_idStringNoThe identifier for an Entry (case-sensitive).Null"ace"
source_langStringYesLanguage code of the source language in a monolingual dataset."en-gb""en-gb"
fieldsArrayStringYesA comma-separated list of data fields to return for the matched entriesNull"definitions", "domains"
grammaticalFeaturesArrayStringYesA comma-separated list of grammatical features ids to match on (default: all features).Null"Cardinal", "Ordinal"
lexicalCategoryArrayStringYesA comma-separated list of lexical categories ids to match on (default: all categories).Null
domainsArrayStringYesA comma-separated list of domains ids to match on (default: all domains).Null
registersArrayStringYesA comma-separated list of registers ids to match on (default: all registers).Null
strictMatchBooleanYesSpecifies whether diacritics must match exactly.FalseTrue

Example:

oxforddictionaries.entries({word_id: 'ace'})
  .then((data) => console.log(data))
  .catch((e) => console.log('Error', e));

lemmas({ word_id, source_lang, grammaticalFeatures, lexicalCategory })

search({ source_lang, target_lang, q, prefix, limit, offset })

translation({ source_lang, target_lang, word_id, strictMatch })

thesaurus({ lang, word_id, fields, strictMatch })

sentences({ source_lang, word_id, strictMatch })

lexistats_ngrams({ source_lang, corpus, ngram_size, tokens, contains, format, minFrequency, maxFrequency, collate, sort, offset, limit })

lexistats_word({ source_lang, corpus, wordform, trueCase, lemma, lexicalCategory })

lexistats_words({ source_lang, corpus, wordform, trueCase, lemma, lexicalCategory, grammaticalFeatures, minFrequency, maxFrequency, minNormalizedFrequency, maxNormalizedFrequency, collate, sort, offset, limit })

domains({ source_lang, target_lang } = {})

fields({ endpoint } = {})

filters({ endpoint } = {})

grammaticalFeatures({ source_lang, target_lang } = {})

languages({ sourceLanguage, targetLanguage } = {})

lexicalcategories({ source_lang, target_lang } = {})

registers({ source_lang, target_lang } = {})

0.1.2

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago