Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Typing PinYin with tones in Latin letters
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Tue Jan 11, 2005 11:57 am    Post subject: Typing PinYin with tones in Latin letters Reply with quote

你们好!

我要书写拼音。但,我不要书写汉字。

OK, let's continue in a language i can speak ;)

I want to write PinYin with tones but not convert it to Hanzi.
for example i'd like to write:


But as you can see my problem is that i cannot write the first or the third tone. How can I input them? As soon as I type "input linux pinyin" in google i get tons of pages about inputting hanzi. But actually it's that what i don't want. I just want to be able to type latin letters with (correct) pinyin-tones.

many thanks in advance!
谢谢!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Tue Jan 11, 2005 1:31 pm    Post subject: Re: Typing PinYin with tones in Latin letters Reply with quote

hiroki wrote:
你们好!

我要书写拼音。但,我不要书写汉字。


你好, hiroki! 你的中文很好呢! (You Chinese is good!)

Quote:

I want to write PinYin with tones but not convert it to Hanzi.
for example i'd like to write:
w� a� n�...


I know what you mean, well, it's no so easy to input Pinyin with tones under linux, I've searched google with keywords like "输入 拼音 声调" (means: input Pinyin tones), the result is: there're some softwares that can input Pinyin with tones, however, it seems that all of them are windows software only...

There is a workaround (and I believe it's the common way) for inputting Pinyin with tones, you can simply type "wo3 ai4 ni3" and I guess most of the people who speak Chinese and use Pinyin fully understand what you mean ;)
Back to top
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Tue Jan 11, 2005 5:14 pm    Post subject: Re: Typing PinYin with tones in Latin letters Reply with quote

EricHsu wrote:
hiroki wrote:
...


你好, hiroki! 你的中文很好呢! (You Chinese is good!)


thank you :) I started learning it this semester. As i already know japanese i thought it might be easier then to learn chinese as the characters (hanzi) are almost identical. at least it can help me with chinese. and indeed it does. and chinese is a nice compact language... :D

EricHsu wrote:
There is a workaround (and I believe it's the common way) for inputting Pinyin with tones, you can simply type "wo3 ai4 ni3" and I guess most of the people who speak Chinese and use Pinyin fully understand what you mean ;)


hm, yes, i see what you mean. well, then i'll have to do it that way. thank you very much then, i'll do it with 1234. although i thought the real accents would look nice and be easier to read. at least they are easier to read for me ;) hehe
i am making a list of kanji's (hanzi) for learning japanese and put it all together [ see : www.hiroki.de ]. it (will) contain all 1945 characters, that the japanese government decided to be the most used and neccessary ones. i wanted to add the chinese reading of those japanese characters, too. so i could learn japanese and chinese simultaniously.

anyway, thanks :)
too bad, that there's no way of doing it.

非常谢谢你!
Back to top
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Tue Jan 11, 2005 5:15 pm    Post subject: Re: Typing PinYin with tones in Latin letters Reply with quote

EricHsu wrote:
hiroki wrote:
...


你好, hiroki! 你的中文很好呢! (You Chinese is good!)


thank you :) I started learning it this semester. As i already know japanese i thought it might be easier then to learn chinese as the characters (hanzi) are almost identical. at least it can help me with chinese. and indeed it does. and chinese is a nice compact language... :D

EricHsu wrote:
There is a workaround (and I believe it's the common way) for inputting Pinyin with tones, you can simply type "wo3 ai4 ni3" and I guess most of the people who speak Chinese and use Pinyin fully understand what you mean ;)


hm, yes, i see what you mean. well, then i'll have to do it that way. thank you very much then, i'll do it with 1234. although i thought the real accents would look nice and be easier to read. at least they are easier to read for me ;) hehe
i am making a list of kanji's (hanzi) for learning japanese and put it all together [ see : www.hiroki.de ]. it (will) contain all 1945 characters, that the japanese government decided to be the most used and neccessary ones. i wanted to add the chinese reading of those japanese characters, too. so i could learn japanese and chinese simultaniously.

anyway, thanks :)
too bad, that there's no way of doing it.

非常谢谢你!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Jan 12, 2005 2:37 am    Post subject: Re: Typing PinYin with tones in Latin letters Reply with quote

hiroki wrote:

thank you :) I started learning it this semester. As i already know japanese i thought it might be easier then to learn chinese as the characters (hanzi) are almost identical. at least it can help me with chinese. and indeed it does. and chinese is a nice compact language... :D


My pleasure! And it's really a smart way to learn both of them! To know more about the relationship between Hanzi and Japanese, you may want to read this: "The Development of Chinese Characters in Japan's Written Language" (note: it's written in Chinese ;) )

Quote:

hm, yes, i see what you mean. well, then i'll have to do it that way. thank you very much then, i'll do it with 1234. although i thought the real accents would look nice and be easier to read. at least they are easier to read for me ;) hehe

i am making a list of kanji's (hanzi) for learning japanese and put it all together [ see : www.hiroki.de ].

too bad, that there's no way of doing it.


Agree, Pinyin with tones would looks better and easier for reading. If you don't mind using MS' Windows, I can help you to test and find a Windows input method which can input Pinyin with tones... ;)

I've visited your website, it's cool, great work! (Though I can only recognize the Hanzi part :twisted: )

Quote:

非常谢谢你!

不客气!
需要帮助的时候, 就发贴吧 (If you need help, please feel free to post) :D
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Wed Jan 12, 2005 4:49 am    Post subject: Re: Typing PinYin with tones in Latin letters Reply with quote

hiroki wrote:
... i wanted to add the chinese reading of those japanese characters, too. so i could learn japanese and chinese simultaniously.

anyway, thanks :)
too bad, that there's no way of doing it.

非常谢谢你!


hi, i found your site are informative. :)

I just guess if you are editing the pages online, if yes, may you can find this is a way to get it done.
http://en.wiktionary.org/w/index.php?title=龍&action=edit&section=1


If you are using openoffice, there is a little applet developed for inputting symbols for Chinese user, may that worked too. But i never try it other than the Chinese environment.
_________________
AKar
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Fri Jan 14, 2005 2:44 am    Post subject: Reply with quote

8) A hacking the X server way.

Here you may follow this page X, symbol and key mapping on Howto input the Euro Dollar Sign.

I think this trick should also support the Chinese Pin Yin.

Please follow the page to get the EuroSign done, after then, i will post my hacking of the "Modifier Key" + PinYin Symbols script here to you.

:lol: I am not posting it now, because i am still working on it!! i need to find all the pinyin symbols's Hex value.
_________________
AKar
Back to top
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Tue Jan 18, 2005 10:24 pm    Post subject: Reply with quote

hi.

thanks for your replies.

actually, i think i'll go for Eric's solution. Because "hacking the X server"... makes me feel uncomfortable ;)
not only it's more work to write and set up such a script, when typing i would have to type quite weird shortcuts, wouldn't i?
i thought there might be a simple solution like: ^ + i =
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Jan 19, 2005 2:49 am    Post subject: Reply with quote

hiroki wrote:
anyway. maybe i can find a list of codes [unicode?] for those pinyin-characters and then write a small sript, that can convert my number-pinyin to "real" pinyin. any guess where i could find a list of the pinyin-characters' unicode-number?


hey, that's what've been thinking about! If we could get all the pinyin characters mapping, then, we could:

  1. write Pinyin in "wo3 ai4 ni3" way
  2. write a script run like this: (pyc = pinyin convertor :) )
    Code:

    $ pyc original.txt realpinyin.txt


The pyc script reads the original.txt file, search through the pinyin characters mapping, replace "wo3 ai4 ni3" with "real" pinyin charaters one by one.

So, we could write pinyin in an easier way ("wo3 ai4 ni3"), when we've done, then just let the pyc script to do all the "dirty job"!

OK, I'm going to do some search work! I'll keep posting if I have any further information :D
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Jan 19, 2005 3:58 am    Post subject: Reply with quote

ok! I got things narrow down! I almost forgot that one of the rules of pinyin is: only mark tones on "yuan yin" (don't know how to express in English :oops: ), so there're only five of them - a, e, i, o, u.

Then, each one has four tones, so, we only need to find out: 5 x 4 = 20 pinyin charaters' mapping! I'm searching!
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Jan 19, 2005 4:12 am    Post subject: Reply with quote

sorry, there're six "yuan yin", I've missed one: "u" with two dots above it...

here're all there tones.

1st tone: ā ē ī ō ū ǖ
2nd tone: á é í ó ú ǘ
3rd tone: ǎ ě ǐ ǒ ǔ ǚ
4th tone: à è ì ò ù ǜ

I'm going to try to write the pyc script :)

edit:
note, please set your browser's charater encoding to UTF-8 to display them correctly :)
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Thu Jan 20, 2005 2:47 pm    Post subject: Done! Reply with quote

hey, I've finished the script in python!
All the needed functions have been implemented!
I'm going to do some polishing work and post it tomorrow!

Going to take a happy shower, wow!
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Fri Jan 21, 2005 8:26 am    Post subject: nkpyc done :) Reply with quote

OK, nkpyc v0.1 done :)

download it here:
http://ghpct.3322.org/nktoolkit/nkpyc/nkpyc.py

test cases and result:

. original file (numeric tones)
http://ghpct.3322.org/nktoolkit/nkpyc/numeric-tone.txt

. converted file (real tones)
http://ghpct.3322.org/nktoolkit/nkpyc/real-tone.txt
command:
Code:

./nkpyc.py numeric-tone.txt real-tone.txt


edit: tell me if you find any bug ;)
edit2: after download, chmod +x nkpyc.py, and just run nkpyc.py for help
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Fri Jan 21, 2005 10:22 am    Post subject: Reply with quote

just one question....
what encoding does the output file have? utf8?
and what encoding should the input file have? io-8859-1?

thank you very much for writing this script!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Fri Jan 21, 2005 12:08 pm    Post subject: Reply with quote

sorry, it's my problem, I save them in my native Chinese encoding... so I guess you couldn't view the test cases pages correctly, could you? (they only display correctly under zh_CN.gb2312 encoding...)

Everything is in utf-8 now

I've saved the nkpyc.py to utf-8 encoding and updated the 3 links, please re-download it, and see if the two test cases and the result pages display correctly with your browser's charater encoding sets to utf-8 :)

Then please do the following steps to test it yourself:

  1. write your pinyin with numeric tones in a file and save it with utf-8 encoding
  2. run nkpyc.py to convert it to a new file
  3. view the new file with utf-8 encoding


Whatever it works or not, please tell me so that I could try to figure out where is the problem ;)
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Fri Jan 21, 2005 7:29 pm    Post subject: Reply with quote

Thank you, Thank you very much!

This is perfect!

Muchas gratias, Merci beaucoup, Vielen Dank, Doumo arigatou,

非常謝謝!

I read, that coding an Input Method for SCIM isn't too difficult, so maybe [as soon as I have some time] I could try to write an input method on top of you script. So you could type "wo3" and it would be converted directly.
Wel, if it's not too complicated I'll try to code this in my next vacations :)
[and will post the result here ;)]
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sat Jan 22, 2005 4:25 am    Post subject: Reply with quote

hiroki wrote:
Thank you, Thank you very much!

This is perfect!

That's great to know it actually works :D

Quote:

Muchas gratias, Merci beaucoup, Vielen Dank, Doumo arigatou,

非常謝謝!

WoW, it must be German? At least I can read the Chinese part 8)
不用客气!

Quote:

I read, that coding an Input Method for SCIM isn't too difficult, so maybe [as soon as I have some time] I could try to write an input method on top of you script. So you could type "wo3" and it would be converted directly.
Wel, if it's not too complicated I'll try to code this in my next vacations :)
[and will post the result here ;)]


That would be really cool! Maybe you could write a "pinyin mode" input method for scim, seems that scim is written with gtk+, I'm not very familiar with gtk+/C programming, that's why I'm learning. Hope the day you start writing the scim input method, I'm familiar enough with gtk+/C programming so that I could probably do some help :)
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Thu Jan 27, 2005 10:36 am    Post subject: Reply with quote

:?
8O
well... today...from today on.. I know it is not neccessary to write an input method fpr PinYin anymore! I don't know how, I don't know why...
Just a few seconds ago I discovered that there already is an input method for PīnYīn! It is possible to write PinYin!!!! arghhhhhhh.
I recently updated scim & it's components. So maybe it's a new input method? It's called "M17N-zh-pinyin". And it's perfectly possible to write PinYin. dude.. so much trouble....and such a simple solution.. why wasn't it there two weeks ago??? argh!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sat Jan 29, 2005 1:36 pm    Post subject: Reply with quote

I've done some search job:
http://www.h4.dion.ne.jp/~apricots/mandrake/m17n2.html
http://www.m17n.org/

So, to be able to input pinyin, just emerge scim-m17n?
Have you emerged it? How does it work?
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
Jeremy_Z
l33t
l33t


Joined: 05 Apr 2004
Posts: 671
Location: Shanghai

PostPosted: Sat Jan 29, 2005 6:17 pm    Post subject: Reply with quote

你好.

Just a test to check my input.

Bye the way, which input system are you using ? i use fcitx and blindly managed to configure it in a way i understand (typing pinyin and smart guess ..) but i don't really know what the options are/do.

我学中文。谢谢你们!
_________________
"Because two groups of consumers drive the absolute high end of home computing: the gamers and the porn surfers." /.
My gentoo projects, Kelogviewer and a QT4 gui for etc-proposals
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sun Jan 30, 2005 1:56 am    Post subject: Reply with quote

Hey, Jeremy_Z, welcome!

I've translated the fcitx' config options for you:
Quote:

##[Program]
[程序]
##locale setting
#区域设置=zh_CN
## which font to use in the fcitx' gui?
显示字体=Simsun

## font size
显示字体大小=18
## use AA font?
是否使用AA字体=0
## activate the IM with Ctrl_Shift?
是否使用Ctrl_Shift打开输入法=1

## [output]
[输出]
## don't know how to translate "半角"...
数字后跟半角符号=1
## behavior of the Enter button
Enter键行为=2
## input English with semicolon?
分号输入英文=1
## input English when characters are capitalized?
大写字母输入英文=1
## disable paging when in association search mode? (?)
联想方式禁止翻页=1

## [GUI]
[界面]
## how many candidate words to display?
候选词个数=5
## use 3D GUI?
是否使用3D界面=2
## autohide the input bar?
是否自动隐藏输入条=1
## the hidden mode of the main window
主窗口隐藏模式=1
## cursor follows input?
是否光标跟随=1
## the color of the cursor
光标色=92 210 131
## the background color of the mainwindow
主窗口背景色=230 230 230
## the line color of the mainwindow
主窗口线条色=255 0 0
## the background color of the input window/bar
输入窗背景色=240 240 240
## the line color of the input window/bar
输入窗线条色=100 200 255
## the arrow's color of the input window/bar
输入窗箭头色=255 150 255
## the color of the user's input
输入窗用户输入色=0 0 255
## the message's (?) color of the input window/bar
输入窗提示色=255 0 0
## the number's color of the input window/bar
输入窗序号色=200 0 0
## the color of the first candidate word
输入窗第一个候选字色=0 150 100
## the color of user defined words
#该颜色值只用于拼音中的用户自造词
输入窗用户词组色=0 0 255
## don't know what is this option for... -_-#
输入窗提示编码色=100 100 255
## color for the other text in the input window/bar
#五笔、拼音的单字/系统词组均使用该颜色
输入窗其它文本色=0 0 0

## [hotkeys]
[热键]
## which key to use to switch between chinese and english?
#中英文快速切换键 可以设置为L_CTRL R_CTRL L_SHIFT R_SHIFT
中英文快速切换键=L_CTRL
## which key to activate the GBK support?
GBK支持=CTRL_M
## which key to activate the associate searching mode?
联想支持=CTRL_L
## which key to switch between ?? (don't know how to translate...)
全半角=SHIFT_SPACE
## which key to activate the chinese punctuation?
中文标点=ALT_SPACE
## which key to go to the previous page?
上一页=- ,
## which key to go to the next page?
下一页== .
## which key to select the 2nd/3rd candidate words?
第二三候选词选择键=SHIFT

## [wubi input method, fine, I only use Pinyin, so, let's skip this section... 8) ]
[五笔]
五笔四键自动上屏=1
自动调整五笔顺序=0
提示词库中已有的词组=0
五笔精确匹配=0
提示五笔编码=1
使用Z输入拼音=1
Z模糊匹配=1
增加五笔词组=CTRL_8
调整五笔顺序=CTRL_6
删除五笔词组=CTRL_7

## [pinyin input method]
[拼音]
## use full pinyin mode? (means you'll have to input the full pinyin for each character, that's not efficient, so the default value is disabled)
使用全拼=0
## auto group charaters into phrase (??) ?
拼音自动组词=1
## save the "auto grouped phrases(??)"?
保存自动组词=0
## which key to add commonly used pinyin words?
增加拼音常用字=CTRL_8
## which key to remove commonly used pinyin words?
删除拼音常用字=CTRL_7
## which key to remove user defined pinyin phrase?
删除拼音用户词组=CTRL_DELETE
## adjust mode for duplicate words:
## 0->don't adjust 1->fast adjust 2->adjust by frequency
#重码调整方式说明:0-->不调整 1-->快速调整 2-->按频率调整
## adjust mode for single duplicate pinyin word
拼音单字重码调整方式=2
## adjust mode for duplicate pinyin phrase
拼音词组重码调整方式=1
## adjust mode for commonly used pinyin phrase
拼音常用词重码调整方式=0
## let's skip the following section, they are the options for those lazy people who don't what to learn/pronounce pinyin correctly 8)
是否模糊an和ang=0
是否模糊en和eng=0
是否模糊ian和iang=0
是否模糊in和ing=0
是否模糊ou和u=0
是否模糊uan和uang=0
是否模糊c和ch=0
是否模糊f和h=0
是否模糊l和n=0
是否模糊s和sh=0
是否模糊z和zh=0


HTH, and sorry for my poor english ;)
and, you may want to give scim a try, I'm using the scim IM, feels good :) (emerge scim-chinese)
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
shiao
n00b
n00b


Joined: 30 Aug 2004
Posts: 12

PostPosted: Mon Mar 21, 2005 1:00 am    Post subject: Reply with quote

EricHsu wrote:

So, to be able to input pinyin, just emerge scim-m17n?
Have you emerged it? How does it work?


I am installing right now the following packages

Code:
emerge dev-libs/m17n-lib dev-db/m17n-db


I assume that scim-m17n are wrappers to the actual m17n libraries.
Back to top
View user's profile Send private message
liuspider
Apprentice
Apprentice


Joined: 03 Feb 2003
Posts: 237

PostPosted: Mon Mar 21, 2005 4:16 am    Post subject: Reply with quote

to shiao:
you are definitely right.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum