Skip to content

Instantly share code, notes, and snippets.

@lotem
Last active April 16, 2022 08:02
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save lotem/5443073 to your computer and use it in GitHub Desktop.
Save lotem/5443073 to your computer and use it in GitHub Desktop.
導入碼表示例
# luna_pinyin.custom.yaml
# 修改字典名爲 luna_pinyin.kunki
# 其對應的用戶詞典名取句點之前部分即 luna_pinyin
patch:
translator/dictionary: luna_pinyin.kunki
# Rime dictionary
# encoding: utf-8
---
name: luna_pinyin.kunki
version: "2013.04.23"
sort: by_weight
use_preset_vocabulary: true
# 從 luna_pinyin.dict.yaml 導入包含單字的碼表
import_tables:
- luna_pinyin
...
# table begins
# 自定義的詞條
瑾昀 jin yun 100
瑾昀 kun ki 100
自動註音的詞
又一個詞
再一個詞
@lotem
Copy link
Author

lotem commented Apr 13, 2020

---
...

此處 ---... 分別是YAML文檔的開始和結束標記。
在YAML語法裏這些標記不是必須的,但 *.dict.yaml 要求寫出,因爲後面的碼表部分不再是YAML格式。

@Sciroccogti
Copy link

是否支持包含非同级文件夹下的文件?

@lotem
Copy link
Author

lotem commented Dec 18, 2020

是否支持包含非同级文件夹下的文件?

按照指定的詞典名字在兩處數據文件夾依次查找文件。
沒有設計額外指定文件路徑的用法。

@Hustoking
Copy link

如何在 linux fcitx5 环境下使用 custom_phrase.txt 定义 「用户自定义短语」 呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment