Skip to content

Commit 33764db

Browse files
committed
Bump to 2024-03-12, add convert fish script
1 parent 4f763f5 commit 33764db

File tree

5 files changed

+49268
-21
lines changed

5 files changed

+49268
-21
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
# ff14-fcitx5
1+
# fcitx5-ff14
22

33
转换 NGA 贴子 [[幻想科技] [词库] FF14 中文输入法词库 [~6 four 5]](https://ngabbs.com/read.php?tid=31640918)中的 QQ 词库,使用 `libime` 生成 `dict` 二进制文件,便于导入 fcitx5。
44

55
- 修改词频为3
66
- 修改词库文件格式为`汉字 拼音 频率`
77
- `libime_pinyindict "hetero-qq_cn6.45-modified.txt" "ff14.dict"`
8-
- cp ff14.dict ~/.local/share/fcitx5/pinyin/dictionaries
8+
- `ff14.dict ~/.local/share/fcitx5/pinyin/dictionaries`
9+
10+
或者使用 fish 脚本:
11+
12+
```fish
13+
fish convert.fish
14+
```

convert.fish

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env fish
2+
3+
set file 'hetero-qq_cn6.50.txt'
4+
test -e $file; or exit 1
5+
6+
set raw (cat $file)
7+
set pinyin
8+
set cn
9+
10+
echo "Reading from $file..."
11+
for l in $raw:
12+
set line_items (string split ' ' $l)
13+
set --append pinyin $line_items[1]
14+
set --append cn $line_items[2]
15+
end
16+
17+
set new_file 'hetero-qq_cn6.50-modified.txt'
18+
19+
echo "Writing to $new_file..."
20+
for i in (seq 1 (count $pinyin))
21+
echo $cn[$i] $pinyin[$i] 3 >>$new_file
22+
end
23+
24+
libime_pinyindict $new_file "ff14.dict"

ff14.dict

10.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)