Jump to content
Chinese-Forums
  • Sign Up

How do you convert Chinese characters into pinyin with tones?


twilightwind

Recommended Posts

  • 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 comment
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 comment
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.

Guest
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...