Skip to content

Instantly share code, notes, and snippets.

@gkzhong
Created August 25, 2012 15:36
Show Gist options
  • Save gkzhong/3467172 to your computer and use it in GitHub Desktop.
Save gkzhong/3467172 to your computer and use it in GitHub Desktop.
在Rime五筆輸入方案中添加繁體輸出
一,安裝簡體->繁體映射碼表:(該項目由opencc維護:http://code.google.com/p/opencc)
文件1:http://code.google.com/p/rimeime/source/browse/trunk/misc/opencc/data/simp_to_trad_characters.ocd
文件2:http://code.google.com/p/rimeime/source/browse/trunk/misc/opencc/data/simp_to_trad_phrases.ocd
安裝位置:共享資料目錄
如:/Library/Input Methods/Squirrel.app/Contents/SharedSupport/opencc
二,添加opencc簡繁配置文件:
詳見:zhs2zht.ini
安裝位置:共享資料目錄
如:/Library/Input Methods/Squirrel.app/Contents/SharedSupport/opencc
三,自定義五筆拼音輸入法配置(同時可用於86版,本文僅提供五筆拼音配置文件)
詳見:wubi_pinyin.custom.yaml
安裝位置:用戶資料目錄
如:~/Library/Rime
patch:
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
states: [ 漢字, 汉字 ]
simplifier/opencc_config: zhs2zht.ini
engine/filters:
- simplifier
- uniquifier
; Open Chinese Convert
;
; Copyright 2010 BYVoid <byvoid.kcp@gmail.com>
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
title = simp_to_trad
description = Standard Configuration for Conversion from Simplified Chinese to Traditional Chinese
dict0 = OCD opencc/simp_to_trad_phrases.ocd
dict0 = OCD opencc/simp_to_trad_characters.ocd
@lilac
Copy link

lilac commented Apr 9, 2013

我這樣設置後五筆打不出中文了,只能出英文。求解!

@dennislan
Copy link

请教:如何使用极点五笔的码表?

@yjxue84
Copy link

yjxue84 commented Oct 27, 2013

您好,参照设置后虽然出现简体繁体的切换选择,但是无论选择简体还是繁体,输出的仍然是简体。请问这可能是什么原因造成的?
我的OS版本:10.6.8
鼠鬚管版本: 0.9.21.1
有将版本删除,重新安装配置,但仍然一样。
希望能得到您的答复,谢谢!

@tkjune
Copy link

tkjune commented Dec 22, 2014

最新的0.9.26.1中,
simplifier/opencc_config後面的zhs2zht.ini改成s2t.json
即:
simplifier/opencc_config: s2t.json

對於簡體用戶來說, 切換簡入繁出的時候,UI上的提示提醒剛好是相反的, 即選擇繁體輸出的時候顯示的提示是"汉字", 可能會感覺不適. 可以通過修改以下內容以符合習慣 (註銷或重啓後生效)
/Library/Input Methods/Squirrel.app/Contents/Resources/(你的系統語言).lproj/Localizable.strings
裏面
"simplification" =
"!simplification" =
後面的內容對調一下即可. 也可以改成符合自己需要的文字 比如
"simplification" = "輸出繁體";
"!simplification" = "输出简体";

@zwpaper
Copy link

zwpaper commented Nov 14, 2015

補充上面的:
0.9.26.1 中,
兩個 ocd 文件也是已經自帶了的,不用再去單獨下載。

也就是只需要加入 custom.yaml 文件即可。

@northleafup
Copy link

您好,请为我这样配置后,无论我选简体还是繁体一律输出的都是简体,请问这个是什么原因呢?

switches:
  - name: ascii_mode
    reset: 0
    states: [ 中文, 西文 ]
  - name: full_shape
    states: [ 半角, 全角 ]
  - name: extended_charset
    states: [ 常用, 增廣 ]
  - name: ascii_punct
    states: [ 。,, ., ]
  - name: simplification
    states: [ 漢字, 汉字 ]

simplifier/opencc_config: s2t.json

engine:
  processors:
    - ascii_composer
    - recognizer
    - key_binder
    - speller
    - punctuator
    - selector
    - navigator
    - express_editor
  segmentors:
    - ascii_segmentor
    - matcher
    - abc_segmentor
    - punct_segmentor
    - fallback_segmentor
  translators:
    - punct_translator
    - reverse_lookup_translator
    - table_translator
  filters:
    - simplifier
    - uniquifier

我是直接修改的wubi86.schema.yaml文件,部署后不起作用,重新启动电脑也没有作用呢.

@northleafup
Copy link

终于配出来了,以下是我的代码

  - name: simplification
    states: [ 漢字, 汉字 ]
simplifier:
     opencc_config: s2t.json

engine:
  processors:
    - ascii_composer
    - recognizer
    - key_binder
    - speller
    - punctuator
    - selector
    - navigator
    - express_editor
  segmentors:
    - ascii_segmentor
    - matcher
    - abc_segmentor
    - punct_segmentor
    - fallback_segmentor
  translators:
    - punct_translator
    - reverse_lookup_translator
    - table_translator
  filters:
    - simplifier
    - uniquifier

@Aceyoung
Copy link

Aceyoung commented Apr 8, 2017

请教:如何使用希码的码表?

@jccode
Copy link

jccode commented Dec 15, 2017

如果是在windows下的小狼毫, 可能需要注意下 zhs2zht.ini 这个配置文件中的路径:

dict0 = OCD opencc/simp_to_trad_phrases.ocd
dict0 = OCD opencc/simp_to_trad_characters.ocd

小狼毫下,这个目录是放在data目录下的,这样的话,需要改成:

dict0 = OCD data/opencc/simp_to_trad_phrases.ocd
dict0 = OCD data/opencc/simp_to_trad_characters.ocd

希望对其他人有帮助。

还有一种方式是,直接下载一个现成的就好了。

@leopku
Copy link

leopku commented Nov 26, 2019

终于配出来了,以下是我的代码

  - name: simplification
    states: [ 漢字, 汉字 ]
simplifier:
     opencc_config: s2t.json

engine:
  processors:
    - ascii_composer
    - recognizer
    - key_binder
    - speller
    - punctuator
    - selector
    - navigator
    - express_editor
  segmentors:
    - ascii_segmentor
    - matcher
    - abc_segmentor
    - punct_segmentor
    - fallback_segmentor
  translators:
    - punct_translator
    - reverse_lookup_translator
    - table_translator
  filters:
    - simplifier
    - uniquifier

👍
Works with my squirrel 0.14.0.
Thanks a lot.

@wiman4
Copy link

wiman4 commented Feb 13, 2022

@northleafup 照着你的方法弄好了,非常棒,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment