Skip to content

Commit

Permalink
Bump to 2024-03-12, add convert fish script
Browse files Browse the repository at this point in the history
  • Loading branch information
heddxh committed Aug 20, 2024
1 parent 4f763f5 commit 33764db
Show file tree
Hide file tree
Showing 5 changed files with 49,268 additions and 21 deletions.
10 changes: 8 additions & 2 deletions README.md
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
```
24 changes: 24 additions & 0 deletions convert.fish
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"
Binary file modified ff14.dict
Binary file not shown.
Loading

0 comments on commit 33764db

Please sign in to comment.