action oxforddictionaries_get_stats_frequency_words_source_lang { label: "Retrieve a list of frequencies of a word/words derived from a corpus." description: "This endpoint provides a list of frequencies for a given word or words. Unlike the /word/ endpoint, the results are split into the smallest units.

To exclude a specific value, prepend it with the minus sign ('-'). For example, to get frequencies of the lemma 'happy' but exclude superlative forms (i.e., happiest) you could use options 'lemma=happy;grammaticalFeatures=-degreeType:superlative'.

Parameters can be provided in PATH, GET or POST (form or json). The parameters in PATH are overridden by parameters in GET, POST and json (in that order). In PATH, individual options are separated by semicolon and values are separated by commas (where multiple values can be used).

The parameters wordform/trueCase/lemma/lexicalCategory also exist in a plural form, taking a lists of items. Examples:\n* PATH: /wordforms=happy,happier,happiest\n* GET: /?wordforms=happy&wordforms=happier&wordforms=happiest\n* POST (json):\n```javascript\n {\n \"wordforms\": [\"happy\", \"happier\", \"happiest\"]\n }\n```\nA mor complex example of retrieving frequencies of multiple lemmas:\n```\n {\n \"lemmas\": [\"happy\", \"content\", \"cheerful\", \"cheery\", \"merry\", \"joyful\", \"ecstatic\"],\n \"grammaticalFeatures\": {\n \"adjectiveFunctionType\": \"predicative\"\n },\n \"lexicalCategory\": \"adjective\",\n \"sort\": [\"lemma\", \"-frequency\"]\n }\n```\nSome queries with \"collate\" or \"sort\" can exceed the 30s timeout, in which case the API will return an error message with status code 503. You mitigate this by providing additional restrictions such as \"minFrequency\" and \"maxFrequency\".

You can use the parameters \"offset\" and \"limit\" to paginate through large result sets. For convenience, the HTTP header \"Link\" is set on the response to provide links to \"first\", \"self\", \"next\", \"prev\" and \"last\" pages of results (depending on the context). For example, if the result set contains 50 results and the parameter \"limit\" is set to 25, the Links header will contain an URL for the first 25 results and the next 25 results.

Some libraries such as python's `requests` can parse the header automatically and offer a convenient way of iterating through the results. For example:\n```python def get_all_results(url):\n while url:\n r = requests.get(url)\n r.raise_for_status()\n for item in r.json()['results']:\n yield item\n url = r.links.get('next', {}).get('url')\n```\n" provider: oxforddictionaries method: GET path: "/stats/frequency/words/{source_lang}/" encoding: json input: { type: "object" properties: { collate: { type: "string" } corpus: { type: "string" } grammaticalFeatures: { type: "string" } lemma: { type: "string" } lexicalCategory: { type: "string" } limit: { type: "integer" format: "int64" } maxFrequency: { type: "integer" format: "int64" } maxNormalizedFrequency: { type: "number" format: "float" } minFrequency: { type: "integer" format: "int64" } minNormalizedFrequency: { type: "number" format: "float" } offset: { type: "integer" format: "int64" } sort: { type: "string" } source_lang: { type: "string" } trueCase: { type: "string" } wordform: { type: "string" } } required: ["source_lang"] additionalProperties: false } output: { type: "object" description: "Schema for lexi-stats results for a word/trueCase/lemma/lexicalCategory returned as a list of frequencies per wordform-trueCase-lemma-lexicalCategory entry." properties: { metadata: { type: "object" description: "Additional Information provided by OUP" } results: { type: "array" description: "A list of found words along with their frequencies" items: { type: "object" description: "Statistical information about a word" required: ["wordform", "trueCase", "lemma", "lexicalCategory", "frequency", "normalizedFrequency"] properties: { frequency: { type: "integer" description: "The number of times a word appears in the entire corpus" } lemma: { type: "string" description: "A lemma of the word." } lexicalCategory: { type: "string" description: "A lexical category such as 'verb' or 'noun'" } normalizedFrequency: { type: "integer" description: "The number of times a word appears on average in 1 million words" } trueCase: { type: "string" description: "A given written realisation of a an entry (e.g., \"lay\") usually lower case" } wordform: { type: "string" description: "A given written realisation of a an entry (e.g., \"lay\") preserving case" } } } } } } }