chewing / chewing-editor

Cross platform chewing user phrase editor
https://chewing.im/
GNU General Public License v2.0
30 stars 52 forks source link

Adding new phrase will add deleted words #209

Closed qas612820704 closed 7 years ago

qas612820704 commented 7 years ago

When typing phrase at Add new phrase,

I types 哈哈 and deleted it, then types 泥馬 and deleted it, finally types 雞排 and presses OK.

I expects it will only add 雞排, but 哈哈 and 泥馬 (this two one is deleted) comes out like the below figures.

screenshot from 2017-04-10 01-00-53 screenshot from 2017-04-10 01-01-00

And this is the log text

Debug: Add "雞排" ( "" ) ((null) :0)
Debug: [chewingio.c:1996 chewing_userphrase_add] API call:  ((null) :0)
Warning: chewing_userphrase_add() returns 0 ((null) :0)
Debug: [chewingio.c:1859 chewing_userphrase_enumerate] API call:  ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: [chewingio.c:1936 chewing_userphrase_get] API call:  ((null) :0)
Debug: Get userphrase: 哈哈 ㄏㄚ ㄏㄚ ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: [chewingio.c:1936 chewing_userphrase_get] API call:  ((null) :0)
Debug: Get userphrase: 泥馬 ㄋㄧˊ ㄇㄚˇ ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: [chewingio.c:1936 chewing_userphrase_get] API call:  ((null) :0)
Debug: Get userphrase: 雞排 ㄐㄧ ㄆㄞˊ ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: Total userphrase 3 ((null) :0)
Debug: 3 ((null) :0)
Debug: "雞排" "ㄐㄧ ㄆㄞˊ" ((null) :0)
Debug: [chewingio.c:2036 chewing_userphrase_remove] API call:  ((null) :0)
Debug: "泥馬" "ㄋㄧˊ ㄇㄚˇ" ((null) :0)
Debug: [chewingio.c:2036 chewing_userphrase_remove] API call:  ((null) :0)
Debug: "哈哈" "ㄏㄚ ㄏㄚ" ((null) :0)
Debug: [chewingio.c:2036 chewing_userphrase_remove] API call:  ((null) :0)
Debug: 3 ((null) :0)
Debug: Add "雞排" ( "" ) ((null) :0)
Debug: [chewingio.c:1996 chewing_userphrase_add] API call:  ((null) :0)
Warning: chewing_userphrase_add() returns 0 ((null) :0)
Debug: [chewingio.c:1859 chewing_userphrase_enumerate] API call:  ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: [chewingio.c:1936 chewing_userphrase_get] API call:  ((null) :0)
Debug: Get userphrase: 哈哈 ㄏㄚ ㄏㄚ ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: [chewingio.c:1936 chewing_userphrase_get] API call:  ((null) :0)
Debug: Get userphrase: 泥馬 ㄋㄧˊ ㄇㄚˇ ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: [chewingio.c:1936 chewing_userphrase_get] API call:  ((null) :0)
Debug: Get userphrase: 雞排 ㄐㄧ ㄆㄞˊ ((null) :0)
Debug: [chewingio.c:1887 chewing_userphrase_has_next] API call:  ((null) :0)
Debug: Total userphrase 3 ((null) :0)
Debug: 3 ((null) :0)
david50407 commented 7 years ago

First, Chewing will auto-learn all phrase user typed. In this case, "哈哈", "泥馬" and "雞排" should be all learned from this method.

And, while adding a phrase you should provide not only chinese charactors but also bopomofo (split each word by space) (#2), so your log outputs below showed that you add the pharse failed.

Debug: Add "雞排" ( "" ) ((null) :0)
Debug: [chewingio.c:1996 chewing_userphrase_add] API call:  ((null) :0)
Warning: chewing_userphrase_add() returns 0 ((null) :0)

I'm going to close this issue, if you have more questions about this, you can re-open it. Thx.

qas612820704 commented 7 years ago

@david50407. I got it, thanks you.