Jump to content
Learn Chinese in China

How do you convert Chinese characters into pinyin with tones?


Recommended Posts

Site Sponsors:
Pleco for iPhone / Android iPhone & Android Chinese dictionary: camera & hand- writing input, flashcards, audio.
Study Chinese in Kunming 1-1 classes, qualified teachers and unique teaching methods in the Spring City.
Learn Chinese Characters Learn 2289 Chinese Characters in 90 Days with a Unique Flash Card System.
Hacking Chinese Tips and strategies for how to learn Chinese more efficiently
Popup Chinese Translator Understand Chinese inside any Windows application, website or PDF.
Chinese Grammar Wiki All Chinese grammar, organised by level, all in one place.

  • 2 years later...

I needed to understand the algorithm. It is fairly easy to convert most of the characters using a dictionary. For example 她为什么要借钱? translated to pinyin should be tā wèishénme yào jièqián?

But in my code because I have more than one entry for 要 in the dictionary my translation of 要 is yao1(which is wrong). The problem is to know which translation is correct?

Does anyone know how that works? Or perhaps there is open source software that I can lookup?

Thanks in advance

Link to post
Share on other sites

You need to look at the surrounding context. If the following character is 求, your 要 will likely be yāo. Adsotrans includes rules for this, but I suspect it's the kind of thing where you always need a human eye.

Link to post
Share on other sites

Join the conversation

You can post now and select your username and password later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Click here to reply. Select text to quote.

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...