Re: About wnn
----- Original Message -----
> UCDOS我只是聽說過,但不知如何作. 你要是有時間能詳悉介紹一下,不勝感激.
以Debian的GB編碼用戶為例:
apt-get source cxterm-gb
得到cxterm的source,
如比說 source 的目錄名為 cxterm-5.1p1 (也可能是別的名字)
的文件, 啟動一個emacs會話, 然後輸入
M-x titdic-convert cxterm-5.1p1/dict/UCDOSPY.tit RET
你會發現當前目錄下多了一個叫 UCDOSPY.el的文件.
這個文件能幹活, 但是幹得很糟, 主要是不能輸入詞(組).
我們需要把象下面這樣的項
("buduan" "(不斷)")
("budui" "(不對)(部隊)")
變成
("buduan" ["不斷"])
("budui" ["不對" "部隊"])
;
把
("xian" "秈□跣躚霰(西安)")
變成
("xian" ["秈" "□" "跣" "躚" "霰" "西安"])
當時我用vim完成了這件事情,
我的一個朋友為此寫了個script(不過我發覺它不能對付"xian"這種情況).
#!/bin/bash
EMACS="emacs -batch --no-init-file --no-site-file --multibyte"
EMACSLISPDIR=/usr/share/emacs/21.0.100/lisp/
MV="mv -f"
${EMACS} -l ${EMACSLISPDIR}/international/titdic-cnv --eval '(batch-titdic-convert t)' $1.tit
sed -e '/"(.*)")$/{
s/"(\(.*\))")$/["\1"])/
s/)(/""/g
}' $1.el > $1.el.tmp
${MV} $1.el.tmp $1.el
${EMACS} -l ${EMACSLISPDIR}/international/quail -f batch-byte-compile $1.el
當時我在vim直接修改的.
首先先做下列變換:
"( => ["
~~ ~~
)" => "]
~~ ~~
)( => " "
~~ ~~~
在得到新文件 UCDOSPY.el.1中,
需要把象下面這樣的項:
("xian" "秈□跣躚霰(西安"])
變成
("xian" ["秈" "□" "跣" "躚" "霰" "西安"])
用sed該怎麼做我不清楚.
不過因為象 "xian"這種特殊情況在漢語中實在太少了, 所以當時我
是在emacs裡手動修改(在vi裡不好做, 因為UCDOSPY.el是mule編碼的)的.
最後, 把修改後的 UCDOSPY.el 放到比如你的 $HOME 下,
並且在你的..emacs裡加上:
;;; Customize the Chinese Environment
(load-file "~/UCDOSPY.el")
(set-input-method "chinese-py-ucdos")
(set-default-font "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard")
BTW: 別忘了把coding system設為 Chinese GB
重新啟動emacs, 現在你可以在emacs裡使用ucdos拼音了(不過只是部分功能).
本來我在附件裡放了我一直在用的ucdospy.el(gziped), 我已經在其中添加了許多詞條.
可能太大了, 這個list沒接收, 如果誰感興趣, 我可以寄個copy給他.
--
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.
Reply to:
- Follow-Ups:
- 中文化的兩個問題
- From: YiFei Chen <chern@mail.ustc.edu.cn>