镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Order things as an Array #4

Closed
Closed

Description

@rawandahmad698

Hello there,

Thank you for the great effort you put in to this, we have an application and we use your script to scrape Google Dictionary Data.

At this moment, we have to loop through word classes e.g noun, verb, adjective in order to get the data, However. these three aren't the only ones, there are nounarchaic, nounBotany, verbFormal and a lot more we don't know..

So, we can't actually get the data, since it's a Dictionary, we have to indicate the word class in our code to get a word data, for example

screenshot at may 28 20-30-18
Language: Swift

Here json2 is a Dictionary on your server, and we use the word class to get the word details, without that, we can't grab the data

So my question is, can you re-order the data?

Something like this?
https://api.myjson.com/bins/bwrf2

Use https://jsonlint.com to view it more precisely

This would be so awesome, can you do this?

Activity

  1. meetDeveloper commented on May 30, 2018

    @meetDeveloper
    Owner

    I will try to solve what you propose here, Sorry for late reply, notification for issues does not come on my mail, it would from now on, Sorry for late response.

  2. meetDeveloper commented on May 30, 2018

    @meetDeveloper
    Owner

    Actually can you tell me, this json2 is object right?? Which you made from json response.

  3. meetDeveloper commented on May 31, 2018

    @meetDeveloper
    Owner

    I think what you need is Mirror, https://developer.apple.com/documentation/swift/mirror. It will help you out. In case you find any trouble you can ask for help.

  4. meetDeveloper commented on May 31, 2018

    @meetDeveloper
    Owner

    You can take a look at this https://makeitnew.io/reflection-in-swift-68a06ba0cf0e. It will help you a lot and definitely solve your problem.

  5. meetDeveloper commented on Jun 1, 2018

    @meetDeveloper
    Owner
  6. meetDeveloper commented on Apr 27, 2020

    @meetDeveloper
    Owner

    I have introduced v2 of API that will solve this problem. Kindly look at the readme.

  7. brunodema commented on Jul 9, 2020

    @brunodema

    Hello @meetDeveloper. First, I'd like to congratulate you on your work this API... it's really amazing. I've been currently working on an app prototype which uses your dictionary API to retrieve word entries. Since I noticed a change in behavior lately, I checked the code here in Github and saw that changes were actually made to it.

    As previously mentioned, this structure change really helped a lot, since I dealt with the same problems when retrieving and parsing the data. The change that I noticed and made me come here is that the phonetic data isn't being retrieved anymore, as it seems. I just would like to confirm that this is the intended behavior, and not some sort of bug/problem of the API.

    Best regards,
    Bruno.

  8. meetDeveloper commented on Jul 9, 2020

    @meetDeveloper
    Owner

    Actually the code here is not the current one, can you exactly tell me your problem, which version are you using and for which language?

  9. brunodema commented on Jul 9, 2020

    @brunodema

    I started working with the version available at https://dictionaryapi.dev/, which I believe is the v1 version. I first started about 2-3 weeks ago, and I remember it retrieved phonetic data (in IPA style) alongside definitions. I'm noticing that the both the v1 and v2 (which I discovered when browsing this page) aren't retrieving phonetic data anymore.

    I just tested this in versions v1 and v2 with the following words (in english): link, love, sky, in, scourge. I explicitly remember that the word 'link' had phonetics associated with it (I had to make changes in my app to accept the different encoding and I used 'link' as reference for it).

  10. meetDeveloper commented on Jul 10, 2020

    @meetDeveloper
    Owner

    @brunodema Thanks for bringing this up, I will fix this as soon as possible. Sorry for the inconvenience.

  11. meetDeveloper commented on Jul 27, 2020

    @meetDeveloper
    Owner

    @brunodema I have fixed this now, could you check once. Sorry for so late reply, life got me little busy. Can you check once and tell me? Again I am sorry for the inconvenience you faced.

  12. meetDeveloper commented on Jul 28, 2020

    @meetDeveloper
    Owner
  13. brunodema commented on Jul 28, 2020

    @brunodema

    Hello @meetDeveloper. Sorry, but I set github notifications as spam due to some annoyances lately.

    I just tested the API with the same 5 words that I previously used and all of them returned the new (at least I assume that you implemented this in the last build) phonetic structure, with both IPA pronunciation and link for audio pronunciation.

    All words retrieved both attributes, except 'love', which had it's IPA text empty (but retrieved the audio link).

    I also took the opportunity to check the retrieved phonetic data for other languages (german and spanish) for the word 'link' (which is valid for these languages as well). I noticed that the retrieved structure for these entries weren't consistent - that is, sometimes the phonetic branch just returned empty; in other cases it retrieved multiple phonetic results (with only the phonetic text). I also noticed it didn't return the audio link for these languages. French entries also showed this inconsistencies for some words.

    I know that these remarks aren't related to my original issue... I just wanted to notify you in case this structure change you adopted was supposed to be universal and not only for the English language. Regardless, thank you very much for taking the time you took to look on these issues :)
    Best regards

    Best regards.

  14. meetDeveloper commented on Jul 28, 2020

    @meetDeveloper
    Owner

    Can you tell me the non english words you tested, I found the problem for the word love. Fixing it, for others I need to know the words you tried, for the word link in spanish the source I am using does not provide the phonetics, for german it does not provide the audio. Are there any other words that contains inconsistencies?. So when audio exists it will be returned. I will soon make sure non english words have audio most of the times. @brunodema

  15. meetDeveloper commented on Jul 28, 2020

    @meetDeveloper
    Owner

    @brunodema I have fixed the phonetics for love.

  16. meetDeveloper commented on Jul 30, 2020

    @meetDeveloper
    Owner
  17. brunodema commented on Jul 30, 2020

    @brunodema

    I just tested 'love' and it retrieved all fields (text/audio).

    I'll mention a few words that I tested for some languages that I know of:

    French:

    • fromage: both empty;
    • aile: both empty;
    • mon: both empty.

    German:

    • Kopf: retrieves a 'phonetic' struct (has IPA text data) and a 'phonetics' struct (the same IPA text from the other struct, no audio);
    • Wurst: retrieves a 'phonetic' struct (has IPA text data) and a 'phonetics' struct (the same IPA text from the other struct, no audio);
    • Kirche: retrieves a 'phonetic' struct (has IPA text data) and a 'phonetics' struct (has two identical 'text' fields with the same IPA text as the other struct, no audio);

    Italian:

    • ala: retrieves a 'phonetic' struct (has IPA text data) and a 'phonetics' struct (the same IPA text from the other struct, no audio);
    • casa: retrieves a 'phonetic' struct (has IPA text data) and a 'phonetics' struct (the same IPA text from the other struct, no audio);
    • giro: retrieves a 'phonetic' struct (has IPA text data) and a 'phonetics' struct (the same IPA text from the other struct, no audio);

    These were all random words that I thought of. I'll try to take a look on the code and help, If I can.

  18. brunodema commented on Jul 31, 2020

    @brunodema

    So, as an exercise to both learn node.js, and to try help you with the API, I cloned this repository and tested it for a while. After a couple of hours digging stuff (due to lack of knowledge hehe), I noticed that dictionary.js contains the v1 implementation of the API, and not the current one - at least that's what I assumed after testing it with the word 'hi', which retrieved me the old data structure, with no 'partOfSpeech'. Am I crazy or does this version contain the current implementation?

  19. meetDeveloper commented on Aug 2, 2020

    @meetDeveloper
    Owner

    @brunodema Actually in repository the code is not present for the v2 implementation. The code uploaded is little different from here.

  20. meetDeveloper commented on Aug 2, 2020

    @meetDeveloper
    Owner

    I am relaying what google is sending me in some cases it just send the text and in some it send the audio also, I am just relaying it back. I checked for all the words you mentioned google is sending me the same data, for most cases it does not send the audio back, but I have a way to have the audio, I will soon update the API to include those.

    Regarding the phonetic struct, I kept that for backward compatibility when I introduced the phonetics. I will soon remove that entirely

  21. brunodema commented on Aug 2, 2020

    @brunodema

    OK, no problem @meetDeveloper . I just wanted to let you know in case something unplanned by the app was happening.

    If you decide to put v2 here or somewhere else, let me know... I'd like to take a look and see if I can help.

  22. meetDeveloper commented on Aug 2, 2020

    @meetDeveloper
    Owner

    @brunodema Thanks, I will soon push the commit to github. :) Is there any particular thing you want to see in the API?

  23. brunodema commented on Aug 2, 2020

    @brunodema

    Nah, nothing in particular at the moment. After reading the current version's code, I could understand the flow of information in the API and from where you take the information, so I believe that v2 probably has the same structure. Once you post it here I'll try to mess with it a little, at least while I have time to do so.

  24. meetDeveloper commented on Aug 4, 2020

    @meetDeveloper
    Owner

    @brunodema Sure, I am closing this ticket then. Will keep you updated when I post v2 API here. 😊

  25. huntit commented on Mar 20, 2021

    @huntit

    @meetDeveloper any success with posting the v2 API ? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions