Popular Post imron Posted September 25, 2006 at 07:15 AM Popular Post Report Posted September 25, 2006 at 07:15 AM (edited) Edit: Pinyinput is now hosted on sourceforge. The main project page can be found here: http://www.pinyinput.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 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, MacPinyinOnce 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! Edited February 4, 2015 at 01:12 PM by imron New release of pinyinput 6 Quote
Pravit Posted September 25, 2006 at 08:02 AM Report Posted September 25, 2006 at 08:02 AM 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 Quote
imron Posted September 25, 2006 at 08:12 AM Author Report Posted September 25, 2006 at 08:12 AM 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. Quote
imron Posted September 25, 2006 at 09:26 AM Author Report Posted September 25, 2006 at 09:26 AM 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. Quote
lalibela Posted September 27, 2006 at 08:19 AM Report Posted September 27, 2006 at 08:19 AM 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 Quote
imron Posted September 27, 2006 at 12:25 PM Author Report Posted September 27, 2006 at 12:25 PM -moved this post and pictures to the first post- Quote
imron Posted September 27, 2006 at 12:28 PM Author Report Posted September 27, 2006 at 12: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. Quote
UnbelieverOz Posted October 2, 2006 at 01:54 AM Report Posted October 2, 2006 at 01: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! Quote
atitarev Posted October 2, 2006 at 03:07 AM Report Posted October 2, 2006 at 03: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 Quote
imron Posted October 2, 2006 at 04:29 AM Author Report Posted October 2, 2006 at 04:29 AM 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 Quote
atitarev Posted October 2, 2006 at 06:01 AM Report Posted October 2, 2006 at 06:01 AM 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 Quote
imron Posted October 2, 2006 at 08:28 AM Author Report Posted October 2, 2006 at 08:28 AM 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 :-) Quote
atitarev Posted October 2, 2006 at 11:04 PM Report Posted October 2, 2006 at 11:04 PM 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 Quote
wushijiao Posted October 3, 2006 at 04:46 AM Report Posted October 3, 2006 at 04:46 AM 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. Quote
geek_frappa Posted October 3, 2006 at 06:26 PM Report Posted October 3, 2006 at 06:26 PM Anyway, I'm glad you like it. Be sure to tell your friends :-) Friends? I'm telling everyone. :o) Quote
Hero Doug Posted October 28, 2006 at 12:27 PM Report Posted October 28, 2006 at 12: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. Quote
stephanhodges Posted November 8, 2006 at 01:05 PM Report Posted November 8, 2006 at 01:05 PM and also allow a zero to remove the tone mark again! (Sorry if it already does this. Haven't checked lately) Quote
dalaowai Posted November 8, 2006 at 01:19 PM Report Posted November 8, 2006 at 01: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! Quote
Shadowdh Posted November 8, 2006 at 10:03 PM Report Posted November 8, 2006 at 10:03 PM Late to the party as ever... many thanks for a useful tool... Quote
imron Posted November 8, 2006 at 11:43 PM Author Report Posted November 8, 2006 at 11:43 PM 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. Quote
Recommended Posts
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.