Jump to content


Welcome to Chinese-forums.com


Since 2003 we've been helping people learn Chinese, study and work in China, find Chinese books, movies or music. We are active, friendly and helpful. Check out recent and popular posts on the home page, see the full forums listing or sign up for free now.

Member quotes:

"This forum is a goldmine of information, and I'm so glad it's here!"
"...the kindest, most interesting and most useful help."
"...a godsend!"

Photo
- - - - -

Pinyinput - Type Pinyin with Tone Marks


  • Please log in to reply
327 replies to this topic

#1 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 25 September 2006 - 03:15 PM

Edit: Pinyinput is now hosted on sourceforge. The main project page can be found here: http://pinyinput.sourceforge.net/.

Let's face it, typing pīnyīn with tone marks is a real pain. Sure there are Word macros, and webpages and certain software programs that you can use to type them, but there's not exactly one seamless or consistent method to do it. Also, sometimes you're not using Word, sometimes you're not connected to the internet, and sometimes you don't want to have to boot up another program and copy and paste.

What would be really nice is an IME that instead of outputting Chinese characters, would output pīnyīn with tone marks. Seeing as I've had a bit of spare time recently, I thought I'd put it to good use and develop such an IME. The result is Pinyinput.

Once installed, it works just like a regular Chinese IME. Whenever you want to type some pīnyīn you just switch on the IME and start typing. It works at the system level, and so it will allow you to type pīnyīn with tones in any Windows program, just as easily as you would type Chinese (in fact even easier, because you don't need to select the correct character.

Pinyinput has two main modes of operation. The first mode is "checked" mode, which only accepts (mostly) valid pīnyīn (mostly valid in that it only checks for correct combinations of initials and finals, and not valid/invalid combinations of tones). When typing, if you place a number at the end of a pīnyīn syllable then Pinyinput will automatically convert the correct vowel in the syllable so that it has the appropriate tone e.g. Typing Ni3hao3 will produce the output Nǐhǎo. It knows where the tones are supposed to go so you'll never need to worry about whether the tone was supposed to go over the a or the o, or whatever. It also makes sure you put the apostrophe in the correct place, so the only letters that can follow an apostrophe are a, o and e (píngān and píng'ān are acceptable, pín'gān is not). "Checked" mode also optionally supports "érhuà" so things like pingr2 will be converted to píngr. The "érhuà" support is pretty simplistic, and it will allow any valid pīnyīn syllable which is followed by an r (even though such syllables might not exist in valid pinyin).

The second mode is "unchecked" mode, and in this mode you can type whatever you like, and when you type the numbers 1-4, Pinyinput will put the corresponding tone mark over the preceding letter. By using Unicode's combining diacritic marks, it even supports tone marks over consonants, s̄ò ȳǒù c̀áň w̌řītě āll s̀ōřts̄ ōf čŕāžy̌ s̄tǔff lǐǩě thǐs :mrgreen:

Pinyinput outputs Unicode, and the user can optionally decide whether they want to use combining diacritic marks or individual characters (consonants will always use the combining diacriticals). For users who don't know the difference, individual characters are probably the best way to go, as not all programs handle combining diacriticals correctly.

Another feature is that Pinyinput can support multiple different keyboard layouts. So if you use the Dvorak, the French or some other non-qwerty layout you can still type pīnyīn using the keyboard layout that you are familiar with. Pinyinput detects what other keyboard layouts you have installed, and allows you to choose which layout you prefer in its configuration dialog. Also, regardless of the layout used, the letter v of that layout is always automatically converted to ü.

I'm releasing the program free of charge, but if you find it useful, I won't stop you from making donations :-)

Although Pinyinput is reasonably stable, it most likely still contains a few bugs (some of which have now been fixed over the course of the last few months). Anyway, it comes with no warranty of any sort and while it shouldn't cause any problems on your computer, if your hard-drive dies after installing this, it wasn't my fault :-)

Pinyinput works on Windown NT/XP/Vista/7/8 for both 32 and 64bit systems. There is only a single installer, which will detect whether your version of Windows is 32 or 64bit and install the correct binaries as appropriate.


Edit: User peekay has produced a Mac equivalent, MacPinyin

Once installation is completed, you activate it the same way you would any other Chinese input method. So, go to the language toolbar and select Chinese. Then click on the second icon which will bring up a list of all input methods you have installed for Chinese. One of them will be Pinyinput. Once you've selected this, then Pinyinput will be used for all input in that application, and depending on the application, you will either get a little pop-up box, or the text will appear inline as you type.

You can also use the standard keyboard shortcuts to activate it, so Alt-Shift will cycle through the languages available on the language toolbar (English, Chinese etc), and then once you're on Chinese you can use Ctrl-Shift to cycle through the different Chinese input methods available (MS Pinyin, Wubi, Pinyinput etc).

I've attached a couple of images below so you can see what I mean.

Edit: Updated installer to fix a small problem.

Edit 2006/11/9: Updated installer to output more accurate error messages (with thanks to atitarev for testing/debugging), and fixed random bug with checked input.

Edit 2006/12/26: Fixed bug with OpenOffice and keyboard repeat codes.

Edit 2007/5/26: Fixed bug with function keys not working.

Edit 2007/6/01: Fixed bug with ü when typing in checked mode.

Edit 2010/11/20: Released 64-bit compatible version, and fixed a bunch of bugs. Pinyinput is now hosted on sourceforge.

Download link.

ADMIN NOTE: ATTENTION VISITORS FROM WIKIPEDIA AND ELSEWHERE!

Don't just download the fantastic Pinyinput and disappear! Download it and then register on here to say thanks to Imron. And then participate in our many fascinating discussions! All this could be yours!

Attached Images

  • typing.JPG
  • languagebar1.JPG
  • languagebar2.JPG

Edited by imron, 03 December 2012 - 12:26 PM.
New release of pinyinput

  • 4

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 Mandarin in Beijing Tailored, intensive classes from professional teachers, for real results. Business Chinese
Learn Chinese in China Learn to speak Chinese 1MonthChinese.com -Mandarin School in China.
Learn Chinese Characters Learn 2289 Chinese Characters in 90 Days with a Unique Flash Card System.
Popup Chinese Translator Understand Chinese inside any Windows application, website or PDF.

#2 Pravit

Pravit
  • Members
  • 378 posts

Posted 25 September 2006 - 04:02 PM

Cool stuff! I noticed a few things:

1. The installation program hung and bringing up task manager revealed that it was taking up 99% of system resources. After killing it and running it again, though, it said that Pinyinput was already installed(which it was).

2. Not a problem, but for anyone who has no experience with other IMEs like me, you can access Pinyinput by clicking on the MSPY icon in your language bar and selecting it from the list.

3. I noticed that in unchecked input, if you delete a letter with a tone mark over it, the tone mark will somehow remain "floating" and attach itself to other letters you type underneath it. Not sure exactly how to reproduce it.

Great tool though and very useful! Thanks for releasing this free!
  • 1

#3 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 25 September 2006 - 04:12 PM

It's strange that the installer would hang. There are no loops in the code, so I can't imagine what's causing it. It pretty much just copies the file, sets a few registry settings and exits. What version of Windows are you running?

Also, regarding the floating tones, what program were you typing in? If you do manage to figure out a way to reproduce it let me know.
  • 0

#4 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 25 September 2006 - 05:26 PM

Well, I just tested it out on a couple of other machines, the first one had no problem, but the second one produced the same hang in the installer. It seemed to be being caused because I was loading and activating the IME in the installer, and activating it there seemed to cause problems. So now it doesn't do that, and it shouldn't hang - at least it no longer hangs on the other machine I tested it on. If you wouldn't mind downloading it again and trying to see if it fixed the problem, it'd be much appreciated.
  • 0

#5 lalibela

lalibela
  • Members
  • 17 posts

Posted 27 September 2006 - 04:19 PM

Hi there!!
This sounds so great!!! i´m afraid i´m a complete beginner with computer´s stuff (although i´ve been using it for 15 years now) and don´t know how to work with it. It said "installation completed" but I can´t make it work!! Could you please explain all the steps I have to follow in a very basic way?
Thanks for your help guys,
Lalibela
  • 0

#6 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 27 September 2006 - 08:25 PM

-moved this post and pictures to the first post-
  • 0

#7 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 27 September 2006 - 08:28 PM

One other thing, if you can't see the second icon displayed on the language bar, you can right click on the first icon, and one of the options should be something like "Adjust language bar position". This will make sure that all icons on the language bar are fully displayed.
  • 0

#8 UnbelieverOz

UnbelieverOz
  • Members
  • 1 posts
  • Location:Adelaide, South Australia

Posted 02 October 2006 - 09:54 AM

First post - thanks for that tool, very handy. It installed fine for me (XP Home) and works fine with the little bit of playing I've done so far. I'm just getting back into learning Chinese and this will help a lot making up my own notes.

Cheers!:D
  • 0

#9 atitarev

atitarev
  • Members
  • 2,024 posts
  • Location:Melbourne, Australia (澳大利亚·墨尔本)

Posted 02 October 2006 - 11:07 AM

Hi Imron,

I tried to install your Pinyin Input on my work computer (XP Pro) and got a message - "You need admininstrator priviliges to install Pinyininput". I know I do on that PC - can change registry and can install other IME's, etc. Do you think, you can address this issue?

Thanks for your wonderful work,
Regards,
Anatoli
  • 0

#10 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 02 October 2006 - 12:29 PM

There are two things Pinyinput requires administrator privileges for. 1) write access to the windows system folder (usually c:windowssystem32), and 2) write access to the HKEY_LOCAL_MACHINE registry subkeys (which usually have a different level of access to the HKEY_CURRENT_USER subkeys).

If you are certain you have access to these things, then you can try manually installing it using the files I've attached to this post. There are 2 files in the zip, one is pinyinput.ime which is the actual IME, and the other is an installer that will copy the file to the system folder and also update the registry so that pinyinput will appear in the text services and input methods dialog box.

To use them, unzip the files to a temporary directory, and run "installer.exe". It's best if you run this from the command line, so you can see the output (this will let you know if there were any errors). The installer doesn't check for administrator privileges and just assumes it can copy and setup everything. It also doesn't setup the uninstaller, so if you want to uninstall Pinyinput, you will have to delete the ime file and remove the relevant registry entries manually. Anyway, if everything was ok, you should see something like this:

-------------- Installing Pinyinput ---------------
Copying pinyinput.ime to c:windowssystem32pinyinput.ime...OK
Installing Pinyinput...OK

---------------------- Done -----------------------

(if there were any problems, it will say Error instead of OK).

Once that's done, you now need to set Pinyinput as one of the available Input Methods, so pull up the text services dialog box (the easiest way is to right-click on the language bar and choose settings).

In this dialog box, click add, and then choose Chinese (PRC) for the input language. Pinyinput should now be one of the choices displayed in the keyboard layout/input method combo box. Select it, and click ok, and Pinyinput should now be available for use in the language bar.

Let me know if you can install it using this method.

Edit:Removed zip file, as it contained an older version of pinyinput, without any of the recent bug-fixes.
  • 1

#11 atitarev

atitarev
  • Members
  • 2,024 posts
  • Location:Melbourne, Australia (澳大利亚·墨尔本)

Posted 02 October 2006 - 02:01 PM

xièxie nǐ. gōngzuò le hěn hào! :) wǒ juéde nǐde shūrùfǎ hěn búcuò a.

Thanks a lot. I had no problem with manual install, it proves I have Administrator rights. Maybe the way the application does it causes this error (is it using the same account?). In case you have some issues with some other users, you might want to check.

I see a lot of benefit from the tool for Chinese learners, teachers and forera :)

Cheers,
Anatoli
  • 0

#12 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 02 October 2006 - 04:28 PM

It makes a pretty standard Win32 API call for checking privileges - NetUserGetInfo(), which returns privileges as either USER_PRIV_ADMIN, USER_PRIV_USER or USER_PRIV_GUEST. I'm calling it to get the user info of the currently logged in user, on the local machine. Out of curiosity, can you confirm whether or not your work account is an actual administrator account, or just a power user account? (This can be done in Control Panel->Administrative Tools->Computer Management, and then checking to see which user groups your user name is part of). I wonder if this is responsible for causing the false-negative.

In any case, I'll change the installer to check instead specifically for write access to the system dir, and registry, rather than just doing a blanket check for admin rights.

Anyway, I'm glad you like it. Be sure to tell your friends :-)
  • 0

#13 atitarev

atitarev
  • Members
  • 2,024 posts
  • Location:Melbourne, Australia (澳大利亚·墨尔本)

Posted 03 October 2006 - 07:04 AM

We are using Novell system, which hides a lot of information (I think) because I couldn't find my user ID in the list of users (under Local Users and Groups -> Users folder). I haven't installed it at home but I am sure I won't have this security problem :)

If you change the installer and reattach it to your first post, let me know if you want me to test it.

Be sure to tell your friends :-)

Yes, of course :)
  • 0

#14 wushijiao

wushijiao
  • Members
  • 2,299 posts
  • Location:Hong Kong

Posted 03 October 2006 - 12:46 PM

Very useful! Thanks imron!

I'd be great to get the various local governments in China to use this software when they put the pīnyīn on the street signs. It'd make it a lot easier to remember the tones of strange characters.
  • 0

#15 geek_frappa

geek_frappa
  • Members
  • 1,257 posts

Posted 04 October 2006 - 02:26 AM

Anyway, I'm glad you like it. Be sure to tell your friends :-)


Friends? I'm telling everyone. :o)
  • 0

#16 Hero Doug

Hero Doug
  • Members
  • 371 posts

Posted 28 October 2006 - 08:27 PM

I'm a bit late but this is great software. I like the integration a lot, much better then Nj Star.

Thanks

P.S. A quick note on the forced rule based typing (not sure what you called it).

When I want to type biān I have to check the little check mark to deactivate the forced check on spelling and tones. With the check mark active I can only type b, I can't input the ian.

Also, I noticed that when I enter a tone it get's entered on the last letter typed. If you ever do an upgrade a good idea would be to have Pinyinput place the tone over the correct character automatically. Should be easy since it just follows a,e,i,o,u sequentially.
  • 0

#17 stephanhodges

stephanhodges
  • Members
  • 350 posts
  • Chinese:Middle Intermediate
  • Location:Minnesota, USA

Posted 08 November 2006 - 09:05 PM

and also allow a zero to remove the tone mark again! (Sorry if it already does this. Haven't checked lately)
  • 0

#18 dalaowai

dalaowai
  • Members
  • 234 posts

Posted 08 November 2006 - 09:19 PM

One of my coworkers just arrived in China from England and she's been studying hard. This morning, she asked me if there was such a thing as a pinyin keyboard, to which I replied, "nothing convenient".

Strange coincidence I read this post today. I'll be able to share with her tomorrow and her Mandarin will improve thanks to you. Greatly appreciated imron!
  • 0

#19 Shadowdh

Shadowdh
  • Members
  • 1,359 posts
  • Location:英国,伦敦(差不多)

Posted 09 November 2006 - 06:03 AM

Late to the party as ever... many thanks for a useful tool...
  • 0

#20 imron

imron

    Admin

  • Administrators
  • 8,741 posts
  • Location:国外

Posted 09 November 2006 - 07:43 AM

Hero Doug> There was a bug with the checked version where it would randomly refuse correct input. I've fixed this now, and will upload a new version shortly.

Regarding the placement of the tone, in checked mode (the one with the tick) the tone should already be placed automatically on the correct letter, so typing xiang3 will output xiǎng, and dei3 will output děi. In unchecked mode the tone is placed on the last letter typed, so xiang3 will output xianǧ, and dei3 will output deǐ.

Also, tone placement doesn't follow the vowels sequentially (compare duī and diū). A good description of the rules for tone placement can be found here. This is the algorithm pinyinput uses for placing tone marks.

StephanHodges> You can press backspace to delete the tone. Tones are deleted before letters.
  • 0


Welcome, stranger

If you like what you see, we have about 20,000 other topics to enjoy. Why not...
• See what's new and popular.
• View the full list of forums.
• Use the Google site search button at top right.
• Or just go ahead and register to post and hide ads.


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users