Dear API forum users,

Please note that our site is undergoing maintenance.
We apologize for any inconvenience, we should be back fully operational soon.

Please refrain from posting as new posts may not be saved during this period.

The Oxford dictionaries API team

Chinese bilingual - possible to query by pinyin?

The Chinese-English-Chinese bilingual data is now included in the API, and searching for translations/entries based on English words and Chinese characters works fine.
However, for a Chinese dictionary, it would be very important to be able to search based on pinyin as well. At the moment, this doesn't seem to work.

For example:
Searching for 花 works. But searching for "hua" or "huā" does not work.

When searching for "hua", I would expect to get ""huā", "huà", "huá", "huàbái", "huābàn", etc. When searching for "huā", I would expect to get "huā", "huābái", "huābāo", "huāchá", etc.

Tagged:

Answers

  • TaisFukushimaTaisFukushima Member, Administrator, Moderator admin

    Hello @esoderblom

    At the moment, we process the diacritics in the headword in the same way for all the languages, so we don't distinct between tonal a no tonal language. however, we understand your point and have raised a ticket to work on this.

    Thanks for flagging this up!

  • Hello @TaisFukushima! Thank you for the answer.

    However, I think you might have misunderstood the biggest problem I have. Currently, you cannot query the Chinese-English dictionary based on pinyin at all.

    So it's not a question of "it would be nice if 'hua' and 'huā' were handled differently". Instead, searching with "hua" or "huā" doesn't return anything at all. For a Chinese-English dictionary, I think being able to search by pinyin is vital.

    Or, if there is a way to search based on pinyin, please let me know how - at least the normal /translations endpoint doesn't return anything.

    So this works (using the character 花):
    https://od-api.oxforddictionaries.com/api/v2/translations/zh/en/花?strictMatch=false

    But this doesn't (using "hua" which is the pinyin for that character):
    https://od-api.oxforddictionaries.com/api/v2/translations/zh/en/hua?strictMatch=false

  • TaisFukushimaTaisFukushima Member, Administrator, Moderator admin

    Hi @esoderblom

    My apologies, I now realise the first reply was not very clear.

    Yes, you are correct in that it is not possible to run a pinyin search at all at the moment. And this is because of the way we are currently able to process diacritics. My colleagues are looking into the possibilities of developing the ability to return results that recognise the tonal variations of a word, which would make searches based on pinyin possible. I can't promise that this will be possible, but we are certainly looking into it!

  • seijik42seijik42 Member
    edited August 26

    @esoderblom

    The Chinese-English-Chinese bilingual data is now included in the API, and searching for translations/entries based on English words and Chinese characters works fine.

    Can you tell me how you could get entries of Chinese words in English?
    I'm trying query like this

    https://od-api.oxforddictionaries.com/api/v2/entries/zh/子

    But response is following error. It doesn't seem Oxford API supports Chinese..

    "error": "zh dictionary is not available"
    

    Best,
    Seiji

  • esoderblomesoderblom Member

    Hi @seijik42!
    Since the Chinese data set is bilingual you need to use the translations endpoint to get translations of a Chinese word in English. So this should work:
    https://od-api.oxforddictionaries.com/api/v2/translations/zh/en/子

    Hope this helps!

  • seijik42seijik42 Member

    @esoderblom
    Thank you for your response.
    I see. I gonna try translations API too! I also figured out that PROTOTYPE plan supports only limited set of languages. It was not obvious to me.

Sign In or Register to comment.