索引系統修改: branch database_rewrite

78 views
Skip to first unread message

詹博丞

unread,
Aug 26, 2013, 6:44:37 AM8/26/13
to chewing-devel
Dear all:

我把一部分製作 rebase 過,整理為以下

https://github.com/school510587/general_index_libchewing/tree/database_rewrite

在此總結修改項目:

1. 改變 index tree 的結構,詳見之前「新索引系統資料結構調整」

2. 去除 sort.c, maketree.c 以 init_database 取代

3. 去除 char.c, 將字相關功能整合入 dict.c

請各位 review, 無問題後希望整合入 libchewing

Thanks!

ChangZhuo Chen

unread,
Aug 26, 2013, 8:43:04 AM8/26/13
to chewin...@googlegroups.com
Hi,

幾點建議如下:

  • code 的部份可以使用 github 的 pull request 嗎?這樣 review 比較方便。
  • cmake build 的 unit test 有問題,travis-ci 的結果如 [1],這部份要再檢查看看。
  • git log 部份有辦法 rebase 讓你的修改在最上面嗎?目前 history 有點亂,而且還跨過 v0.3.5 的 release,這會造成之後 maintain 上的困難。
  • git commit message 請遵守 [2]。
  • init_database.c 的 coding style 有些不一致,像是 if, +=, =, () 左右的空格,{ 的位置等。這部份建議用 K&R style [3]。
  • init_database.c 內目前沒有對 "詞" 作發音檢查?這部份會造成詞庫正確性出問題,請務必把 "詞" 的發音檢查加回去。

詹博丞

unread,
Aug 27, 2013, 8:24:46 AM8/27/13
to chewin...@googlegroups.com
To CZChen:

這次我用 cherry-pick 整理了,所有 init_database 修改都在上面

有些衝突是 pick 時發生的,我目前先保留它的訊息

https://github.com/school510587/general_index_libchewing/tree/rdb_review

關於建議回應如下:

commit message 我已經盡量以我的理解去遵守。

Style 部分,我全盲只能用點顯器閱讀,視野只有 40 characters (13~20 Chinese words),
所以多空格反而會讓我不便閱讀,我會不自覺不想多打 style 用的空白,請見諒!

我已經將 if, while, for, switch 與 ( 間嚴格空一格,{ 與上述敘述需同行

if, while, for 子敘述 tab 進去、等號即比較算符兩邊空白,這兩問題我盡量抓漏了

cmake 部分,這新 branch 我可以在 libchewing/ 成功測試,可是 test/ 下失敗

昨天那支看錯誤懷疑少了某個 #define 讓 plat_mmap_posix.h, plat_mmap_windows.h 都沒有 include

今天這支無法建立 am--refresh, 我不清楚問題原因,抱歉還請指點

最後辭發音檢查,我用 PCMan 無法操作含有 UTF-8 的段落,故無法恢復 exception_phrase,
且之前討論你說讓字典決定即可,故我在此忽略所有發音錯誤,即 exception_phrase.

Pull request 部分,我看了

http://ihower.tw/blog/archives/7560

但 brew install hub / gem install hub 似乎都沒用,我可以如何做到這要求?

Thanks!

在 2013/8/26,ChangZhuo Chen <czc...@gmail.com> 撰寫:
> Hi,
>
> 幾點建議如下:
>
>
> - code 的部份可以使用 github 的 pull request 嗎?這樣 review 比較方便。
> - cmake build 的 unit test 有問題,travis-ci 的結果如 [1],這部份要再檢查看看。
> - git log 部份有辦法 rebase 讓你的修改在最上面嗎?目前 history 有點亂,而且還跨過 v0.3.5 的
> release,這會造成之後 maintain 上的困難。
> - git commit message 請遵守 [2]。
> - init_database.c 的 coding style 有些不一致,像是 if, +=, =, () 左右的空格,{
> 的位置等。這部份建議用 K&R style [3]。
> - init_database.c 內目前沒有對 "詞" 作發音檢查?這部份會造成詞庫正確性出問題,請務必把 "詞" 的發音檢查加回去。
> --
> 您已訂閱「Google 網上論壇」的「Chewing IM Development」群組,因此我們特別傳送這封郵件通知您。
> 如要取消訂閱這個群組並停止接收來自這個群組的郵件,請傳送電子郵件到
> chewing-deve...@googlegroups.com
> 如要在此群組張貼留言,請傳送電子郵件至 chewin...@googlegroups.com
> 請前往以下網址造訪這個群組:http://groups.google.com/group/chewing-devel
> 如需更多選項,請前往:https://groups.google.com/groups/opt_out
>

ChangZhuo Chen

unread,
Aug 28, 2013, 10:12:22 AM8/28/13
to chewin...@googlegroups.com
On Tuesday, August 27, 2013 8:24:46 PM UTC+8, 博丞 詹 wrote:
Style 部分,我全盲只能用點顯器閱讀,視野只有 40 characters (13~20 Chinese words),
所以多空格反而會讓我不便閱讀,我會不自覺不想多打 style 用的空白,請見諒!

這部份看有沒有辦法用 indent [1] 跑過一遍讓 style 統一。
 
最後辭發音檢查,我用 PCMan 無法操作含有 UTF-8 的段落,故無法恢復 exception_phrase, 
且之前討論你說讓字典決定即可,故我在此忽略所有發音錯誤,即 exception_phrase.

是哪個 platform 的 PCMan?這部份可以發 bug report

exception phrase 的目的是詞庫發音檢查。為了避免詞庫錯誤,libchewing 會對詞庫內所有的字檢查發音是不是正確。
由於中文有些字在特定詞中的發音會不存在在字庫中,所以才要 exception phrase。

exception phrase 存在其實可以當成教育部字典和辭典的 bug。

pull request 是 github 的功能,不過你的 repository 必須在 github 上用 fork 才行。你可以連到 https://github.com/chewing/libchewing
按下 fork,這樣 fork 出來的 project 如果有 branch,github 會多顯示一個 pull request 的按鈕。


現在試著 cherry-pick 你的修改 [2],有地方你要注意一下:

每的 commit 都要是可以 build 且 unit test all pass 的。unit test 的部份你可以把你的 project 打開 travis-ci [3]。
當你 push github 時,他會跑所有的 unit test,如果有問題會收到 email。


網頁的按鈕如果點顯器找不到,可能要請其他人幫忙了。

詹博丞

unread,
Aug 29, 2013, 12:00:12 AM8/29/13
to chewin...@googlegroups.com
To CZChen:

我從 libchewing master checkout 出來的東西,cmake 還是怪怪的:

$ make
CC testhelper.lo
In file included from ../include/internal/chewing-private.h:25,
from testhelper.c:18:
../src/porting_layer/include/plat_mmap.h:26: error: expected ')' before '*' toke
n
../src/porting_layer/include/plat_mmap.h:29: error: expected ')' before '*' toke
n
../src/porting_layer/include/plat_mmap.h:32: error: expected ')' before '*' toke
n
../src/porting_layer/include/plat_mmap.h:35: error: expected ')' before '*' toke
n
../src/porting_layer/include/plat_mmap.h:38: error: expected ')' before '*' toke
n
../src/porting_layer/include/plat_mmap.h:47: error: expected ')' before '*' toke
n
In file included from testhelper.c:18:
../include/internal/chewing-private.h:148: error: expected specifier-qualifier-l
ist before 'plat_mmap'
make: *** [testhelper.lo] Error 1

想請問那兒有問題?我從

$ rm CMakeCache.txt
$ cmake .
$ make
$ cd test/

做下來的,請教問題在哪?Thanks!

ChangZhuo Chen

unread,
Aug 29, 2013, 7:05:11 AM8/29/13
to chewin...@googlegroups.com

On Thursday, August 29, 2013 12:00:12 PM UTC+8, 博丞 詹 wrote:
To CZChen:

我從 libchewing master checkout 出來的東西,cmake 還是怪怪的:

$ make
  CC     testhelper.lo

你可以試試看用以下 command 把 code 清乾淨,再跑 cmake 試試看:

git reset --hard HEAD
git clean -fdx
cmake .
make

Jim Huang

unread,
Aug 30, 2013, 4:03:39 AM8/30/13
to Chewing-Dev, ChangZhuo Chen
hi czchen,

我剛剛陪博丞看了一下,現在 GitHub pull request 頁面的操作,對視覺障礙的朋友
很不友善,太多下拉選單,而且畫面改變量比較大。在還沒找出有效的處理方式
之前,或許我們就先用郵件討論,指定特定的 git commit 來作 merge.

Thanks,
-jserv

在 2013年8月26日下午8:43,ChangZhuo Chen <czc...@gmail.com> 寫道:
> code 的部份可以使用 github 的 pull request 嗎?這樣 review 比較方便。
[...]

ChangZhuo Chen

unread,
Aug 30, 2013, 9:07:09 AM8/30/13
to chewin...@googlegroups.com, ChangZhuo Chen


On Friday, August 30, 2013 4:03:39 PM UTC+8, jserv wrote:
hi czchen,

我剛剛陪博丞看了一下,現在 GitHub pull request 頁面的操作,對視覺障礙的朋友
很不友善,太多下拉選單,而且畫面改變量比較大。在還沒找出有效的處理方式
之前,或許我們就先用郵件討論,指定特定的 git commit 來作 merge.


ok,我有用 cherry-pick 整理部份的 code [1],不過還不確定哪部份先 merge 比較好。

pull request 部份可以直接聯絡 github [2],看他們有沒有辦法改成比較容易操作。
 

WM

unread,
Aug 30, 2013, 12:11:29 PM8/30/13
to chewin...@googlegroups.com, ChangZhuo Chen
有試過操作看看Github的Windows Client程式嗎?雖然可能不會比較好用。

ChangZhuo Chen於 2013年8月30日星期五UTC+8下午9時07分09秒寫道:

詹博丞

unread,
Aug 30, 2013, 1:21:44 PM8/30/13
to chewin...@googlegroups.com
To CZChen:

我又重整一次:

https://github.com/school510587/general_index_libchewing/tree/again_rwdb_review

這次要求每個 commit 皆可 build+test, 但有個 rewrite char.c, 不是我的意思,是 commit
--amend 過程自己變這樣,那次 cherry-pick 中我沒有 rewrite 行動,然後 init_database style
又有調整,我已經盡量把認為 out of style 去除,但來源 sort&maketree 本來風格就不一致

exception phrase 可否請你替我還原?當初 BBS 應該就是不考慮 UTF-8, 所以這也許不被視為 bug,
不過我還是寫在這裡,我用 PCMan 2003 or PCManX 0.1.7.6

另外 WM 說的 client, 我會再嘗試,不過螢幕閱讀也是軟體,所以我受它限制,包括 client 或其他 console
遠端軟體,都會因為螢幕閱讀不支援而無法使用

Please review again, thanks!

ChangZhuo Chen

unread,
Sep 2, 2013, 6:15:11 AM9/2/13
to chewin...@googlegroups.com


On Saturday, August 31, 2013 1:21:44 AM UTC+8, 博丞 詹 wrote:
To CZChen:

我又重整一次:

https://github.com/school510587/general_index_libchewing/tree/again_rwdb_review

這次要求每個 commit 皆可 build+test, 但有個 rewrite char.c, 不是我的意思,是 commit
--amend 過程自己變這樣,那次 cherry-pick 中我沒有 rewrite 行動,然後 init_database style
又有調整,我已經盡量把認為 out of style 去除,但來源 sort&maketree 本來風格就不一致 

你的 code 我先發個 pull request [1],這樣其他人比較方便 review。之後會再把要改的地方回到這裡。

目前 unit test 會發生 Segmentation fault,不過 cannot reprocedure in local。

build 會有 warning,這部份我可以幫忙修。

我的習慣是 commit 前會先 build & test,以確保每個 commit 都是好的。不過如果是 cherry-pick,就比較難保證每個 commit 都是好的。所以盡量改一部分就趕快送 patch,這樣就不用一直 cherry-pick & rebase。


詹博丞

unread,
Sep 2, 2013, 8:18:04 AM9/2/13
to chewin...@googlegroups.com
To CZChen:

應該是 init_database 當掉,可是前面有成功的案例,我自己測枚失敗過,這種問題請問如何解決比較好?我目前不知道如何用 GDB,
不清楚 PCMan 有沒支援,thanks

好像有位大大也叫做 PCMan 啊真是巧合...

WM

unread,
Sep 2, 2013, 9:42:30 AM9/2/13
to chewin...@googlegroups.com, pcma...@gmail.com
是阿,真的好巧喔,哈哈哈。

他就是PCMan的作者啊。

博丞 詹於 2013年9月2日星期一UTC+8下午8時18分04秒寫道:

詹博丞

unread,
Sep 2, 2013, 10:02:49 AM9/2/13
to chewin...@googlegroups.com
那~~可否請教他一下,怎樣讓 PCMan 支援 UTF8?!...thanks

PCManX 遇到某些狀況還會當掉~~據說是去除了 B 版不用的功能?!...

在 2013/9/2,WM <wand...@gmail.com> 撰寫:
> 是阿,真的好巧喔,哈哈哈。
>
> 他就是PCMan的作者啊。
>
> 博丞 詹於 2013年9月2日星期一UTC+8下午8時18分04秒寫道:
>>
>> To CZChen:
>>
>> 應該是 init_database 當掉,可是前面有成功的案例,我自己測枚失敗過,這種問題請問如何解決比較好?我目前不知道如何用 GDB,
>> 不清楚 PCMan 有沒支援,thanks
>>
>> 好像有位大大也叫做 PCMan 啊真是巧合...
>>
>> 在 2013/9/2,ChangZhuo Chen <czc...@gmail.com <javascript:>> 撰寫:
>> >
>> >
>> > On Saturday, August 31, 2013 1:21:44 AM UTC+8, 博丞 詹 wrote:
>> >>
>> >> To CZChen:
>> >>
>> >> 我又重整一次:
>> >>
>> >>
>> >>
>> https://github.com/school510587/general_index_libchewing/tree/again_rwdb_review
>>
>> >>
>> >>
>> >> 這次要求每個 commit 皆可 build+test, 但有個 rewrite char.c, 不是我的意思,是 commit
>> >> --amend 過程自己變這樣,那次 cherry-pick 中我沒有 rewrite 行動,然後 init_database style
>> >> 又有調整,我已經盡量把認為 out of style 去除,但來源 sort&maketree 本來風格就不一致
>> >
>> >
>> > 你的 code 我先發個 pull request [1],這樣其他人比較方便 review。之後會再把要改的地方回到這裡。
>> >
>> > 目前 unit test 會發生 Segmentation fault,不過 cannot reprocedure in local。
>> >
>> > build 會有 warning,這部份我可以幫忙修。
>> >
>> > 我的習慣是 commit 前會先 build & test,以確保每個 commit 都是好的。不過如果是
>> cherry-pick,就比較難保證每個
>> > commit 都是好的。所以盡量改一部分就趕快送 patch,這樣就不用一直 cherry-pick & rebase。
>> >
>> >
>> > [1] https://github.com/chewing/libchewing/pull/70
>> > [2] https://travis-ci.org/czchen/libchewing/builds/10887443
>> >
>> > --
>> > 您已訂閱「Google 網上論壇」的「Chewing IM Development」群組,因此我們特別傳送這封郵件通知您。
>> > 如要取消訂閱這個群組並停止接收來自這個群組的郵件,請傳送電子郵件到
>> > chewing-deve...@googlegroups.com <javascript:>。
>> > 如要在此群組張貼留言,請傳送電子郵件至 chewin...@googlegroups.com <javascript:>。

ChangZhuo Chen

unread,
Sep 2, 2013, 11:18:43 AM9/2/13
to chewin...@googlegroups.com
On Monday, September 2, 2013 8:18:04 PM UTC+8, 博丞 詹 wrote:
To CZChen:

應該是 init_database 當掉,可是前面有成功的案例,我自己測枚失敗過,這種問題請問如何解決比較好?我目前不知道如何用 GDB,
不清楚 PCMan 有沒支援,thanks


我這裡 reprocedure 不出來,可能要請你把 core,init_database 或是 call stack 丟出來才有辦法看。

在 Linux 下,你要先把 ulimit for core 調到 unlimited

ulimit -c unlimited

接下來開始 reprocedure,當 seg fault 時,會有個 core.???? 的檔案,檔名會根據系統設定,所以可能長的不太一樣。
當有 core 檔時,用下面的 command 載入 gdb。

gdb init_database core

然後在 gdb 內打 bt,就可以看到 call stack 了。

詹博丞

unread,
Sep 2, 2013, 12:29:09 PM9/2/13
to chewin...@googlegroups.com
To CZChen:

tree 中「國民」兩個音找完後,「國民」的 leaf 會與「大」的分支在同一層,用 key==0 分辨,所以我的
TreeFindPhrase() 有個修正 half-phrase error 指的與這件事有關

不太懂 one line, one variable 的意思?當初 begin, end 沒有調 unsigned, 好像因為原本
child_begin, child_end 就沒用無號

在 2013/9/2,ChangZhuo Chen <czc...@gmail.com> 撰寫:

詹博丞

unread,
Sep 2, 2013, 2:48:10 PM9/2/13
to chewin...@googlegroups.com
To CZChen:

freq 當初沒設 unsigned, 因為考慮創見時有些比較採用減法,避免 overflow

順便解釋一下,TreeType 蔓延整個 libchewing 多個檔案,所以其實也無法只改幾行就 commit, 我的整理中把 data
integration & code integration
分開,是我目前能達到的極限,或者各位有更棒的方法對付這種底層資料結構的改變,可否分享一下?

Thanks!

ChangZhuo Chen

unread,
Sep 3, 2013, 7:57:47 AM9/3/13
to chewin...@googlegroups.com
Hi 博丞,

crash 部份把 compiler warnings 修好就可以了。問題是 uninitialized last_phr。

- key == 0 這部份建議改成 key == 0xffff,phone = 0 的發音是 ㄅ一ㄚ,phone = 0xffff 是沒有發音的。

one line, one variable 是指避免寫下面這樣

int child_begin, child_end;

最好是寫成下面這樣

int child_begin;
int child_end;

這樣如果其中一個變數要改的時候 diff 會比較清楚。

  • 目前的 tree node 是 12 bytes,可以再壓縮到 8 bytes,像下面樣:
struct {
    uint16_t key;
    union {
        struct {
            uint8_t begin_high;
            uint8_t end_high;
            uint16_t begin_low;
            uint16_t end_low;
        } child;
        struct {
            uint8_t pos_high;
            uint8_t freq_high;
            uint16_t pos_low;
            uint16_t freq_low;
        } leaf;
    };
};

begin, end, pos, freq 都變成 3 bytes。
目前 tree node 個數是 310559
dictionary.dat 的大小是 1217590


缺點
- begin, end, pos, freq 這 4 個數字再使用時需要重算。

優點
- dictionary.dat 從 3726708 變成 2484472

詹博丞

unread,
Sep 3, 2013, 11:00:04 AM9/3/13
to chewin...@googlegroups.com
To CZChen:

關於建議回應如下:

感謝你抓掉 last_phr, 蓁是愚蠢的疏忽

-1 代表沒有注音,這件事情想請教從哪裡求得?整個 code 並無明顯指示,zuinData 也是整塊清光為 0, 若當初設計就是 -1
是沒發音的意思,那隨時可以調整,只是我可能會改成 #define NULL_ZUIN -1 類似這樣...

struct 縮水部分,要不然就這樣用:
#pragma pack(1)
typedef struct {
uint16_t key;
union {
struct {
uint32_t begin:24;
uint32_t end:24;
};
struct{
uint32_t phrase:24;
uint32_t freq:24;
};
};
} TreeType;
#pragma pack()

應該 sizeof 以後會 8, 除非我又筆誤,但當初強迫對齊應該是餵了效率吧,我以往和 jserv 聊的時候他的立場多在不增加
runtime overhead, 要是你們認為 high/low 這種藥用時重新計算不會影響 delay, 可以再花時間調整,若我寫這個
pack 的方式你們接受,直接替換就好比較省力,若大家認為 12 bytes 也沒關係就維持現狀吧,請告訴我比較好的選擇

我接到回應就參考大家的一件再調整,但若決定 high/low 的劃調整惠曼很多,用 #pragma 的話不知有無編譯器不吃這套,而我原先用
uint32_t key 也是為了和我後半段的非注音的支援接軌

Thanks!

P.S. 會有編譯器不吃 #pragma pack()? 我沒用過 VC, M$ 的 GUI 超不友善的,就跟你們改 TSF chewing
給 Win8 用的時候那種感覺應該很像 ...


在 2013/9/3,ChangZhuo Chen <czc...@gmail.com> 撰寫:
> Hi 博丞,
>
> - crash 部份把 compiler warnings 修好就可以了。問題是 uninitialized last_phr。
>
> - key == 0 這部份建議改成 key == 0xffff,phone = 0 的發音是 ㄅ一ㄚ,phone = 0xffff 是沒有發音的。
>
> - one line, one variable 是指避免寫下面這樣
>
> int child_begin, child_end;
>
> 最好是寫成下面這樣
>
> int child_begin;
> int child_end;
>
> 這樣如果其中一個變數要改的時候 diff 會比較清楚。
>
>
> - 目前的 tree node 是 12 bytes,可以再壓縮到 8 bytes,像下面樣:
>
> struct {
> uint16_t key;
> union {
> struct {
> uint8_t begin_high;
> uint8_t end_high;
> uint16_t begin_low;
> uint16_t end_low;
> } child;
> struct {
> uint8_t pos_high;
> uint8_t freq_high;
> uint16_t pos_low;
> uint16_t freq_low;
> } leaf;
> };
> };
>
> begin, end, pos, freq 都變成 3 bytes。
> 目前 tree node 個數是 310559
> dictionary.dat 的大小是 1217590
>
>
> 缺點
> - begin, end, pos, freq 這 4 個數字再使用時需要重算。
>
> 優點
> - dictionary.dat 從 3726708 變成 2484472
>

ChangZhuo Chen

unread,
Sep 3, 2013, 12:25:55 PM9/3/13
to chewin...@googlegroups.com, 朱昱任
Add 小朱 for libchewing memory footprint in Firefox OS.

On Tuesday, September 3, 2013 11:00:04 PM UTC+8, 博丞 詹 wrote:
To CZChen:  

感謝你抓掉 last_phr, 蓁是愚蠢的疏忽


下次記得 warning 要修阿。
 
-1 代表沒有注音,這件事情想請教從哪裡求得?整個 code 並無明顯指示,zuinData 也是整塊清光為 0, 若當初設計就是 -1
是沒發音的意思,那隨時可以調整,只是我可能會改成 #define NULL_ZUIN -1 類似這樣...

目前 phone 總共用掉 14 bits,所以第 15 / 16 bits 沒有用,目前都是設成 0。
如果要表示沒有 phone,拿這兩個 bit 來用會比較好。-1 是隨便選的。

應該 sizeof 以後會 8, 除非我又筆誤,但當初強迫對齊應該是餵了效率吧,我以往和 jserv 聊的時候他的立場多在不增加
runtime overhead, 要是你們認為 high/low 這種藥用時重新計算不會影響 delay, 可以再花時間調整,若我寫這個
pack 的方式你們接受,直接替換就好比較省力,若大家認為 12 bytes 也沒關係就維持現狀吧,請告訴我比較好的選擇

改成 8 bytes per node 最主要是 tree size 和 alignment 考量

size 部份 index_tree.dat 3726708  -> 2484472。印象中小朱有說過 libchewing 在 Firefox OS 上用的 memory 太多。不過我忘了要
到多少才 ok。

alignment 部份 12 bytes (4 byte aligned) -> 8 bytes (8 byte aligned)。剛剛查了一下,4 byte aligned 好像就夠了。

overhead 的部份,兩個都是 aligned memory access,只差在 8 bytes 需要作 high * 0x10000 + low,感覺是差不多。


這部份先用 12 bytes 來 review,我再問問看小朱詳細的數字。


dictionary.dat 和 index_tree.dat 可以在前面加個 8 bytes 的 magic bytes 和 version number 嗎?這樣可以知道目前 binary 是
哪種 format。magic bytes 大概就像下面這樣:

tree\0\0\0\0
dict\0\0\0\0 

詹博丞

unread,
Sep 3, 2013, 12:45:32 PM9/3/13
to chewin...@googlegroups.com
有了小朱的加入,我的 memory problem 可在數小時內解掉嗎?

詹博丞

unread,
Sep 6, 2013, 9:58:51 AM9/6/13
to chewin...@googlegroups.com
Dear all:

我再整理了一個 branch:

https://github.com/school510587/general_index_libchewing/tree/rwdb_8bytes_review

這次考慮 CZChen 的建議,對 init_database.c, tree.c 讓變數分行書寫

另外資料壓縮部份先取 #pragma 方式,可編譯、測試成功,此法所需的修改最少

請再替我 review 看能否整合回 libchewing, thanks!

詹博丞

unread,
Sep 6, 2013, 2:58:45 PM9/6/13
to chewin...@googlegroups.com
抱歉,今天才發現 CZChen 有多封 review 被丟到垃圾信件,但 Google 信箱有部分介面真的也對盲人不友善,才用奇摩就有這問題,回應如下:

1. else clausre here is unnecessary because if returns.

看訊息不清楚指的是哪段?

2. Error shall be reported here because there is duplicated word.

我檢查的重點是同字異音,不要讓它們在辭典裡多個 instances, 但發音不同在建樹時仍須保留

3. ?: 選擇 iterator 以外東西造成混亂

這邊我會再調整

4. 之前沒檢查過 duplicate words/phrases?

the same as 2.

5. merge 用 qsort 增強可讀

在這步之前已經有兩邊都 strcmp 過,但寫在不同的 function, 我目前並不打算將它們移到這 loop 旁邊,word
部分考慮到未來整合我第二階段製作,既然這邊不改那 phrase 也不想改以維持一致,我會再加強註解以彌補這部份

6. indent 7

我這邊的確覺得複雜,會再改看看

以上要修改的地方我會合並入 rwdb_8bytes_review, thanks!

Kuang-che Wu

unread,
Sep 6, 2013, 10:59:48 PM9/6/13
to chewin...@googlegroups.com
On Sat, Sep 07, 2013 at 02:58:45AM +0800, 詹博丞 wrote:
> 抱歉,今天才發現 CZChen 有多封 review 被丟到垃圾信件,但 Google 信箱有部分介面真的也對盲人不友善,才用奇摩就有這問題,回應如下:
gmail 對盲人不友善的問題可以告訴我, 我幫忙反應看看.

詹博丞

unread,
Sep 7, 2013, 1:04:03 AM9/7/13
to chewin...@googlegroups.com
To Kuang-che Wu:

我用的螢幕閱讀系統是淡江大學開發的視窗導盲鼠 (G-Mouse) V7.14

操作網頁方式是用 tab / shift+tab 作為 next / prev tabstop(link, button, checkbox, etc.)

我所謂不友善,是上次 jserv 給了 iconv 測試的 .c file, 我用 gmail 收發現用這樣操作無法抓取夾檔,jserv
因此把我 Yahoo 信箱加進來論壇,只是你們心目中我還是 school510587@gmail 我也不想亂換

拜託你替我反映看看,多謝!

Kuang-che Wu

unread,
Sep 7, 2013, 3:20:30 AM9/7/13
to chewin...@googlegroups.com
G-Mouse 有提供免費下載嗎? 我一時沒找到試用的方法.
G-Mouse 本身就內建瀏覽器嗎? 還是是透過讀一般瀏覽器的畫面? 若是後者,
你用哪個瀏覽器?

我在 chrome browser 裡, 按 tab 鍵可以移到附件的 "檢視" 跟 "下載" link.

還請你或 jserv 再解釋遇到的問題.

詹博丞

unread,
Sep 7, 2013, 3:37:09 AM9/7/13
to chewin...@googlegroups.com
G-Mouse 有保護鎖,請參考這個是更新安裝,但無法不靠 Keypro 正常執行:

http://www.batol.net/gm/

反正就是要錢,它透過 M$ Active Accessibility 看螢幕的,這個偶爾又常當掉 ... 畢竟是 M$$$$$$

另外瀏覽器是 IE6, 因為 FF, Chrome 用這套閱讀操作也不順利,才盡量用過時但較友善的工具

其實我有裝 Chrome, 但我愛用 Ctrl+F
找已知廉潔,因為我「視野」只有當下連結上的文字,跳尋已知廉潔相形重要,卻按這組合鍵後都「真糟糕 Chrome 壞掉了」,才不願意用它嚐試看看
...

Kuang-che Wu

unread,
Sep 7, 2013, 4:08:12 AM9/7/13
to chewin...@googlegroups.com
不曉得你有沒有朋友試過 IE8 跟 G-Mouse 的相容性?

gmail 已經宣告不支援 IE6, IE7 了. 所以可能的方向一是看新版 IE 有沒有比較好,
或是修 Chrome 會 "壞掉" 的問題.

如果有具體的步驟能重現 Chrome 的 bug, 建議可以到 chromium 的 issue tracker 回報.
https://code.google.com/p/chromium/issues/list?q=label:Cr-UI-Accessibility
回報時加上 label Cr-UI-Accessibility

詹博丞

unread,
Sep 7, 2013, 4:22:28 AM9/7/13
to chewin...@googlegroups.com
IE8 用過了,不接受原因為面對一個完全未知網頁,我 tab 要先經過多個「我的最愛。「搜尋列」等不必要的按鈕,才進入網頁部份,讓我辦事效率大減

有人說 Chrome 會當因為我沒設定什麼,不過我認為鼠時的話 Chrome
也要負提醒責任而不是直接結束,但我學校電腦上的就不會這樣,所以原因待查,而且閱讀一般 App 的 help 也有點障礙,因為 tab /
shift+tab 這方式是所有視窗通用而非只限網頁 ... 總之感謝協助

Kuang-che Wu

unread,
Sep 7, 2013, 4:40:45 AM9/7/13
to chewin...@googlegroups.com
IE8 的部份, [F6] 鍵可以在 "網址", "我的最愛", "網頁內容" 三者切換,
所以在網頁瀏覽時, 連按三下 F6, 就可以跳到網頁的第一個 tabstop, 之後再開始用 tab.
這樣可以省幾次 tab 鍵, 希望對你有幫助.

詹博丞

unread,
Sep 8, 2013, 12:03:27 AM9/8/13
to chewin...@googlegroups.com

詹博丞

unread,
Sep 8, 2013, 1:39:52 AM9/8/13
to chewin...@googlegroups.com
遭~~忘了解釋 -1 null 注音的問題

我看了 key2pho.c 後,不認為 0 有意義

if ( zhuin_index >= ZUIN_SIZE ) {
return 0;
}

的意思是,四種注音都不是時,導致失敗收場,這邊給的是 0

還有 phoneid.dic 時代,也用 0 辨認注音序列的結尾

我也丟過 0 給 PhoneFromUint() 結果是空的,ㄅㄧㄚ轉整數有六百多

ChangZhuo Chen

unread,
Sep 8, 2013, 4:23:31 AM9/8/13
to chewin...@googlegroups.com
Sorry, 是我搞錯了。

詹博丞

unread,
Sep 8, 2013, 5:40:26 AM9/8/13
to chewin...@googlegroups.com
我知道了,非常感謝,快速鍵是有效的,不過我暫時借別人電腦測試,自己電腦測好真的還有問題再呈報

詹博丞

unread,
Sep 8, 2013, 7:44:49 AM9/8/13
to chewin...@googlegroups.com
Dear all:

我有個想法,把 PhraseData 裡的 phrase[] 改成 *phrase, runtime 再 strdup

這樣能少 make time 0.5s, 去掉一個不小的 macro (149), 減少 qsort 花在記憶體搬移的時間,陣列大小也不被辭典的改變綁死

缺點是老問題,動態指標的就是較難管理

請教這樣的修改值得嗎?若各位認為沒有必要,我就不釋出 review

另外剛才說要請各位再 review 的,一樣是 rwdb_8bytes_review branch 喔,懶得替新分支取名字~~

Thanks

在 2013/9/8,ChangZhuo Chen <czc...@gmail.com> 撰寫:
> Sorry, 是我搞錯了。
>
> On Sunday, September 8, 2013 1:39:52 PM UTC+8, 博丞 詹 wrote:
>>
>> 遭~~忘了解釋 -1 null 注音的問題
>>
>> 我看了 key2pho.c 後,不認為 0 有意義
>>
>> if ( zhuin_index >= ZUIN_SIZE ) {
>> return 0;
>> }
>>
>> 的意思是,四種注音都不是時,導致失敗收場,這邊給的是 0
>>
>> 還有 phoneid.dic 時代,也用 0 辨認注音序列的結尾
>>
>> 我也丟過 0 給 PhoneFromUint() 結果是空的,ㄅㄧㄚ轉整數有六百多
>>
>> 在 2013/9/8,詹博丞 <school...@gmail.com <javascript:>> 撰寫:
>> >>>> chewing-deve...@googlegroups.com <javascript:>。
>> >>>> 如要在此群組張貼留言,請傳送電子郵件至 chewin...@googlegroups.com <javascript:>。
Reply all
Reply to author
Forward
0 new messages