Jump to content
Chinese-forums.com
Learn Chinese in China

  • Why you should look around

    Since 2003, Chinese-forums.com has been helping people learn Chinese faster and get to China sooner. Our members can recommend beginner textbooks, help you out with obscure classical vocabulary, and tell you where to get the best street food in Xi'an. And we're friendly about it too. 

    Have a look at what's going on, or search for something specific. We hope you'll join us. 
imron

Pinyinput - Type Pinyin with Tone Marks

Recommended Posts

Ted C.

Hey Imron, there was some talk upthread about the need to use an English locale to get the correct fonts in Word.

Did you consider making the input locale "English (Singapore)"? It's an available locale in Windows, and it might make more sense than English (Australia) or English (Canada), since Chinese is an official language of Singapore (though I don't think they have an official romanisation).

By the way, you deserve an award just for the name "pinyinput". How did anyone not come up with that before?

Share this post


Link to post
Share on other sites
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 Chinese Characters Learn 2289 Chinese Characters in 90 Days with a Unique Flash Card System.
Hacking Chinese Tips and strategies for how to learn Chinese more efficiently
Popup Chinese Translator Understand Chinese inside any Windows application, website or PDF.
Chinese Grammar Wiki All Chinese grammar, organised by level, all in one place.

imron

The English locale is required to make Word and a couple of other Microsoft programs (e.g. Wordpad) not automatically change to a Chinese font for characters outside the standard ASCII range (e.g. any character with a tone mark over it), which these programs will do if the input locale is Chinese.

So I made the installation choice for input locale to be one of Chinese (Simplified PRC), Chinese (Traditional Taiwan), English (Australia), or the default locale of your computer - which in your case appears to be English (Canada) :)

So, any user who has English (Singapore) as their default locale will be able to choose that if they wish. I didn't want to force a random locale on anyone as it may have created other problems and also complicates things for non-technical users, and I figured the above options made the most amount of sense with the possible exception of English (Australia) which I put to provide an English option for users whose default locale wasn't English, and chose over more common varieties such as English (UK) or English (US) more to fly the flag than anything else :mrgreen:

By the way, you deserve an award just for the name "pinyinput". How did anyone not come up with that before?

My one tiny regret was not registering the domain name - which was free both at the time and for about a year after Pinyinput's release. Oh well, only myself to blame for that.

Share this post


Link to post
Share on other sites
imron

I just wish MS had put a bit more thought into their automatic font changing logic in Word and made it change fonts for any Chinese character rather than just any non-ASCII character. It would have saved a whole lot of trouble as it took a good amount of poking around and trickery to get dynamic locale selection working. Not sure what it's like with the TSF, but the old IME API wants IMEs to set a single locale at compile time and be done with it. In the end I had to overwrite the VS_VERSION_INFO stucture of the IME dll manually before installing it.

Share this post


Link to post
Share on other sites
Shelley

Just got it working on my pc. Wonderful :) Thanks for your efforts.

it works very well on my setup.

I agree with Ted C. Brilliant name for it.

Keep up the good work.

Shelley

Share this post


Link to post
Share on other sites
ausgang

Hi imron,

I have problems installing pinyinput on Win7 Ultimate 64bit. I run the .exe as admin but get the error message: "Error loading pinyinput as a text service". Do you have a clue what to do?

Thanks in advance,

Juergen

Share this post


Link to post
Share on other sites
imron

What locale are you trying to install it under, and what is the default locale of your machine?

Share this post


Link to post
Share on other sites
ausgang

Thanks for the quick answer.

My systems default is german, but I also tried to install it under other languages such as simplified chinese, traditional chinese and english. It always produces the same error message.

Share this post


Link to post
Share on other sites
imron

There are 4 different places in installer that will produce that error message, but from the error message alone it's difficult to know which one caused it exactly. If I supplied you with a debug version of the installer would you be happy to try running that so that I can get some logging information to find out which of them is causing the problem?

Share this post


Link to post
Share on other sites
ausgang

Of course I would try this. Does this produce a log file or something like that?

Share this post


Link to post
Share on other sites
imron

Yeah, it will produce a log file telling me which place failed and why. I'll send the file via email sometime later today.

Share this post


Link to post
Share on other sites
ausgang

Hi imron,

have you alreadey tried to send the debug installer to me?

Thanks in advance

Share this post


Link to post
Share on other sites
imron

Yep. I sent it on the 12th to the email address you registered at the forums with. PM me if you would like me to send it to a different email address.

Share this post


Link to post
Share on other sites
Manuel

Not to piss on anybody's strawberries but this can be accomplished with Autohotkey_L in just a few minutes, totally bug-free, no need to install anything (assuming you already use Autohotkey_L) and best of all no need to switch input methods or worry about locales, etc, as you can type simultaneously not just pinyin but also several other languages if you so wish.

The following code is what I use for entring pinyin. It works with all upper, lower and mixed case and works similar to imron's Pinyinput. You can of course add code to input French, German and Spanish characters, as well as other commonly used characters such as €£¥°© on the fly without having to mess around e.g. on my system I type © I just type out hscopy (hs stands for hotstring). Anyway here's the code for pinyin.:

#If (PinyinEnabled & !WinExist("ahk_class SoPY_Status"))
:*?:ai1::āi
:*?:ai2::ái
:*?:ai3::ǎi
:*?:ai4::ài
:*?:ei1::ēi
:*?:ei2::éi
:*?:ei3::ěi
:*?:ei4::èi
:*?:i1::ī
:*?:i2::í
:*?:i3::ǐ
:*?:i4::ì
:*?:ao1::āo
:*?:ao2::áo
:*?:ao3::ǎo
:*?:ao4::ào
:*?:o1::ō
:*?:o2::ó
:*?:o3::ǒ
:*?:o4::ò
:*?:ou1::ōu
:*?:ou2::óu
:*?:ou3::ǒu
:*?:ou4::òu
:*?:u1::ū
:*?:u2::ú
:*?:u3::ǔ
:*?:u4::ù
:*?:a1::ā
:*?:a2::á
:*?:a3::ǎ
:*?:a4::à
:*?:e1::ē
:*?:e2::é
:*?:e3::ě
:*?:e4::è
:*?:v1::ǖ
:*?:v2::ǘ
:*?:v3::ǚ
:*?:v4::ǜ
:*?:an1::ān
:*?:an2::án
:*?:an3::ǎn
:*?:an4::àn
:*?:en1::ēn
:*?:en2::én
:*?:en3::ěn
:*?:en4::èn
:*?:in1::īn
:*?:in2::ín
:*?:in3::ǐn
:*?:in4::ìn
:*?:un1::ūn
:*?:un2::ún
:*?:un3::ǔn
:*?:un4::ùn
:*?:vn1::ǖn
:*?:vn2::ǘn
:*?:vn3::ǚn
:*?:vn4::ǜn
:*?:ang1::āng
:*?:ang2::áng
:*?:ang3::ǎng
:*?:ang4::àng
:*?:eng1::ēng
:*?:eng2::éng
:*?:eng3::ěng
:*?:eng4::èng
:*?:ing1::īng
:*?:ing2::íng
:*?:ing3::ǐng
:*?:ing4::ìng
:*?:ong1::ōng
:*?:ong2::óng
:*?:ong3::ǒng
:*?:ong4::òng
:*?:er1::ēr
:*?:er2::ér
:*?:er3::ěr
:*?:er4::èr
#If

Then what you do is assign a hotstring or hotkey to toggle the PinyinEnabled flag if you need to disable pinyin input i.e. if you want to type ni3 hao3 instead of nǐ hǎo. The above code also checks to see if Sogou input method is active, in which case it has no effect. On my system I switch between Chinese and English input methods using the hotstring "SDF" and toggle pinyin input on and off using the hotstring "FDS", by means of the following code.

;Toggle Sogou Chinese input language
:*?:sdf::
SetCapsLockState, Off ;Turn off CapsLock, so you can type Chinese straightaway
SendInput {Alt Down}{Shift Down}{Shift Up}{Alt Up}
Return
:*?:fds::PinyinEnabled := !PinyinEnabled

I highly recommend Autohotkey_L to everybody! It's the best thing that happened to Windows and the reason why I don't use a Mac.

Edit: I humbly apologise if this post looked like I was trying to say that my app was better than Imron's. Imron's Pinyinput was created way before Authotkey_L existed, so kudos to Imron for his slefless coding effort. If Autohotkey_L didn't exist I'd be using Pinyinput no doubt. :P

Share this post


Link to post
Share on other sites
imron
no need to install anything

You mean besides Autohotkey :D

Share this post


Link to post
Share on other sites
imron
totally bug-free

P.S. what happens if you type in rang4bu4?

(not trying to be mean, actually I think this looks like a pretty neat tool, and would probably even try it myself if I wasn't a Mac convert - well, that and I'm not really a fan of running random files downloaded from the Internet that my antivirus software flags as malware :mrgreen:).

Share this post


Link to post
Share on other sites
Manuel

Thanks Imron! Well spotted, that was actually a typo in my code, sorry... :mrgreen: If you type rang4bu4 you get ràngbù. I accidentally typed an s after ang when I hit Ctrl-S to save. Fixed. I have still called it v1.02 rather naughtily though, as I don't think many people will have downloaded it.

Share this post


Link to post
Share on other sites
imron

You should probably edit your original post too, as ang4 is still listed as àngs in the script.

Share this post


Link to post
Share on other sites
Manuel

Thanks! Original post amended. BTW did your antivirus flag it as malware? If you are not sure you can always run it in Sandboxie, which is what I do as standard for everything I download.

Share this post


Link to post
Share on other sites

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
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...