Comments (13)
@czchen 其實用網頁前端 + python + ctypes 來寫,理論上應該比 Qt 簡單 XD
from pime.
目前已經有使用者詞庫編輯工具(Chewing-editor),只是還沒有 Windows 版本的編譯
from pime.
@ottokang 你願意幫忙編譯嗎?
那個還得先編譯 Qt,有點小繁瑣,一時沒有空可以弄
from pime.
正在研究,我再試試看,如果不行再到 Chewing-editor 那邊問
from pime.
Windows 版本是這個嘛?
https://github.com/Chocobo1/chewing-editor-build
不過剛剛試了似乎與PIME的使用者詞庫不相容。
之前這位開發者也有做 TSF版新酷音 的非官方修正版?
from pime.
@Chinan Windows 版本可以請教原開發者 @czchen 看如何 build
from pime.
@ottokang 我剛抽空實驗了一下,其實挺簡單,以下 python code 可以列出所有使用者自訂辭
from libchewing import ChewingContext
from ctypes import *
def main():
ctx = ChewingContext()
phrase_len = c_uint(0)
bopomofo_len = c_uint(0)
ctx.userphrase_enumerate()
while ctx.userphrase_has_next(byref(phrase_len), byref(bopomofo_len)):
phrase_buf = create_string_buffer(phrase_len.value)
bopomofo_buf = create_string_buffer(bopomofo_len.value)
ctx.userphrase_get(phrase_buf, phrase_len, bopomofo_buf, bopomofo_len)
phrase = phrase_buf.raw.decode("utf8")
bopomofo = bopomofo_buf.raw.decode("utf8")
print(phrase, " => ", bopomofo)
if __name__ == "__main__":
main()
所有相關 API 可參考 libchewing 的 chewingio.h,大約就這些
CHEWING_API int chewing_userphrase_enumerate(ChewingContext *ctx);
CHEWING_API int chewing_userphrase_has_next(ChewingContext *ctx, unsigned int *phrase_len, unsigned int *bopomofo_len);
CHEWING_API int chewing_userphrase_get(ChewingContext *ctx,
char *phrase_buf, unsigned int phrase_len,
char *bopomofo_buf, unsigned int bopomofo_len);
CHEWING_API int chewing_userphrase_add(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf);
CHEWING_API int chewing_userphrase_remove(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf);
CHEWING_API int chewing_userphrase_lookup(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf);
from pime.
@ottokang 至於 UI 部分其實用 https://github.com/6pac/SlickGrid 來做效果很好
用 slick grid 的 dataview 來顯示表格,可以新增移除,分頁,還可以 search
請參考
from pime.
@ottokang Windows chewing-editor 很久以前有試著做過,Qt 那裡很難搞。如果要大量匯入,建議是直接使用 libchewing API。
from pime.
網頁 based 的辭庫編輯器,初版完成
6aace34
from pime.
感謝!最近真的忙到沒空研究,我再看看有沒有可以測試修改的地方
from pime.
剛剛測試了一下 Python code,沒辦法列出所有的使用者詞庫,似乎是 ChewingContext() 初始化沒有讀取到詞庫資料。
from pime.
@ottokang 感謝,已經修正 0.16-dev branch
from pime.
Related Issues (20)
- 在win11 Sticky Notes打字會高亮 HOT 1
- 希望增加輸入時按「空白鍵」、「全形標點符號」即可輸出文字
- user_freq參數會變成負數的問題 HOT 2
- PIME的輸入法引擎支援linux輸入法平台的可行與否? HOT 1
- 特定情況注音如果輸入到一半切換成英文輸入會卡住 HOT 1
- 設定新酷音輸入法
- 行列輸入法設定在Win10下無法勾選「直接顯示候選字清單 (不須按空白鍵)」
- 請問全型標點符號的選字候補有辦法自定義嗎?亦或是設置為直接上屏標點 HOT 2
- 请问如何修改默认python的目录 HOT 1
- windows emoji搜尋功能 HOT 1
- 關閉 Shift 中英切換,但在未知的狀況下會自動變成英文模式且無法切換 HOT 1
- 已解決 「自由大新倉頡」開啟「標點符號自動確認輸入」後,無法輸出部分「;」開頭的字,例如「黏」 HOT 2
- 「自由大新倉頡」使用「萬用字元查詢」時,某些情況會自動出字並切換為「英文」模式
- 關於 ctrl + delete 功能,在1.3.0 stable 版本是否失效? HOT 1
- 蝦米輸入法的數字選字功能
- user_freq值會跳成負數的問題 HOT 2
- 切換成大易輸入法時方向鍵及enter無法使用
- 建議可增加單字說明注記功能、長單字易打 HOT 1
- 實裝提昇/降低優先度(user_freq)的快捷鍵 HOT 14
- 沒辦法在 Minecraft 中輸入 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pime.