google code-beautifer

星期五, 11月 06, 2009

ispell 與中文環境emacs

中文emacs使用者可能會遇到一個問題:環境是設好了可以用中文。但是用英文打字了半天想要作一下拼字檢查,卻發現錯誤訊息:"No Word lists can be found for language zh_TW",因為找不到對應語言環境的中文字典檔。

要避免這問題,可以下達
M-x ispell-change-dictionary
再指定要用的字典,比如說美式英語是en_US 。或者是在.eamcs 強迫設定變數 ispell-dictionary:
(setq ispell-dictionary "en-US")

ispell 支援中文拼字檢查的可能性


ispell 支援多國語言,但是沒有中文。他的支援語言語言清單設定在變數
ispell-dictionary-alist
裡面沒有中文。只要去看了他的編排方式,就知道至不是很適合中文這種字數是
上萬的語言。舉兩個例子:

("en_US" "[[:alpha:]]" "[^[:alpha:]]" "'" t
("-d" "en_US")
nil utf-8)

("en" "[[:alpha:]]" "[^[:alpha:]]" "'" t
("-d" "en")
nil utf-8)