{"id":30028058,"url":"https://github.com/amorphobia/openfly","last_synced_at":"2025-08-06T14:14:10.631Z","repository":{"id":53692524,"uuid":"324962687","full_name":"amorphobia/openfly","owner":"amorphobia","description":"词库开源的小鹤音形 Rime 配方","archived":false,"fork":false,"pushed_at":"2024-09-15T06:04:23.000Z","size":2105,"stargazers_count":94,"open_issues_count":4,"forks_count":24,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-09-15T21:02:10.995Z","etag":null,"topics":["rime","rime-schema"],"latest_commit_sha":null,"homepage":"https://git.io/openfly","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amorphobia.png","metadata":{"files":{"readme":"README.md","changelog":"changes.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-28T09:02:59.000Z","updated_at":"2024-09-15T06:03:10.000Z","dependencies_parsed_at":"2024-09-14T20:57:56.006Z","dependency_job_id":"dd24f693-ec6a-40c9-830a-22147141734f","html_url":"https://github.com/amorphobia/openfly","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/amorphobia/openfly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amorphobia%2Fopenfly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amorphobia%2Fopenfly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amorphobia%2Fopenfly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amorphobia%2Fopenfly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amorphobia","download_url":"https://codeload.github.com/amorphobia/openfly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amorphobia%2Fopenfly/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269093220,"owners_count":24358627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rime","rime-schema"],"created_at":"2025-08-06T14:14:04.706Z","updated_at":"2025-08-06T14:14:10.605Z","avatar_url":"https://github.com/amorphobia.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 开源小鹤\n\n配方： ℞ **openfly**\n\n词库开源的[小鹤音形](https://flypy.com) [Rime](https://rime.im) 输入方案\n\n\u003e [!NOTE]\n\u003e ## 声明\n\u003e 注意到输入法同好时常会有方案性能对比的图表，但 Openfly 无意参与其中，因为本方案仅仅是对于 v9 时代官方小鹤的复刻，任何性能表现均类似或不敌官方小鹤。烦请看到本声明的同好将 Openfly 从中拿掉，感谢理解。\n\n## 现状\n\n由于小鹤官方的词库是「闭源」的，并且在禁止反编译的情况下难以导出，我已经放弃小鹤音形，转而使用[星空键道](https://github.com/xkinput/Rime_JD)（入门推荐[这个第三方教程](https://pingshunhuangalex.gitbook.io/rime-xkjd/)），词库版本就无限期停留在 [v10.9z](https://github.com/amorphobia/openfly/releases/tag/v10.9z)。但这个仓库不会归档，因此有任何词库上、lua 代码上的更新，欢迎提出拉取请求。如果有公认的更好的分叉仓库，我会更新 README 引流过去。\n\n## 问题和资源\n\n### 小鹤音形的使用相关\n\n请参考[小鹤入门](http://xhrm.flypy.com)和[小鹤论坛](https://bbs.flypy.com)，也欢迎在[讨论页面](https://github.com/amorphobia/openfly/discussions)参与讨论。\n\n### Rime 引擎的配置相关\n\n请参考 [Rime 官方帮助页面](https://rime.im/docs/), 以及网上也能搜索到许多教程。如果还是有问题，也可以在[讨论页面](https://github.com/amorphobia/openfly/discussions)提出。\n\n本配方使用了较新版本的 librime 的特性，Windows 用户请升级到[小狼毫 0.15.0](https://github.com/rime/weasel/releases/tag/0.15.0) 或以上版本。\n\n### 本配方相关\n\n请先参考本文，如果是本文没有提到的使用上的问题，可以在[讨论页面](https://github.com/amorphobia/openfly/discussions)提出；如果怀疑是程序错误、词库错误、配置错误等，可以在[议题页面](https://github.com/amorphobia/openfly/issues)提出；如果想要贡献代码或修改词库，也可以提交[拉取请求](https://github.com/amorphobia/openfly/pulls)。\n\n## 安装\n\n### 最新版本\n[东风破](https://github.com/rime/plum) 安装口令：\n```bash\n# 默认版本，词典分为多个文件\n$ bash rime-install amorphobia/openfly\n# 词典合并版本，除用户词典以外，合并为一个文件\n$ bash rime-install amorphobia/openfly@merged_dict\n```\n更新口令（在安装口令后加 `:update`, 可以不覆盖 `openfly.user.dict.yaml` 和 `openfly.user.top.dict.yaml` 两个文件）：\n```bash\n# 默认版本\n$ bash rime-install amorphobia/openfly:update\n# 词典合并版本\n$ bash rime-install amorphobia/openfly@merged_dict:update\n```\n\n### 特定版本\n东风破 安装口令：\n```bash\n$ bash rime-install amorphobia/openfly@\u003ctag\u003e\n```\n\n注意：\n- [版本列表](https://github.com/amorphobia/openfly/releases)\n- v9.9j 版本不支持自动复制 lua 脚本，需手动复制\n\n### 手动安装\n1. 将所需文件复制（或软链）到 Rime 的用户目录\n\n2. 将 `lua` 目录中的所有 `*.lua` 文件复制（或软链）到 Rime 的用户目录中的 `lua` 目录下，若无此目录需要新建\n\n3. 在 `defult.custom.yaml` 里启用此方案，然后重新部署\n\n## 词典分类\n\n- **首选字词** openfly.primary.dict.yaml\n- **次选字** openfly.secondary.char.dict.yaml\n- **次选词** openfly.secondary.word.dict.yaml\n- **表外字** openfly.off-table.dict.yaml\n- **符号编码** openfly.symbols.dict.yaml\n- **快符号** openfly.fast.symbols.dict.yaml\n- **直通车** 部分实现，见[直通车](#直通车)部分\n- **随心所欲** openfly.whimsicality.dict.yaml\n- **隐藏全码** 未直接收录，反查词典是基于全码首选的单字和隐藏全码的单字生成\n- **二重简码** openfly.secondary.short.code.dict.yaml, 默认开启，可在 `openfly.dict.yaml` 里注释掉以关闭\n- **一简词** openfly.secondary.single.word.dict.yaml, 默认开启，可在 `openfly.dict.yaml` 里注释掉以关闭\n\n## 直通车\n\n[官方版 Rime 挂载配方](http://flypy.ys168.com/)已通过 `lua_translator` 实现时间和日期的输入，本配方稍作修改，使其与官方安装版输出一致。\n\n四个小鹤的网址放在 `openfly.web.dict.yaml` 里，与官方安装版不同的是，网址是作为上屏词组输出，而非直接运行浏览器打开。\n\n直通车中打开外部程序的命令通过 `lua_processor` 实现。由于 [Lua 中 `os.execute` 的限制](https://stackoverflow.com/a/6365296/6676742)，在 Windows 中运行命令时会闪现一个命令提示符窗口。\n\n已实现的快捷指令（括号内标注已实现平台）：\n\n- `oav` 打开 Rime 程序目录 (Windows/macOS)\n- `ocm` 打开命令提示符或终端 (Windows/macOS)\n- `odn` 文件管理器 (Windows/macOS)\n- `oec` Excel (Windows/macOS)\n- `ogj` 高级设置，即打开 Rime 用户目录 (Windows/macOS)\n- `oht` 画图软件 (Windows)\n- `ojs` 计算器 (Windows/macOS)\n- `owd` Word (Windows/macOS)\n\n## 删词功能\n\n从 [6ee1bac](https://github.com/amorphobia/openfly/commit/6ee1bacdcc20fdf93f10793f8c5c942fb42b4425) 起，支持在用户词典中加入编码来删除词库中（包括内嵌编码提示词库）的词条，使用方式是在用户词典 `openfly.user.dict.yaml` 或 `openfly.user.top.dict.yaml` 中添加如下格式的词条\n\n```\n词语`[删]\t编码\n```\n\n其实在任意一个词典里添加都可以，不过建议不修改配方中的词典，这也是为什么推出删词功能的原因——删词的时候可以不修改配方中的词典，避免更新的时候改动被覆盖。\n\n需要注意的是，词语后的撇号是键盘上数字 \u003ckbd\u003e1\u003c/kbd\u003e 左边的符号；撇号后面的“删”字前后有半角的方括号，和编码之间是制表符而不是空格。\n\n例如，想要删除“鹤\teh”这个不规则的编码，可以在用户词典里加上：\n\n```\n鹤`[删]\teh\n```\n\n如此一来，“鹤”字就只能通过 `hedn` 这个编码打出，而 `eh` 就可以放入你想要的词了。\n\n## 候选展开\n\n原版小鹤音形基于多多输入法，可以使用命令生成特殊的候选，选择之后并非上屏词语，而是展开新的输入。比如输入 `ofb`, 显示的候选是「d(标点)、，。」，但选择之后输入码变成了 `ofbd`, 候选也变成了相应的。\n\n从 [626d100](https://github.com/amorphobia/openfly/commit/626d100fe941a472f4f49e841ce116f62ac9b574) 起，本配方使用 lua 脚本实现了这个功能。\n\n### 候选格式\n\n用于展开的候选与普通候选一样，由词组、`tab` 和编码组成，其中词组分为两个部分，第一部分是展开后的编码，用 `$` 标识出，第二部分用于候选展开前的显示，与第一部分用 `` ` `` 隔开。例如\n\n```\n$ofbd`d(标点)、，。\tofb\n```\n\n其中 `$ofbd` 是展开后的编码，选中这个候选就如同输入了 `ofbd`，`d(标点)、，。` 是展开前的提示，而与之用 `tab` 隔开的 `ofb` 则是输入码。\n\n### 已知限制\n\n1. 由于 librime-lua 的一个程序错误，直到 [00c999b](https://github.com/hchunhui/librime-lua/commit/00c999b3c9230d7a6a4f6410479e123b5010d9b8) 之后，才能正确地判断一个 `Composition` 是否为空，因此对于较旧的版本，候选展开不起作用，会直接上屏。请升级 rime 引擎到 [1.7.2](https://github.com/rime/librime/releases/tag/1.7.2) 或以上。\n2. 二重简码的切换开关暂时无法使用。目前 librime 最新的版本为 [1.7.3](https://github.com/rime/librime/releases/tag/1.7.3)，发布于2021年2月12日；二重简码切换开关依赖于 librime-lua 的 [88ba821](https://github.com/hchunhui/librime-lua/commit/88ba82165306ec6d49b9a9bfcd369d096a1f6d94)，代码合并于2021年3月5日。如果要将其打开，一个暂时的方案是在 `switches` 里加上一个名为 `openfly_enable_2nd_short` 的开关，设其值为 1，见[此例](https://github.com/amorphobia/my-rime-config/blob/ea4b310ea6336efa0626dc9ee1345a52152b7240/openfly.custom.yaml#L10)；有能力的可以使用最新的代码编译 librime 及其插件。\n\n## 许可和授权条款\n\n### 小鹤音形官方词库和原始配置文件\n\n见 [小鹤音形输入法最终用户许可协议](flypy-eula.md)\n\n### 其他整理词库和配置文件\n\n[`BY-NC`](by-nc.md)\n\n### 程序代码部分\n\n[`MIT`](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famorphobia%2Fopenfly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famorphobia%2Fopenfly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famorphobia%2Fopenfly/lists"}