Retrieving the Definition of any word...including this one?

As far as I know there isn't just one API call to retrieve the definition of any given word.

Currently I am using this API call:
https://od-api.oxforddictionaries.com/api/v1/inflections/en/AnyGivenWord

This call simply returns the value of the actual word you need to look up so if the word is pluralised, prefixed, noun, verb etc it returns the route word:

RouteWord = APIResult.results[0].lexicalentries[0].inflectionof[0].text

You can then use the this API to get the definition:
https://od-api.oxforddictionaries.com/api/v1/entries/en/RouteWord

However, this sequence of events doesn't work for the word 'tatters'?

I should point out that I really don't care what type of word it is, how its pronounced or anything I just want the definition of any English word that I request so if you do know of one API call that does that then let me know but if not then I give you the problem above!

Comments

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @Wordwheeze,

    Further to our email correspondence, on this issue, doing a call to the 'search' endpoint ought to resolve most issues.

    For the benefit of other forum browsers, 'tatters' is a word which, in its noun form, is almost universally used as a plural, which is why the headword form in our data is plural but the lemmatron endpoint returns the singular form 'tatter' which, if used for an entry call, will result in a 404 error.

    This is actually the polar opposite of another issue raised on the forum. I will have to talk to the developers to see whether this problem is the result of a fix implemented to correct the older issue or whether there is something else going on because the whole point of the lemmatron is to direct users to the correct base form to be able to perform an entry call. Whatever the cause, I suspect that the impact is actually limited to some very specific circumstances.

  • I found another word that caused me issues today:

    feet

    A simple but uncanny word where as usual I just want the definition:

    I use the Inflection call to get the word I need to look up:
    https://od-api.oxforddictionaries.com/api/v1/inflections/en/feet

    Returns word: feet

    I use the entries call to get the definition:
    https://od-api.oxforddictionaries.com/api/v1/entries/en/feet

    There is a response but no definition returned.

    I then used sentences call to see if I can get a sentence with feet in:
    https://od-api.oxforddictionaries.com/api/v1/entries/en/feet/sentences

    Returns no message!

    I then used synonyms call to see if I can get a list of similar words to feet:
    https://od-api.oxforddictionaries.com/api/v1/entries/en/feet/synonyms

    Returns no message!

    So I go back to the Definition call which does actually return a message just no definition and it has a sort of definition in a CrossReferenceMarkers field:

    results[0].lexicalentries[0].entries[0].senses[0].crossreferencemarkers[0]

    So my logic now is:

    Get the inflection of the word
    
            Get the definition of the word returned
    
                     Get the definition from result using definition   
                     Else Get the definition using crossreferencemarkers  (required for word: feet)
    
           else use sentences call to get some sort of result (required for word: tatters)
    

    I wonder if that logic will always return a definition of sorts for any word entered!

    Cheers
    Brent

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @Wordwheeze,

    You may be surprised to find that not all entries have definitions in our dictionary data. The overwhelming majority do but, some, for example 'feet', contain only a cross-reference to a related more complete entry, in this case 'foot'. This is done to increase the success rate of searches (usually, it is preferable to find a cross-reference to not finding anything at all).

    There are several scenarios where this may happen, for example irregular forms ('feet', 'went', 'geese'), abbreviated/expanded forms ('application programming interface', 'deoxyribonucleic acid', 'BBC'), common non-standard spellings ('dawg', 'telly'). In such cases, the API won't (cannot) return a definition call because there is no definition content to be found. You can find the linked entry in the crossReferences section of the data.

    Note that these are sense-level distinctions so it is possible to have entries with some definition senses and at least one cross-reference (e.g. 'term', as discussed here).

    All of this stuff will also apply to the other specific sections of content you might search for (antonyms, synonyms, example sentences, etc.).

  • Actually I have been surprised to find this but I guess my understanding of a dictionary is probably incorrect. Whenever I grab a dictionary at home and look up a word it's for two basic reasons - to check the spelling or to see what the definition is.

    Still you are correct as I got my children's dictionary down and looked up the word feet and the definition is "see foot!" - which was slightly annoying as it meets the API's expectations.

    However, I then got my wife's heavy duty Oxford dictionary and looked up feet and the definition is: "Plural form of foot" which is what I would have expected from the API :smile:

    I'm not complaining - but I am really - it's really handy to be able to tap into the API (and for me it's free) and know that the stuff I'm getting back should be authenticated by a recognised body. I just wish I didn't have to make so many calls to get something that I thought was going to be a given but I guess the English language is complicated!

    Thanks for the response

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin
    edited November 2017

    Again, you may be surprised to find that "plural form of foot" is exactly what an 'entries' call spits out. The "plural form of" bit is considered a label for the cross-reference proper, "foot". That isn't exactly the way the JSON interpretation of the data works ([ { "crossReferenceMarkers": [ "plural form of foot" ], "crossReferences": [ { "id": "foot", "text": "foot", "type": "see also" } ], "id": "m_en_gbus0355380.005" } ]), but hopefully you get the picture. Strictly speaking "plural form of foot" is not a definition because it only tells you about the grammar, not the meaning - you need to go to the "foot" entry to get the meaning.

    You may be interested to learn that we are aware that this kind of output, while perfectly acceptable in print (to save space), is a sub-optimal user experience in a digital environment. Just today, I've been involved in an email discussion about how we tackle this exact issue going forward (still very early stages, don't expect any great leaps forward any time soon) so it is being worked on.

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin
  • :D Well as I say I appreciate being able to use the API and it may not work the way I expect it to but it does work. Take it easy Amos and I look forward to future developments.

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin
    edited November 2017

    Hi @Wordwheeze,

    Nothing everything works quite as you might expect! ;)

    ...but we are doing our best to make things as straightforward as possible. Unfortunately, in the data there remain some legacies from the days of print which are slowly but surely being ironed out. Actual data errors are now extremely rare, although it was only a couple of years ago, doing some other work, that I spotted there were about half a dozen different ways in which the word 'abbreviation' had been abbreviated (which as since been corrected, of course). However, we are now having to look seriously at how well what we have works for digital platforms.

  • You are so right and actually for this word, I actually need direction. How do I get the definition of 'selenious'

    Can you give me the process you would go through to determine which API I would use if someone asked you for the definition?

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @Wordwheeze,

    'Selenious' looks like a data problem.

    Basically, many entries used to have derivatives classed as subentries of the base word e.g. 'selenium' had the derivatives 'selenide', selenious', and 'selenic'. As part of the process to get the data ready for the API, all of these subentries were promoted to full entries to make them discoverable in searches; where there was no other content, there ought to be a pointer back to the original entry, e.g. in the 'selenide' entry, you find "derivativeOf": [ { "id": "selenium", "text": "selenium" } ] but this does not appear to have happened to 'selenic' or selenious'. I'll have to pass this onto our developers.

  • Okay thanks and that makes sense...when I had the issue with the word 'feet' the 'crossReferenceMarker' in the result message gave me a route to follow but I couldn't work it out from 'selenious'.

    I have altered my application so that if this happens again then I will use a default definition and will email you any other words (if there are any) that is discovered by my app.

    Again appreciate the response and help!

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @Wordwheeze,

    We were just looking at this today and couldn't recreate the problem: it looks like a recent data update fixed the issue before we got around to looking into it properly. Hopefully it's all working well now, but let us know if you run into any further difficulties.

Sign In or Register to comment.