Jump to content
Chinese-Forums
  • Sign Up

Convert file with pinyin tone marks to pinyin tone numbers


jbradfor

Recommended Posts

I have a file with pinyin tone marks that I want to convert to pinyin tone numbers, e.g. hǎo -> hao3. While this seems so basic, I have found nothing that does this. I've found several million programs that do the opposite, from numbers to tones (e.g. hao3 -> hǎo), and another million or so that convert from characters to pinyin. But nothing from marks to numbers. :help

Anyone know of such a program?

[Yes, I found this thread: http://www.chinese-forums.com/index.php?/topic/5954-converting-pinyin-tone-marks-to-numbers . However, both answers are wrong, in that they convert from numbers to tones.]

Link to comment
Share on other sites

I don't know about the macro referred to in that topic, but the converter at MandarinTools can definitely convert pinyin with tone marks to pinyin with tone numbers. Just go here, select Pinyin Converter and then use the drop-down menus. It shouldn't be that difficult to modify the Word macro, either, I think, but this is perhaps more straightforward :)

Link to comment
Share on other sites

Thanks Daan. I was looking for one that works on files. The file is pretty big (1400+ lines), but to my surprise I could cut-and-paste it just fine! [There was another problem that it didn't recognize whatever character the file used as the 3rd tone for all three vowels, but some cut-and-paste fixed that.]

@Xiwang: that was exactly what I wanted this for :D

Link to comment
Share on other sites

Great, thanks - I was just looking for this sort of thing today.

Shame it doesn't also convert the neutral tone to a 5, but I suppose that could lead to all sorts of other problems...

EDIT - hmmm, its not perfect. "bàngōngshì" becomes "bang4o1ngshi4"

Link to comment
Share on other sites

  • 1 year later...
  • 12 years later...

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...