Since I have such dismal guessing rates I use various programs to check myself, before I wreck myself. If I am on the go, I draw the character with my finger in Pleco. Otherwise, I may try my guessed sound via pinyin. Both methods are slow and error prone. So instead, I often copy and paste the character into Google Translate. There are times when I do not have Internet, or I don't want to fire up a web browser. When that happens I utilize a nifty Perl module by Yusuke Kawasaki called Lingua::ZH::Romanize::Pinyin. I put the following one liner into my bashrc as an alias.
alias romanize="perl -MLingua::ZH::Romanize::Pinyin -E 'say Lingua::ZH::Romanize::Pinyin->new->chars(\$ARGV[0]);'"
This allows me to use the command line like below.
user@system:~$ romanize 骆驼 luo tuo
It is as simple as that! Not only does he have a module for Chinese, but also modules for Korean and Japanese.
No comments:
Post a Comment