2013年10月9日 星期三

ibus 嘸蝦咪安裝

在ubuntu 使用ibus的嘸蝦咪相當簡單

只要連結到
https://github.com/vicamo/ibus-table-boshiamy/downloads
會看到有兩個連結,請下載第二個
ibus-table-boshiamy_1.2.0.20091209-0ubuntu1_all.deb
丟在Ubuntu底下你喜歡的地方(我是直接放在家目錄底下)

用滑鼠對著此檔案點兩下便會自動安裝
接著請登出ubuntu,再重新登入(目的只是要重啟ibus)
到ibus的設定頁面(即 Keyboard Input Methods)加入此輸入法即可


在red hat下 得自己做table,方法如下:

1.先確定己安裝ibus-table-createdb。

如未安裝請自行安裝
# yum install ibus-table

2.請先下載字碼表,網址如下:
https://sites.google.com/a/ubuntu-tw.org/orange/boshiamyfinal.tar.bz2?attredirects=0

裏面放有Basic.txt ,GB.csv 兩個檔案
其中Basic.txt是正體中文+日文 沒有把蝦米研究室的Ext A,Ext B 字沒有包含進來
(ExtA,ExtB屬於是少見unicode 用到機率小)
即便已經省掉ExtA,ExtB 這樣還是會超過Windows版輸入法的限制(32000列)
所以簡體的部份單獨存放在GB.csv (有需要簡體,請自行整合)

3.將以下內容複製到Basic.txt內的最上方之後儲存成liu.txt

###===========================
### File header must not be modified
### This file must be encoded into UTF-8.
### This table under LGPL
### comments start with ### not single #
### Derive from the format of SCIM Table, so you can modify the table from
### scim-tables' table
SCIM_Generic_Table_Phrase_Library_TEXT
VERSION_1_0

### Begin Table definition.
BEGIN_DEFINITION

### License
LICENSE = LGPL

### An unique id to distinguish this table among others.
### Use uuidgen to generate this kind of id.
UUID = aa920bcb-d7c1-4e3a-a1ca-5d630f1cfcb4

### A unique number indicates the version of this file.
### For example the last modified date of this file.
### This number must be less than 2^32.
### Just make your table version-able
SERIAL_NUMBER = 20090709

### ICON can be any format as long as your pygtk can recognized
### the most widely ones are "png" and "svg", letter one is recommended
ICON = boshiamy.png

### The default name of this table, this is needed
NAME = Table

### The local names of this table, this is optional
NAME.zh_CN = 嘸蝦米
NAME.zh_HK = 嘸蝦米
NAME.zh_TW = 嘸蝦米

### Description
DESCRIPTION = Boshiamy Input Method

### Supported languages of this table
### sigle "zh_CN" just be recognized as zh_CN,
### but "zh_CN, zh_HK" or more zh_XX will be recognized as zh;
### and "en_US, zh_CN" will be just ignored.
LANGUAGES = zh_CN,zh_SG,zh_TW,zh_HK

### The author of this table
AUTHOR = Vicamo Yang

### Prompt string to be displayed in the status area, CN will be replaced by
### the gettext tools in runtime as 中.
STATUS_PROMPT = CN

### Valid input chars.
VALID_INPUT_CHARS = ,.'abcdefghijklmnopqrstuvwxyz[]

### Layout
LAYOUT = us

### The max number of input keys for every phrase or character.
MAX_KEY_LENGTH = 5

### Use auto_commit mode as default
AUTO_COMMIT = TRUE

### Use full width punctuation by default
DEF_FULL_WIDTH_PUNCT = TRUE
### Not use full width letter by default
DEF_FULL_WIDTH_LETTER = FALSE

### Whether user are allow to define phrase, default is true
### You have to define the word construction rules below.
### For input methods which do not input phrases, set this to False
USER_CAN_DEFINE_PHRASE = TRUE

### Whether support PinYin Mode, default is true.
### this feature is just for Chinese, set it to False if your IM is not
### Chinese.
PINYIN_MODE = TRUE

### If true then the phrases' frequencies will be adjusted dynamically
### according your using frequency.
DYNAMIC_ADJUST = TRUE

### Some characters whose frequencies should be fix all the time, e.g.
### some punctuations
### NO_CHECK_CHARS =

### Rules for constructing user defined phrase
### "ce" stands for "ci equal", a Chinese English :), means "phrase length
### equal to", thus ce2 -> phrase length equal to 2; and "ca" means "phrase
### length equal or above", so ca4 -> phrase length equal or above 4.
### p21 -> the 1st key of 2nd character in the phrase, and so on.
### Each rule separate via ";".
### Example below is a complete rule-set,
### becuase [2,2] ∩ [3,3] ∩ [4,+∞] = [2,+∞], which is the range of length
### of phrase. This have to be satisfied if you need ibus-table to build up
### your own inputed phrase via your daily using.
###RULES = ce2:p11+p12+p21+p22;ce3:p11+p21+p22+p31;ca4:p11+p21+p31+p41

END_DEFINITION

### Begin Table data.
### Format of every line whose formated in "input_keys\tphrase\tfreq\n" is an
### entry.
### From left to right, the 1st column are the input key combination that you
### entered via keyboard; the 2nd column are presented character or phrase of
### the key combination you want; the 3rd column are frequency of the character
### or phrase.
BEGIN_TABLE
END_TABlE

###==============================================

4.照以下的command製作ibus 的 db
# ibus-table-createdb -s liu.txt -n liu.db

5.將liu.db 複製到 /usr/share/ibus-table/tables/

6. 依照步驟3的內容中,有寫的icon 名稱(即圖檔boshiamy.png),將自製的icon 複製到 /usr/share/ibus-table/icons/  (檔名要為boshiamy.png)

登出後再登入就可以在ibus中新增無蝦咪了

1 則留言:

  1. 感謝,幫大忙了,補充一句,最後一行END_TABlE要放在字表之後

    回覆刪除