freeDictionaryAPI icon indicating copy to clipboard operation
freeDictionaryAPI copied to clipboard

word connotation missing

Open stevenlis opened this issue 6 years ago • 7 comments

Hi, buddy.

It seems like the word connotation (e.g., derogatory) is missing.

import requests

url = 'https://googledictionaryapi.eu-gb.mybluemix.net/'

r = requests.get(url, params=dict(define='upstart'))
r.json()
[{'word': 'upstart',
  'phonetic': '/ˈʌpstɑːt/',
  'meaning': {'noun': [{'definition': 'A person who has risen suddenly in rank or importance, especially one who behaves arrogantly.',
     'example': 'the upstarts who dare to challenge the legitimacy of his rule',
     'synonyms': ['parvenu',
      'parvenue',
      'arriviste',
      'nouveau riche',
      'vulgarian']},
    {'definition': 'A series of movements on the parallel or asymmetric bars, by which a gymnast swings to a position in which their body is supported by their arms above the bar, especially at the start of a routine.'}]}}]

image

I checked Oxford Dictionary API and they seems to store the data as registers

{
  "id": "upstart",
  "metadata": {
    "operation": "retrieve",
    "provider": "Oxford University Press",
    "schema": "RetrieveEntry"
  },
  "results": [
    {
      "id": "upstart",
      "language": "en-gb",
      "lexicalEntries": [
        {
          "entries": [
            {
              "senses": [
                {
                  "definitions": [
                    "a person who has risen suddenly in rank or importance, especially one who behaves arrogantly"
                  ],
                  "examples": [
                    {
                      "text": "the upstarts who dare to challenge the legitimacy of his rule"
                    }
                  ],
                  "id": "m_en_gbus1114570.006",
                  "registers": [
                    {
                      "id": "derogatory",
                      "text": "Derogatory"
                    }
                  ],
                  "shortDefinitions": [
                    "person who has risen suddenly in rank"
                  ],
                  "thesaurusLinks": [
                    {
                      "entry_id": "upstart",
                      "sense_id": "t_en_gb0015762.001"
                    }
                  ]
                },
                {
                  "definitions": [
                    "a series of movements on the parallel or asymmetric bars, by which a gymnast swings to a position in which their body is supported by their arms above the bar, especially at the start of a routine."
                  ],
                  "domains": [
                    {
                      "id": "gymnastics",
                      "text": "Gymnastics"
                    }
                  ],
                  "id": "m_en_gbus1114570.010",
                  "shortDefinitions": [
                    "series of movements on parallel or asymmetric bars, by which gymnast swings to position in which their body is supported by their arms above bar"
                  ]
                }
              ]
            }
          ],
          "language": "en-gb",
          "lexicalCategory": {
            "id": "noun",
            "text": "Noun"
          },
          "pronunciations": [
            {
              "audioFile": "http://audio.oxforddictionaries.com/en/mp3/upstart_gb_1.mp3",
              "dialects": [
                "British English"
              ],
              "phoneticNotation": "IPA",
              "phoneticSpelling": "ˈʌpstɑːt"
            }
          ],
          "text": "upstart"
        }
      ],
      "type": "headword",
      "word": "upstart"
    }
  ],
  "word": "upstart"
}

Hopefully, you could find a way to add it. Btw, really like your work!!!

stevenlis avatar Aug 13 '19 00:08 stevenlis

@StevenLi-DS I will fix this this weekend.

meetDeveloper avatar Aug 22 '19 04:08 meetDeveloper

"But ya didn't!"

Felt like the use of that line was necessary. Not meant to be rude, though.

davwheat avatar Sep 22 '19 20:09 davwheat

@davwheat it's actually a little bit complicated. If you wanna an API returns more details. I would suggest you use Oxford dict API directly.

stevenlis avatar Sep 22 '19 21:09 stevenlis

@davwheat Doing it right now.

meetDeveloper avatar Sep 23 '19 13:09 meetDeveloper

Yeah, I realise how rude my message sounds now I think about it...

I will say, thank you so much for this API. It's actually so useful as it's the best free dictionary API I can find.

davwheat avatar Sep 23 '19 15:09 davwheat

@meetDeveloper Hi, man. I dug into it a little bit more after opened this issue. It seems like it could be very complicated especially when a word has many different senses. I kinda like the simplicity of the API now. So feel free to close it if you don't have time to deal with.

stevenlis avatar Sep 23 '19 19:09 stevenlis

@StevenLi-DS will try to find a way to do this. 😊

meetDeveloper avatar Jul 29 '20 21:07 meetDeveloper