[Share Experiences] Fcitx5词库分享和如何向词库添加自己的常用词
Tofloor
poster avatar
CPU你的❤️
deepin
2024-04-29 19:32
Author

Fcitx5词库分享和如何向词库添加自己的常用词教程

开源地址

https://github.com/wuhgit/CustomPinyinDictionary

词库介绍

2024-04-14 (No.88)

当前词条数目 1,493,173(一百四十九万三千一百七十三)

新增 1579

针对日常输入习惯,当前词库包含了以下内容:

  • 人文类
    • 成语
    • 俗语
    • 诗歌
    • 汉语相关词典(感谢FREEMDICT
    • ……
  • 地理类
  • 生活类
    • 统计用产品分类目录(数据来源:国家统计局
    • 商品目录(数据来源:京东、淘宝 等购物网站)
    • 常见人名
    • ……
  • 其它
    • 第三方输入法词库
    • ……

已对以上所有数据进行去重、精简处理。

如何使用

  1. 下载 CustomPinyinDictionary_Fcitx_<版本号>.zip 并解压,得到词库文件 CustomPinyinDictionary_Fcitx.dict
  2. 将词库文件 CustomPinyinDictionary_Fcitx.dict 复制到目录 /usr/share/fcitx5/pinyin/dictionaries/ 中(如果没有这个目录,您可以自行创建)。
  3. 重启 Fcitx 后即可生效。

网盘下载链接:https://wwd.lanzout.com/id1pa1x0i6rg

向词库添加自己的常用词语

首先将我们的词库文件CustomPinyinDictionary_Fcitx.dict 转为 txt 格式

libime_pinyindict -d CustomPinyinDictionary_Fcitx.dict CustomPinyinDictionary_Fcitx.txt

然后用你的编辑器打开txt格式,我用的是商店下载的Sublime4

仿照txt每一行的格式添加 你的词语,之间都是空格,然后拼音要用单引号分割。一行一个词语。

嗨喽 hai'lou 0

保存,然后转回 dict 格式

libime_pinyindict CustomPinyinDictionary_Fcitx.txt  CustomPinyinDictionary_Fcitx2.dict

将词库文件 CustomPinyinDictionary_Fcitx2.dict 复制到目录 /usr/share/fcitx5/pinyin/dictionaries就可以了,重启fcitx5

sudo cp CustomPinyinDictionary_Fcitx2.dict /usr/share/fcitx5/pinyin/dictionaries
Reply Favorite View the author
All Replies
chmod700
deepin
2024-04-29 19:41
#1

以前我都是下载搜狗词库手动转,然后dpkg解包将这个文件放进去并重新打包deb

Reply View the author
neko
Moderator
2024-04-29 20:00
#2
~/.local/share/fcitx5/pinyin/dictionaries #默认没有这个文件夹需要自己创建

也可以放到用户目录(无需root权限)下

image.png

Reply View the author
CPU你的❤️
deepin
2024-04-29 20:04
#3
neko
~/.local/share/fcitx5/pinyin/dictionaries #默认没有这个文件夹需要自己创建

也可以放到用户目录(无需root权限)下

image.png

是的,这个路径只对当前用户生效。

Reply View the author
catubibu
deepin
2024-04-29 21:10
#4

百万词库,好大

Reply View the author
CPU你的❤️
deepin
2024-04-29 21:56
#5
catubibu

百万词库,好大

其实只有几十兆

Reply View the author
135******99
deepin
2024-05-01 17:58
#6

这个词库支持五笔不?

Reply View the author