Pinyin Tone Tool

November 13th, 2005 by Mark

My apologies to those of you who saw my page broken today. I’ve been working on a javascript tool to add tone marks to pinyin. As many of you have seen, I frequently include tone marks on the pinyin words that I post. Up until now, I’ve been using the tool at http://pinyin.info/unicode/marks3.html. It has been useful, but it requires communication with the server every time you submit words to be encoded. It’s a bit slow for my tastes.

So, I’ve written my own pinyin tone tool. The conversion is done entirely in javascript, so it’s very fast. I hope some of you find it useful. The reason my site was broken is that I tried to put the tool in one of my posts. First off, let me say I’m pretty new to blogging, and that I haven’t been working as a programmer for 6 years. I guess blogger doesn’t let you add javascript to your posts. After trying to put my tool in a post, I tried to put it into my template. THAT’S what broke my page all day. I spent an hour or so trying to figure out how to just upload a normal web page to my blogger account, but couldn’t figure it out. Does anyone here know if blogger will let you just upload an HTML file (which you can link to from your blog)? There are some things, like this tool that should just be their own page, separate from your posting archives. There are a LOT of things which need javascript.

In the end, since I couldn’t figure out how to do it, I just made another “blog” to host my javascript tool. It’s pinyintool.blogger.com. I then made one empty post, since it’s required and proceeded to delete my whole template. Next, I took my pinyin tool and copied the whole thing into my template. As a result, I have a blog where no posts are displayed, no comments are accepted, and no archives are shown. It’s a pretty messed up way to get a page with javascript up on blogger, huh?

Update: I’ve moved my blog on wordpress and no longer focus on my pinyintool page on blogger. Here, you can still comment on features you want or problems with the tone tool. The new tool is here.
Tags: , ,

12 Responses to “Pinyin Tone Tool”

  1. 1 Li Fang Wei Says:

    This post has been removed by the author.

  2. 2 Li Fang Wei Says:

    Hi there!
    I’m Li Fang this is the first time coming to visit your blog and it’s very interesting

    I must come back for sur, I love Chinese history but actually everything about

    China I also have my own so I would like to invite you to visit my site at
    China Empire

    Li Fang Wei

  3. 3 shiao Says:

    great work!

  4. 4 Stephan Says:

    I don’t see any links to download the javascript source. Of course, I can see the actual page source that the browser gets, but that has a lot of additional frames, tables, etc. and it’s not formatted for reading.

    Is there a particular item in the page source that I should look for?

  5. 5 Mark Says:

    Oh, the link was in a comment I made on the Cantonese tone tool. Anyway, if you look in the page source of the pinyin tone tool, you’ll see:

    src=”/scripts/tonetool.js”

    That means you can get the source at http://toshuo.com/scripts/tonetool.js

    Sorry I wasn’t clear enough! :)

  6. 6 Maleedy Says:

    Perhaps you could add a “select all” button to the Pinyin tone tool

  7. 7 Mark Says:

    You mean just to highlight what’s in the textbox? Click anywhere on the text-field and hit “ctrl-a”. Is that the behavior you mean?

  8. 8 Nathan Says:

    Hi Mark - Ive been reading your blog off and on for a couple of years. I wanted to thank you anew for the Pinyin tone tool, I teach Chinese at a high school in New York and I use it almost every day. Thanks!

  9. 9 Mark Says:

    Be sure to check out Muninn’s OS X Pinyin Dashboard Widget based on my online tone tool.

  10. 10 Harley Says:

    hi there..

    Great work, thank you.. .I have a bunch of word files that used the 4-Tone Times New Roman Font where the coding for tones looks like this:

    N[i y]ao mi]anti>ao h>aishi m[if]an?

    Where the tone mark is before the vowel and not after.
    [ = 3rd
    [ = 4th
    > = 2nd
    < = 1st

    Is there a way to modify your script to convert bases on this encoding? or another suggestion?

    Thanks!
    h

  11. 11 Mark Says:

    If you’re familiar with regular expressions, you could use them to modify my script.

    Otherwise, the best thing might just be to search around and see if someone else has already made a tool for that. I wouldn’t be surprised if someone has.

  12. 12 Harley Says:

    Thank you for the reply. Sadly I am not skilled in scripting and during my searches I was unable to find a ready made tool.

    Oh Well.

    Thanks,
    -h

Leave a Reply

Quicktags: