# idvel/rime-ice architecture

> Architecture diagram of the GitHub repository idvel/rime-ice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/idvel/rime-ice
- Repository: https://github.com/idvel/rime-ice

## Overview

雾凇拼音是面向 Rime 的离线简体中文输入配置：用户在 Rime 客户端选择全拼、双拼或九键方案，利用词库生成候选，并可启用英文混输、转换、反查等功能。仓库还包含一个词库维护工具，用于生成中英混输词库、补充注音、校验并排序词条。输入配置之间的具体调用关系未在所示源码中展开，相关边依据 README 的功能说明；工具内部调用则依据已展示的入口代码。

Main entry points: [`others/script/main.go`](https://github.com/idvel/rime-ice/blob/main/others/script/main.go) (维护入口), [`cn_dicts/base.dict.yaml`](https://github.com/idvel/rime-ice/blob/main/cn_dicts/base.dict.yaml) (中文词库), [`others/script/rime/cn_en.go`](https://github.com/idvel/rime-ice/blob/main/others/script/rime/cn_en.go) (中英混输生成), [`others/script/rime/pinyin.go`](https://github.com/idvel/rime-ice/blob/main/others/script/rime/pinyin.go) (自动注音)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["输入方案"]
  node_full["全拼方案"]
  node_double["双拼方案"]
  node_t9["九键方案<br/>[t9.schema.yaml]"]
  node_english["英文方案"]
end

subgraph group_lexicon["词库资源"]
  node_cn_dicts["中文词库<br/>[base.dict.yaml]"]
  node_en_dicts["英文与混输词库<br/>[en.dict.yaml]"]
  node_emoji["Emoji 词库<br/>[emoji.txt]"]
end

subgraph group_features["输入扩展"]
  node_lua_features["Lua 输入功能"]
  node_date["日期与农历"]
  node_calculator["计算器"]
  node_radical["部件反查"]
end

subgraph group_maintenance["词库维护工具"]
  node_script_entry["维护入口<br/>[main.go]"]
  node_cn_en_gen["中英混输生成<br/>[cn_en.go]"]
  node_pinyin["自动注音<br/>[pinyin.go]"]
  node_emoji_gen["Emoji 生成校验<br/>[emoji.go]"]
  node_dict_check["词库校验<br/>[check.go]"]
  node_dict_sort["词库排序<br/>[sort.go]"]
  node_config["维护配置与路径<br/>[rime.go]"]
end

node_user(("输入用户"))
node_rime["Rime 客户端"]

node_user -->|"输入文字"| node_rime
node_rime -->|"选择方案"| node_full
node_rime -->|"选择方案"| node_double
node_rime -->|"选择方案"| node_t9
node_rime -->|"选择方案"| node_english
node_rime -->|"读取词条"| node_cn_dicts
node_rime -->|"读取词条"| node_en_dicts
node_rime -->|"读取映射"| node_emoji
node_rime -->|"启用扩展"| node_lua_features
node_rime -->|"提供日期输入"| node_date
node_rime -->|"提供计算输入"| node_calculator
node_rime -->|"提供反查"| node_radical
node_script_entry -->|"检查生成"| node_emoji_gen
node_script_entry -->|"生成混输词库"| node_cn_en_gen
node_script_entry -->|"补充注音"| node_pinyin
node_script_entry -->|"校验词库"| node_dict_check
node_script_entry -->|"排序词库"| node_dict_sort
node_script_entry -->|"读取路径配置"| node_config
node_cn_en_gen -->|"写入混输词库"| node_en_dicts
node_pinyin -->|"读取词库注音"| node_cn_dicts
node_emoji_gen -->|"生成词库"| node_emoji
node_dict_check -->|"校验词条"| node_cn_dicts
node_dict_sort -->|"排序去重"| node_cn_dicts

click node_full "https://github.com/idvel/rime-ice/blob/main/rime_ice.schema.yaml"
click node_double "https://github.com/idvel/rime-ice/blob/main/double_pinyin.schema.yaml"
click node_t9 "https://github.com/idvel/rime-ice/blob/main/t9.schema.yaml"
click node_english "https://github.com/idvel/rime-ice/blob/main/melt_eng.schema.yaml"
click node_cn_dicts "https://github.com/idvel/rime-ice/blob/main/cn_dicts/base.dict.yaml"
click node_en_dicts "https://github.com/idvel/rime-ice/blob/main/en_dicts/en.dict.yaml"
click node_emoji "https://github.com/idvel/rime-ice/blob/main/opencc/emoji.txt"
click node_lua_features "https://github.com/idvel/rime-ice/tree/main/lua"
click node_date "https://github.com/idvel/rime-ice/blob/main/lua/date_translator.lua"
click node_calculator "https://github.com/idvel/rime-ice/blob/main/lua/calc_translator.lua"
click node_radical "https://github.com/idvel/rime-ice/blob/main/radical_pinyin.schema.yaml"
click node_script_entry "https://github.com/idvel/rime-ice/blob/main/others/script/main.go"
click node_cn_en_gen "https://github.com/idvel/rime-ice/blob/main/others/script/rime/cn_en.go"
click node_pinyin "https://github.com/idvel/rime-ice/blob/main/others/script/rime/pinyin.go"
click node_emoji_gen "https://github.com/idvel/rime-ice/blob/main/others/script/rime/emoji.go"
click node_dict_check "https://github.com/idvel/rime-ice/blob/main/others/script/rime/check.go"
click node_dict_sort "https://github.com/idvel/rime-ice/blob/main/others/script/rime/sort.go"
click node_config "https://github.com/idvel/rime-ice/blob/main/others/script/rime/rime.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_full,node_double,node_t9,node_english toneBlue
class node_cn_dicts,node_en_dicts,node_emoji toneAmber
class node_lua_features,node_date,node_calculator,node_radical toneMint
class node_script_entry,node_cn_en_gen,node_pinyin,node_emoji_gen,node_dict_check,node_dict_sort,node_config toneRose
class node_user,node_rime toneIndigo
```

## Components

### 输入方案

- [全拼方案](https://github.com/idvel/rime-ice/blob/main/rime_ice.schema.yaml): `rime_ice.schema.yaml`
- [双拼方案](https://github.com/idvel/rime-ice/blob/main/double_pinyin.schema.yaml): `double_pinyin.schema.yaml`
- [九键方案](https://github.com/idvel/rime-ice/blob/main/t9.schema.yaml): `t9.schema.yaml`
- [英文方案](https://github.com/idvel/rime-ice/blob/main/melt_eng.schema.yaml): `melt_eng.schema.yaml`

### 词库资源

- [中文词库](https://github.com/idvel/rime-ice/blob/main/cn_dicts/base.dict.yaml): `cn_dicts/base.dict.yaml`
- [英文与混输词库](https://github.com/idvel/rime-ice/blob/main/en_dicts/en.dict.yaml): `en_dicts/en.dict.yaml`
- [Emoji 词库](https://github.com/idvel/rime-ice/blob/main/opencc/emoji.txt): `opencc/emoji.txt`

### 输入扩展

- [Lua 输入功能](https://github.com/idvel/rime-ice/tree/main/lua): `lua`
- [日期与农历](https://github.com/idvel/rime-ice/blob/main/lua/date_translator.lua): `lua/date_translator.lua`
- [计算器](https://github.com/idvel/rime-ice/blob/main/lua/calc_translator.lua): `lua/calc_translator.lua`
- [部件反查](https://github.com/idvel/rime-ice/blob/main/radical_pinyin.schema.yaml): `radical_pinyin.schema.yaml`

### 词库维护工具

- [维护入口](https://github.com/idvel/rime-ice/blob/main/others/script/main.go): `others/script/main.go`
- [中英混输生成](https://github.com/idvel/rime-ice/blob/main/others/script/rime/cn_en.go): `others/script/rime/cn_en.go`
- [自动注音](https://github.com/idvel/rime-ice/blob/main/others/script/rime/pinyin.go): `others/script/rime/pinyin.go`
- [Emoji 生成校验](https://github.com/idvel/rime-ice/blob/main/others/script/rime/emoji.go): `others/script/rime/emoji.go`
- [词库校验](https://github.com/idvel/rime-ice/blob/main/others/script/rime/check.go): `others/script/rime/check.go`
- [词库排序](https://github.com/idvel/rime-ice/blob/main/others/script/rime/sort.go): `others/script/rime/sort.go`
- [维护配置与路径](https://github.com/idvel/rime-ice/blob/main/others/script/rime/rime.go): `others/script/rime/rime.go`

### Other components

- **输入用户**
- **Rime 客户端**

## Connections

- 输入用户 → Rime 客户端: 输入文字 (evidence: `README.md`)
- Rime 客户端 → 全拼方案: 选择方案 (evidence: `README.md`)
- Rime 客户端 → 双拼方案: 选择方案 (evidence: `README.md`)
- Rime 客户端 → 九键方案: 选择方案 (evidence: `README.md`)
- Rime 客户端 → 英文方案: 选择方案 (evidence: `README.md`)
- Rime 客户端 → 中文词库: 读取词条 (evidence: `README.md`)
- Rime 客户端 → 英文与混输词库: 读取词条 (evidence: `README.md`)
- Rime 客户端 → Emoji 词库: 读取映射 (evidence: `README.md`)
- Rime 客户端 → Lua 输入功能: 启用扩展 (evidence: `README.md`)
- Rime 客户端 → 日期与农历: 提供日期输入 (evidence: `README.md`)
- Rime 客户端 → 计算器: 提供计算输入 (evidence: `README.md`)
- Rime 客户端 → 部件反查: 提供反查 (evidence: `README.md`)
- 维护入口 → Emoji 生成校验: 检查生成 (evidence: `others/script/main.go`)
- 维护入口 → 中英混输生成: 生成混输词库 (evidence: `others/script/main.go`)
- 维护入口 → 自动注音: 补充注音 (evidence: `others/script/main.go`)
- 维护入口 → 词库校验: 校验词库 (evidence: `others/script/main.go`)
- 维护入口 → 词库排序: 排序词库 (evidence: `others/script/main.go`)
- 维护入口 → 维护配置与路径: 读取路径配置 (evidence: `others/script/rime/rime.go`)
- 中英混输生成 → 英文与混输词库: 写入混输词库 (evidence: `others/script/rime/cn_en.go`)
- 自动注音 → 中文词库: 读取词库注音 (evidence: `others/script/rime/pinyin.go`)
- Emoji 生成校验 → Emoji 词库: 生成词库 (evidence: `others/script/rime/emoji.go`)
- 词库校验 → 中文词库: 校验词条
- 词库排序 → 中文词库: 排序去重
