Ubuntu 将词库转换为txt文件教程
QPYIDRWIMG opened this issue · 2 comments
QPYIDRWIMG commented
- 备份
sources.list
:cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 编辑
sources.list
:nano /etc/apt/sources.list
- 将文件里的内容全部替换成以下内容:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
- 更新源:
apt update
- 安装
libime-bin
:apt install libime-bin
- 还原
sources.list
:cp /etc/apt/sources.list.bak /etc/apt/sources.list
- 下载
CustomPinyinDictionary_Fcitx_<版本号>.tar.gz
并解压,得到词库文件CustomPinyinDictionary_Fcitx.dict
- 进入词库文件所在目录,将词库转换为txt文件:
libime_pinyindict -d CustomPinyinDictionary_Fcitx.dict CustomPinyinDictionary_Fcitx.txt
QPYIDRWIMG commented
若命令受限于权限而无法执行,请在命令之前加上sudo
Reweng commented
- 备份
sources.list
:cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 编辑
sources.list
:nano /etc/apt/sources.list
- 将文件里的内容全部替换成以下内容:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
- 更新来源:
apt update
- 安装
libime-bin
:apt install libime-bin
- 还原
sources.list
:cp /etc/apt/sources.list.bak /etc/apt/sources.list
- 下载
CustomPinyinDictionary_Fcitx_<版本号>.tar.gz
并解压,获取词库文件CustomPinyinDictionary_Fcitx.dict
- 进入词库文件所在目录,将词库转换为txt文件:
libime_pinyindict -d CustomPinyinDictionary_Fcitx.dict CustomPinyinDictionary_Fcitx.txt
root@ubuntu:/home/dict# libime_pinyindict -d CustomPinyinDictionary_Fcitx.dict CustomPinyinDictionary_Fcitx.txt terminate called after throwing an instance of 'std::invalid_argument' what(): Invalid pinyin version. Aborted
报错了