-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump to 2024-03-12, add convert fish script
- Loading branch information
Showing
5 changed files
with
49,268 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
# ff14-fcitx5 | ||
# fcitx5-ff14 | ||
|
||
转换 NGA 贴子 [[幻想科技] [词库] FF14 中文输入法词库 [~6 four 5]](https://ngabbs.com/read.php?tid=31640918)中的 QQ 词库,使用 `libime` 生成 `dict` 二进制文件,便于导入 fcitx5。 | ||
|
||
- 修改词频为3 | ||
- 修改词库文件格式为`汉字 拼音 频率` | ||
- `libime_pinyindict "hetero-qq_cn6.45-modified.txt" "ff14.dict"` | ||
- cp ff14.dict ~/.local/share/fcitx5/pinyin/dictionaries | ||
- `ff14.dict ~/.local/share/fcitx5/pinyin/dictionaries` | ||
|
||
或者使用 fish 脚本: | ||
|
||
```fish | ||
fish convert.fish | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env fish | ||
|
||
set file 'hetero-qq_cn6.50.txt' | ||
test -e $file; or exit 1 | ||
|
||
set raw (cat $file) | ||
set pinyin | ||
set cn | ||
|
||
echo "Reading from $file..." | ||
for l in $raw: | ||
set line_items (string split ' ' $l) | ||
set --append pinyin $line_items[1] | ||
set --append cn $line_items[2] | ||
end | ||
|
||
set new_file 'hetero-qq_cn6.50-modified.txt' | ||
|
||
echo "Writing to $new_file..." | ||
for i in (seq 1 (count $pinyin)) | ||
echo $cn[$i] $pinyin[$i] 3 >>$new_file | ||
end | ||
|
||
libime_pinyindict $new_file "ff14.dict" |
Oops, something went wrong.