Deprecate userphrase-hash?

64 views
Skip to first unread message

Kan-Ru Chen

unread,
Feb 6, 2023, 9:13:52 AM2/6/23
to chewing-devel
Hi,

目前 Rust 版的 libchewing 只有兩種字典格式,其中 sqlite 是唯一可以寫入的。
原本我是沒有打算實做 uhash.dat 字典格式的,因為現在的檔案操作有機會造成字典
檔案損毀,sqlite 則幾乎沒有此問題。

想問問各位夥伴,覺得有沒有需要保留 uhash.dat 的支援,並盡可能的讓檔案操作更
安全。若是覺得有需要的話我就開 issue 追蹤。

如果沒有意見的話,我就當作決議在 v1.0.0 移除 uhash.dat 的實做,僅提供轉換
格式的支援。

Kan-Ru

ChangZhuo Chen (陳昌倬)

unread,
Feb 6, 2023, 9:17:18 AM2/6/23
to chewin...@googlegroups.com
+1 to keep only sqlite implementation.


--
ChangZhuo Chen (陳昌倬) czchen@{czchen,debian}.org
http://czchen.info/
Key fingerprint = BA04 346D C2E1 FE63 C790 8793 CC65 B0CD EC27 5D5B
signature.asc

Jim Huang

unread,
Feb 6, 2023, 9:25:23 AM2/6/23
to Chewing-Dev
Kan-Ru Chen <ka...@kanru.info> 於 2023年2月6日 週一 下午10:13寫道:
> 目前 Rust 版的 libchewing 只有兩種字典格式,其中 sqlite 是唯一可以寫入的。
> 原本我是沒有打算實做 uhash.dat 字典格式的,因為現在的檔案操作有機會造成字典
> 檔案損毀,sqlite 則幾乎沒有此問題。
> 想問問各位夥伴,覺得有沒有需要保留 uhash.dat 的支援,並盡可能的讓檔案操作更
> 安全。若是覺得有需要的話我就開 issue 追蹤。

我也贊成移除 uhash.dat (自 2006 年起就沒有維護的特別格式),改用 SQLite 資料庫來處理使用者自訂詞彙,可讓詞彙編輯工具更容易撰寫與維護。

Thanjs,
-jserv

Sponge Jhan

unread,
Feb 6, 2023, 1:37:13 PM2/6/23
to chewin...@googlegroups.com
Hi Kan-Ru Chen & all,

大家都決定停止支援 uhash.dat,那我能否詢問一下
我不是用 Visual Studio 而是 MinGW 在 Windows 上編譯的話

- cmake 指令如何下?
- 去哪裡找 .h 檔?

有此一問,因為從 SQLite Download Page 抓下來的 sqlite-dll-win32-x86-3400100.zip 只有 .def, .dll 沒有 .h 檔

Thanks.

  sincerely yours
   Bo-cheng Jhan

Kan-Ru Chen

unread,
Feb 6, 2023, 6:01:19 PM2/6/23
to chewing-devel
Hi,

On Tue, Feb 7, 2023, at 3:37 AM, 'Sponge Jhan' via Chewing IM Development wrote:
Hi Kan-Ru Chen & all,

大家都決定停止支援 uhash.dat,那我能否詢問一下
我不是用 Visual Studio 而是 MinGW 在 Windows 上編譯的話

- cmake 指令如何下?
- 去哪裡找 .h 檔?

有此一問,因為從 SQLite Download Page 抓下來的 sqlite-dll-win32-x86-3400100.zip 只有 .def, .dll 沒有 .h 檔

Windows 上應該要用 libchewing 自帶的 sqlite-amalgamation,這樣在安裝的時候也不需要另外安裝 libsqlite3.dll

cmake 的指令跟用 Visual Studio 的時候一樣:

    cmake -B build -DWITH_SQLITE3=ON -DWITH_INTERNAL_SQLITE3=ON

如果想要用 libsqlite3.dll 的話,可以用 vcpkg 或是 msys2 的 pacman 安裝


也許我們可以產生一個 CMakePresets.json 來列出常用的 presets?

Kan-Ru

Sponge Jhan

unread,
Feb 7, 2023, 4:43:03 PM2/7/23
to chewin...@googlegroups.com
Hi Kan-Ru,

謝謝回答,我的 MinGW 以後知道怎樣編譯了

不過我比較無聊,讓它開 -Wall 結果吐出幾個警告,就貼在後面分享 :)

  sincerely yours
   Bo-cheng Jhan


D:\libchewing\thirdparty\sqlite-amalgamation\sqlite3.c: In function 'sqlite3ThreadJoin':
D:\libchewing\thirdparty\sqlite-amalgamation\sqlite3.c:32865:8: warning: variable 'bRc' set but not used [-Wunused-but-set-variable]
BOOL bRc;
^~~
At top level:
D:\libchewing\thirdparty\sqlite-amalgamation\sqlite3.c:51884:20: warning: 'sqlite3IsMemdb' defined but not used [-Wunused-function]
SQLITE_PRIVATE int sqlite3IsMemdb(const sqlite3_vfs *pVfs){
^~~~~~~~~~~~~~
D:\libchewing\src\chewing-sql.c: In function 'TerminateUserphrase':
D:\libchewing\src\chewing-sql.c:482:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int ret;
^~~
Reply all
Reply to author
Forward
0 new messages