Pinyin converter

I’ve added a small Pinyin converter to the InScript plugin. Pinyin is a method of transliterating Chinese characters into the Roman alphabet. As Chinese is a tonal language, it is important that these tones are included in the pinyin. This is achieved through the use of accents and other marks over certain vowels.

The reason for the converter is that these accents are not easy to type, especially for people with keyboards in an accent-less language (i.e. English). It is possible to enter the characters using some form of character mapping tool, or by entering the HTML code directly, but this is not an intuitive method.

Instead, a popular technique used on many websites is to write the tone as a number. For example, zhong1guo2 would indicate that the ‘o’ in zhong needs the first tone applied, and ‘o’ in guo needs the second. While this is an easy method of entering the text, it does not look good, and is another layer to understanding the tones themselves.

The converter scans text for the tone numbers and replaces them with the correct HTML entities. An example of this is shown below.

Additionally, the ü character can be represented with v0, and tonalized with v1, v2, v3, and v4.

Because InScript is used the conversion can occur anywhere – one block of text, a whole post, or every post.

Currently the conversion is not perfect. Or rather, I am unsure if it is perfect as there may be certain rules for choosing which vowel to tonalize that I don’t know!

A much smaller addition to InScript has been a Google AdSense function. This inserts the code for Google AdSense wherever the tag is placed, and without WordPress mangling it with it’s default formatting. The function will also ensure that you don’t exceed Google’s requirements of a maximum of three adverts per page.

7 thoughts on “Pinyin converter”

  1. comments to “pinyin converter”

    Sounds great! I tried the Chinese localization and it works fine. But I think there’s still something to polish in the Chinese localization. For example, under the “Localizaiton” tab, the text on the button is now “搜寻&#8221…

  2. I am glad to know there are more and more people interesting in Chinese. I hope all of them could visit China and see the different culture and longest civilization. Chinese is hard to learn, but chinese grammar is so so simple. Everyone could make it.

    Learn Chinese, make friends all over the world.

  3. All that talking about chinese language makes me think about learning chinese. 😉

    BTW: THX for the InScript-PlugIn.

  4. DONT DO IT. Im talking chinese at school, and it is so freaking annoying

    by the way, “zhong gou” means china, “zhong gou ren” is chinese

    so you would say

    “ni sher na gou ren” to say were do you live, and “wo sher zhong gou” to say I live in china

    See it sucks

  5. ummm….. garrett….
    apparently your chinese lessons aren’t helping much, because you spelled just about everything wrong. “zhong gou” means “middle dog” and “zhong gou ren” means “people of the middle dog”. the word “sher” doesn’t even exist. plus, i don’t see how your description makes it look like learning chinese sucks………

  6. ummm….. I think you are thinking of zhong guo, garrett, which is middle country, which is China. Zhong gou does indeed middle dog. However, i have no clue why on earth there is an allusion to ‘middle dog’ and so I am inclined to think that it was meant to be zhong guo.

    😀 and by the way Chinese is really fun

  7. Garrett, please show more consideration. At my school, you have to pay to take Chinese and you are complaining about having it for free. I myself am enjoying it a lot.

    zai jian

Leave a Reply

Your email address will not be published. Required fields are marked *