# fcitx-handwriting **Repository Path**: guyuming76/fcitx-handwriting ## Basic Information - **Project Name**: fcitx-handwriting - **Description**: 基于 https://github.com/fcitx/fcitx-handwriting; 去除了对fcitx及dbus的依赖; 作为独立的gtk+3应用,使用自定义的wayland协议 zwp_handwrite_v1 , 和实现这一协议的DWL配合使用 - **Primary Language**: C/C++ - **License**: GPL-3.0 - **Default Branch**: work_with_rfm_grepMatch - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-06-17 - **Last Updated**: 2024-12-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README fcitx-handwriting 项目原先作为fcitx4的一个输入法模块,使用dbus和fcitx4通信. 在此项目(分支),我去除了其对fcitx和dbus的依赖,作为一个独立的gtk+3应用运行; 并创建了自定义的wayland协议:https://gitee.com/guyuming76/dwl/blob/fcitx-handwrite/protocols/handwrite-unstable-v1.xml ; 在wayland合成器DWL上实现了此协议server端; fcitx-handwriting实现了此协议client端. 此协议简单到只有一个request,client借此发送识别的汉字给wayland compositor DWL; 然后DWL再把此汉字传递给活动的输入窗口:此步骤 DWL 依赖wlr_text_input_v3协议, 使用wlr_text_input_v3_send_commit_string 方法发送汉字到应用. ## 安装: ## git clone 项目后: ``` mkdir build cd build CMAKE_EXPORT_COMPILE_COMMANDS=YES cmake -DCMAKE_BUILD_TYPE=Debug .. # CMAKE_EXPORT_COMPILE_COMMANDS=YES 可以生成compile_commands.json # -DCMAKE_BUILD_TYPE=Debug 相当于 gcc 后面加 -g 生成调试信息 make sudo make install ``` 我是在gentoo上安装的, 安装app-i18n/zinnia和app-i18n/zinnia-tomoe这两个包后,还要 ``` mkdir -p /usr/lib/zinnia/model/tomoe/ ln -s /usr/lib64/zinnia/model/tomoe/handwriting-zh_CN.model /usr/lib/zinnia/model/tomoe/handwriting-zh_CN.model ``` ## 使用: ## 参见视频:https://www.zhihu.com/zvideo/1793700437297340417 命令行输入fcitx-handwriting启动程序,手写后点击候选词完成输入. q键或ESC键退出fcitx-handwriting -p参数导出模型训练数据到png图片 ## TODO ## 1. [以我目前的认知,识别率不够满意的主要原因还是训练数据集有待提高](https://gitee.com/guyuming76/handwriting-zh_CN_Community) 2. 训练数据生成界面 3. https://www.zhihu.com/question/661237439 ## 参考 ## https://www.cnblogs.com/yssgyw/p/3456121.html