oxenfurt
1.0.0A client for the Oxford dictionary API.
About Oxenfurt
This library implements a client for the Oxford dictionary API. It gives you full access to the available REST endpoints and transforms all results into native Lisp instances for easy handling.
How To
First you'll need to sign up for their API and get the App keys. Once you have registered, you can find the keys here. Then, set the library up with your keys:
(ql:quickload :oxenfurt)
(setf oxenfurt:*app-id* "dadwadwwada"
oxenfurt:*app-key* "2131831273189addhadwhauidhalidhwa")
Once that's done, you should be able to query the API to your heart's content... within the restrictions imposed by your account's plan of course.
Oxford's API is fairly extensive in what it returns. For instance, if we look at the result for "lisp":
(oxenfurt:lexical-entries (oxenfurt:find-word "lisp"))
; => (#<LEXICAL-ENTRY "lisp" EN> #<LEXICAL-ENTRY "lisp" EN> #<LEXICAL-ENTRY "Lisp" EN>)
(oxenfurt:describe-tree (first *))
; LANGUAGE :EN
; LEXICAL-CATEGORY :NOUN
; TEXT "lisp"
; DERIVATIVES ([DERIVATIVE] 1)
; ID "lisper"
; TEXT "lisper"
; --
; ENTRIES ([ENTRY] 1)
; ETYMOLOGIES ([STRING] 1)
; "Old English wlispian (recorded in āwlyspian), from wlisp (adjective) ‘lisping’, of imitative origin; compare with Dutch lispen and German lispeln"
; GRAMMATICAL-FEATURES ([KEYWORD] 2)
; :NUMBER
; :SINGULAR
; HOMOGRAPH-NUMBER 0
; SENSES ([SENSE] 1)
; DEFINITIONS ([STRING] 1)
; "a speech defect in which s is pronounced like th in thick and z is pronounced like th in this"
; DOMAINS ([KEYWORD] 1)
; :PHONETICS
; EXAMPLES ([EXAMPLE] 1)
; TEXT "he spoke with a slight lisp"
; --
; ID "m_en_gbus0586220.005"
; --
; --
; PRONUNCIATIONS ([PRONUNCIATION] 1)
; DIALECTS ([STRING] 1)
; "British English"
; PHONETIC-NOTATION "IPA"
; PHONETIC-SPELLING "lɪsp"
; --
While Oxford's API documentation does cover everything, it is a bit obtuse to handle. The documentation of this project includes descriptions for every object type and field that is returned, perhaps that will be easier to navigate. If you prefer to explore, the above describe-tree
function should also provide a good tool to figure out where relevant information is stored.
Oxenfurt supports two HTTP clients as backends: Dexador and Drakma. By default, Dexador is used. If you prefer Drakma, load oxenfurt-drakma
instead.
System Information
Definition Index
-
OXENFURT
- ORG.SHIRAKUMO.OXENFURT
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *API*
The base endpoint URL of the Oxford dictionary API.
-
EXTERNAL SPECIAL-VARIABLE *APP-ID*
Your Oxford dictionary API app ID. See https://developer.oxforddictionaries.com/admin/applications
-
EXTERNAL SPECIAL-VARIABLE *APP-KEY*
Your Oxford dictionary API app key. See https://developer.oxforddictionaries.com/admin/applications
-
EXTERNAL CLASS ANTONYM
-
EXTERNAL CLASS CROSS-REFERENCE
-
EXTERNAL CLASS DERIVATIVE
-
EXTERNAL CLASS ENTRY
A word entry in a lexical entry. See ETYMOLOGIES See GRAMMATICAL-FEATURES See HOMOGRAPH-NUMBER See NOTES See PRONUNCIATIONS See SENSES See VARIANT-FORMS
-
EXTERNAL CLASS EXAMPLE
Represents an example usage of a word. See DEFINITIONS See DOMAINS See NOTES See REGIONS See REGISTERS See SENSE-IDS See TEXT See TRANSLATIONS
-
EXTERNAL CLASS FREQUENCY
Container for frequency information of a word or ngram. In the case of an ngram frequency, only the FREQUENCY and the TOKENS fields are guaranteed to be set. See FREQUENCY See NORMALIZED-FREQUENCY See LEMMA See NORMALIZED-LEMMA See TOKENS See LEXICAL-CATEGORY See GRAMMATICAL-FEATURES See COMPONENTS See FIRST-MENTION See TRUE-CASE See WORDFORM
-
EXTERNAL CLASS LANGUAGE-DATASET
Container for information about a language in the API. See REGION See SOURCE See LANGUAGE See TARGET-LANG See BILINGUAL-P
-
EXTERNAL CLASS LEXICAL-ENTRY
An entry of lexical information about a word. This is the primary information container for a word. See GRAMMATICAL-FEATURES See INFLECTION-OF See LANGUAGE See LEXICAL-CATEGORY See TEXT See DERIVATIVE-OF See DERIVATIVES See ENTRIES See NOTES See PRONUNCIATIONS See VARIANT-FORMS See SENTENCES
-
EXTERNAL CLASS MATCH
Represents a match for a word search query. See ID See INFLECTION-ID See MATCH-STRING See MATCH-TYPE See REGION See WORD See SCORE
-
EXTERNAL CLASS NOTE
-
EXTERNAL CLASS PRONUNCIATION
Represents information about the pronunciation of a lexical entry. See AUDIO-FILE See DIALECTS See REGIONS See PHONETIC-NOTATION See PHONETIC-SPELLING
-
EXTERNAL CLASS SENSE
Represents information about a specific sense or meaning of a word. See ANTONYMS See CROSS-REFERENCE-MARKERS See CROSS-REFERENCES See DEFINITIONS See DOMAINS See EXAMPLES See ID See NOTES See PRONUNCIATIONS See REGIONS See REGISTERS See SUBSENSES See SYNONYMS See TRANSLATIONS See VARIANT-FORMS
-
EXTERNAL CLASS SENTENCE
Represents information about an example usage sentence for a word. See DEFINITIONS See DOMAINS See NOTES See REGIONS See REGISTERS See SENSE-IDS See TEXT See TRANSLATIONS
-
EXTERNAL CLASS SYNONYM
-
EXTERNAL CLASS TRANSLATION
-
EXTERNAL CLASS VARIANT-FORM
-
EXTERNAL CLASS WORD
Represents a specific word in the dictionary. See ID See LANGUAGE See LEXICAL-ENTRIES See PRONUNCIATIONS See WORD
-
EXTERNAL CONDITION API-CALL-FAILED
-
EXTERNAL FUNCTION FIND-WORD
- WORD
- &KEY
- (SOURCE-LANG en)
- FILTERS
- SYNONYMS
- ANTONYMS
- TARGET-LANG
- SENTENCES
Retrieve dictionary information for a given word. The parameters FILTERS, SYNONYMS/ANTONYMS, TARGET-LANG, and SENTENCES can only be used one at a time. The API does not support, for instance, sentences for translations into a target language. SYNONYMS, ANTONYMS, and SENTENCES are booleans about whether to return information from the thesaurus or sentence lexicon for the given word. TARGET-LANG specifies a language for which translations from the given SOURCE-LANG of the word should be returned. FILTERS can be a plist of filter keys to lists of filter values. See LIST-FILTERS for the possible combinations. One additional, special filter is possible that cannot be combined with other filters: :REGION. Its value should be a list of available regions to which to constrain word results. See LIST-REGIONS for possible region names. See WORD
-
EXTERNAL FUNCTION INFLECTIONS
- WORD
- &KEY
- (SOURCE-LANG en)
- FILTERS
Check whether a given word exists in the dictionary and retrieve its root form. See WORD
-
EXTERNAL FUNCTION LIST-DOMAINS
- &KEY
- (SOURCE-LANG en)
- TARGET-LANG
Returns a list of possible domains for the given language or translation.
-
EXTERNAL FUNCTION LIST-FILTERS
- &OPTIONAL
- ENDPOINT
Returns a list of possible filters, either for each endpoint, or for a particular one.
-
EXTERNAL FUNCTION LIST-GRAMMATICAL-FEATURES
- &KEY
- (SOURCE-LANG en)
Returns a plist of grammatical features to their possible values for the given language.
-
EXTERNAL FUNCTION LIST-LANGUAGES
- &KEY
- SOURCE-LANG
- TARGET-LANG
Returns a list of LANGUAGE-DATASETs that the API supports. If source-lang is given, only that language is returned. If source- and target-lang are given, the API only succeeds if a translation from source to target is possible. See LANGUAGE-DATASET
-
EXTERNAL FUNCTION LIST-LEXICAL-CATEGORIES
- &KEY
- (LANGUAGE en)
Returns a list of possible lexical categories for the given language or translation.
-
EXTERNAL FUNCTION LIST-REGIONS
- &KEY
- (SOURCE-LANG en)
Returns a plist of known regions to their alternate names for the given language.
-
EXTERNAL FUNCTION LIST-REGISTERS
- &KEY
- (SOURCE-LANG en)
- TARGET-LANG
Returns a list of possible registers for the given language or translation.
-
EXTERNAL FUNCTION LIST-WORDS
- &KEY
- (SOURCE-LANG en)
- FILTERS
- EXCLUDE
- EXCLUDE-SENSES
- EXCLUDE-PRIME-SENSES
- WORD-LENGTH
- PREFIX
- EXACT
- (OFFSET 0)
- (LIMIT 5000)
List words matching certain criteria. FILTERS can be a plist of filter keys to lists of filter values. See LIST-FILTERS for the possible combinations. EXCLUDE is the same as FILTERS, but excludes headwords that contain senses that match the exclude pattern. EXCLUDE-SENSES is the same as EXCLUDE but excludes matching senses for headwords. EXCLUDE-PRIME-SENSES is the same as EXCLUDE but only excludes a headword if the primary sense matches the pattern. WORD-LENGTH can either be an integer or a cons of (LOWER . UPPER) to specify the limits of the word lengths in characters. Both LOWER and UPPER can be NIL if the limit should only go one way. PREFIX filters to words that start with the given string. If EXACT is true, only exact matches are returned. See WORD
-
EXTERNAL FUNCTION NGRAM-FREQUENCY
- TOKENS
- &KEY
- (SOURCE-LANG en)
- (CORPUS nmc)
- CONTAINS
- PUNCTUATION
- (FORMAT OUP)
- FREQUENCY
- DOCUMENT-FREQUENCY
- (OFFSET 0)
- (LIMIT 100)
Returns ngram (multiple word) frequency information. TOKENS should be either a single list of tokens for one ngram, or a list of lists. Each sub-list must be the same length. CORPUS should always by NMC. Other corpora will require special support from the Oxford API. CONTAINS can be a list of tokens. If given, only ngrams which match all of the given tokens. The order of the tokens is irrelevant. If PUNCTUATION is true, ngrams that include punctuation are also included in the results. FORMAT denotes whether the tokens are returned as a list or as a single string. For the list, choose :OUP, for a single string, choose :GOOGLE. FREQUENCY can be a constraint on the allowed frequency. Can be either a single number for an exact match, or a cons for a lower and upper bound. Both bounds can be NIL. DOCUMENT-FREQUENCY can be a constraint on the required frequency of the ngram within documents. Can be either a single number for an exact match, or a cons for a lower and upper bound. Both bounds can be NIL. See FREQUENCY
-
EXTERNAL FUNCTION SEARCH-WORDS
- QUERY
- &KEY
- (SOURCE-LANG en)
- PREFIX
- REGIONS
- TARGET-LANG
- (OFFSET 0)
- (LIMIT 5000)
Search the dictionary for matching words. The query is matched using headwords, lemmatization, and fuzzy matching. If PREFIX is true, only words starting with the query are considered. REGIONS can be a list of regions that the words must match. When TARGET-LANG is given, the translation dictionaries are searched instead. See MATCH
-
EXTERNAL FUNCTION WORD-FREQUENCY
- LEMMA
- &KEY
- (SOURCE-LANG en)
- (CORPUS nmc)
- WORDFORM
- TRUE-CASE
- LEXICAL-CATEGORY
- GRAMMATICAL-FEATURES
- SORT
- FREQUENCY
- NORMALIZED-FREQUENCY
- OFFSET
- LIMIT
Returns word usage frequency information. The LEMMA can either be a single word, or a list of words. In the latter case, the results are split into the smallest possible units. CORPUS should always by NMC. Other corpora will require special support from the Oxford API. WORDFROM can be the written form of the word to look up, preserving the capitalisation. TRUE-CASE can be the written form of the word to look up with normalised case. LEXICAL-CATEGORY can be the lexical category to match for the word to look up. See LIST-LEXICAL-CATEGORIES for available categories. GRAMMATICAL-FEATURES should be a plist of constraints on the grammatical features of the specific word to look up. See LIST-GRAMMATICAL-FEATURES for possible options. SORT should be one or more fields to sort by. Each field can either be the name of the field directly, or a cons where the cdr is one of :ASC or :DSC, denoting the sorting order. The available fields are :WORDFORM :TRUE-CASE :LEMMA :LEXICAL-CATEGORY :FREQUENCY :NORMALIZED-FREQUENCY. FREQUENCY can be a constraint on the allowed frequency. Can be either a single number for an exact match, or a cons for a lower and upper bound. Both bounds can be NIL. NORMALIZED-FREQUENCY can be a constraint on the allowed normalized frequency. Can be either a single number for an exact match, or a cons for a lower and upper bound. Both bounds can be NIL. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION ANTONYMS
- OBJECT
Returns the list of antonyms for the sense. See SENSE
-
EXTERNAL GENERIC-FUNCTION AUDIO-FILE
- OBJECT
Returns the URL of a sound file for the pronunciation. See PRONUNCIATION
-
EXTERNAL GENERIC-FUNCTION BILINGUAL-P
- DATASET
Returns whether the language is bilingual (can be translated). See LANGUAGE-DATASET
-
EXTERNAL GENERIC-FUNCTION BODY
- CONDITION
Returns the HTTP body as a string. See API-CALL-FAILED
-
EXTERNAL GENERIC-FUNCTION COMPONENTS
- OBJECT
Returns the components of a frequency result. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION CROSS-REFERENCE-MARKERS
- OBJECT
Returns a grouping of cross reference notes. See SENSE
-
EXTERNAL GENERIC-FUNCTION CROSS-REFERENCES
- OBJECT
Returns a list of cross-references. See SENSE
-
EXTERNAL GENERIC-FUNCTION DEFINITIONS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION DERIVATIVE-OF
- OBJECT
Returns a list of other words from which this one derives. See LEXICAL-ENTRY
-
EXTERNAL GENERIC-FUNCTION DERIVATIVES
- OBJECT
Returns a list of other words which derive from this one. See LEXICAL-ENTRY
-
EXTERNAL GENERIC-FUNCTION DESCRIBE-TREE
- OBJECT
- &OPTIONAL
- (INDENT)
No documentation provided. -
EXTERNAL GENERIC-FUNCTION DIALECTS
- OBJECT
Returns a list of dialects in which this pronunciation is used. See PRONUNCIATION
-
EXTERNAL GENERIC-FUNCTION DOMAINS
- OBJECT
Returns the name of a subject, discipline, or branch of knowledge related to this object. See ANTONYM See SYNONYM See DERIVATIVE See SENSE See EXAMPLE See TRANSLATION See SENTENCE
-
EXTERNAL GENERIC-FUNCTION ENTRIES
- OBJECT
Returns the list of word entries for this lexical entry. See LEXICAL-ENTRY
-
EXTERNAL GENERIC-FUNCTION ETYMOLOGIES
- OBJECT
Returns a list of strings describing the etymology of the word. See ENTRY
-
EXTERNAL GENERIC-FUNCTION EXAMPLES
- OBJECT
Returns a list of example usages of the word. See SENSE
-
EXTERNAL GENERIC-FUNCTION FIRST-MENTION
- OBJECT
Returns a date formatted as a string representing the time this word was first observed. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION FREQUENCY
- OBJECT
Returns a number representing the usage frequency of the word or ngram. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION GRAMMATICAL-FEATURES
- OBJECT
Returns a plist of applicable grammatical features and their values. See LEXICAL-ENTRY See FREQUENCY See TRANSLATION See ENTRY
-
EXTERNAL GENERIC-FUNCTION HOMOGRAPH-NUMBER
- OBJECT
Identifies the homograph grouping. The last two digits identify different entries of the same homograph. The first one/two digits identify the homograph number. See ENTRY
-
EXTERNAL GENERIC-FUNCTION ID
- OBJECT
The identifier of the word this object is about. See ANTONYM See SYNONYM See NOTE See DERIVATIVE See SENSE See CROSS-REFERENCE See MATCH See WORD
-
EXTERNAL GENERIC-FUNCTION INFLECTION-ID
- OBJECT
The identifier for the specific inflection of the word that was matched. See MATCH
-
EXTERNAL GENERIC-FUNCTION INFLECTION-OF
- OBJECT
Returns a list of word IDs for which this lexical entry is an inflection. See LEXICAL-ENTRY
-
EXTERNAL GENERIC-FUNCTION KIND
- OBJECT
Returns an identifier for the kind of data this object carries. See NOTE See CROSS-REFERENCE
-
EXTERNAL GENERIC-FUNCTION LANGUAGE
- OBJECT
Returns a language identifier for which this object is meant. See ANTONYM See SYNONYM See DERIVATIVE See TRANSLATION See LANGUAGE-DATASET See LEXICAL-ENTRY See WORD
-
EXTERNAL GENERIC-FUNCTION LEMMA
- OBJECT
Returns the lemma for which this frequency applies. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION LEXICAL-CATEGORY
- OBJECT
Returns the linguistic category for which this word qualifies. Generally the category is defined by the syntactic or morphological behaviour of the lexical item in question, such as noun or verb. See FREQUENCY See LEXICAL-ENTRY
-
EXTERNAL GENERIC-FUNCTION LEXICAL-ENTRIES
- OBJECT
Returns a list of lexical entries that this word represents. See WORD
-
EXTERNAL GENERIC-FUNCTION MATCH-STRING
- OBJECT
Returns the string that was used to match. See MATCH
-
EXTERNAL GENERIC-FUNCTION MATCH-TYPE
- OBJECT
Returns the kind of match that occurred. See MATCH
-
EXTERNAL GENERIC-FUNCTION NORMALIZED-FREQUENCY
- OBJECT
Returns the normalized frequency number. This is the frequency per million based on a corpus. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION NORMALIZED-LEMMA
- OBJECT
Returns the normalised form of the lemma. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION NOTES
- OBJECT
Returns a list of notes about this object. See LEXICAL-ENTRY See ENTRY See SENSE See EXAMPLE See TRANSLATION See SENTENCE
-
EXTERNAL GENERIC-FUNCTION PHONETIC-NOTATION
- OBJECT
Returns an identifier for the phonetic notation used to describe the pronunciation. See PRONUNCIATION
-
EXTERNAL GENERIC-FUNCTION PHONETIC-SPELLING
- OBJECT
Returns a string describing how this word should be pronounced in some notation. See PRONUNCIATION
-
EXTERNAL GENERIC-FUNCTION PRONUNCIATIONS
- OBJECT
Returns a list of possible pronunciations for this object. See LEXICAL-ENTRY See ENTRY See WORD See SENSE
-
EXTERNAL GENERIC-FUNCTION REGION
- OBJECT
Returns the name of a region for which this match applies. See MATCH
-
EXTERNAL GENERIC-FUNCTION REGIONS
- OBJECT
Returns a list of region names to which this object applies. See ANTONYM See SYNONYM See PRONUNCIATION See DERIVATIVE See VARIANT-FORM See SENSE See EXAMPLE See TRANSLATION See SENTENCE
-
EXTERNAL GENERIC-FUNCTION REGISTERS
- OBJECT
Returns a list describing the level of language usage, typically with respect to formality. See ANTONYM See SYNONYM See DERIVATIVE See SENSE See EXAMPLE See TRANSLATION See SENTENCE
-
EXTERNAL GENERIC-FUNCTION RESULT
- CONDITION
Returns the HTTP return code for the failed access. See API-CALL-FAILED
-
EXTERNAL GENERIC-FUNCTION SCORE
- OBJECT
Returns a number representing how highly this match scored in the search. See MATCH
-
EXTERNAL GENERIC-FUNCTION SENSE-IDS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION SENSES
- OBJECT
Returns a list of senses for this entry. See ENTRY
-
EXTERNAL GENERIC-FUNCTION SENTENCES
- OBJECT
Returns a list of example usage sentences for this lexical entry. See LEXICAL-ENTRY
-
EXTERNAL GENERIC-FUNCTION SOURCE
- OBJECT
Returns a string description of the source of the dictionary. See LANGUAGE-DATASET
-
EXTERNAL GENERIC-FUNCTION SUBSENSES
- OBJECT
Returns an ordered list of subsenses of a sense. See SENSE
-
EXTERNAL GENERIC-FUNCTION SYNONYMS
- OBJECT
Returns a list of synonyms for the sense. See SENSE
-
EXTERNAL GENERIC-FUNCTION TARGET-LANG
- OBJECT
Returns a descriptor for the target language of a translation dataset. See LANGUAGE-DATASET
-
EXTERNAL GENERIC-FUNCTION TEXT
- OBJECT
Returns a full text representation of the object. See ANTONYM See SYNONYM See LEXICAL-ENTRY See NOTE See DERIVATIVE See VARIANT-FORM See CROSS-REFERENCE See EXAMPLE See TRANSLATION See SENTENCE
-
EXTERNAL GENERIC-FUNCTION TOKENS
- OBJECT
Returns the ngram tokens for the frequency result. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION TRANSLATIONS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION TRUE-CASE
- OBJECT
Returns a given written realisation of an entry, typically in lower case. See FREQUENCY
-
EXTERNAL GENERIC-FUNCTION URL
- CONDITION
Returns the URL that the request tried to access. See API-CALL-FAILED
-
EXTERNAL GENERIC-FUNCTION VARIANT-FORMS
- OBJECT
Returns a list of variant forms for the given object. See LEXICAL-ENTRY See ENTRY See SENSE
-
EXTERNAL GENERIC-FUNCTION WORD
- OBJECT
-
EXTERNAL GENERIC-FUNCTION WORDFORM
- OBJECT
Returns a given written realisation of an entry, preserving case. See FREQUENCY