五笔敲满四码且码表只答一个候选时不再需要空格:第四个字母落下即上屏,下一个 字母直接开新组合。行为无条件生效,不设配置开关:业界默认开启(微软五笔、 搜狗五笔、极点、Rime 主流五笔方案),唯一候选没有第二选择,确认空格是纯冗余; 而一条开关要牵动配置五处同步,换不来可形成预期的行为差异,不值。 - engine 只报告事实(wubi_unique_four_code:完整四码、码表作答、候选恰好一个), 是否上屏由 Server 决定;判定收在 input_key_policy.h 的纯函数里,随 portable 目标进 ASan/UBSan;组词(creating_word)激活时组合保持打开,唯一四码不会把 正在拼的词截断上屏 - 提交复用 ProcessSelectionKey,与空格上屏同一套记账;但只能走 worker 管道推送 CommitCandidate:字母键在默认 raw 预编辑样式下不读请求-回复管道,回一帧 Normal 既不会上屏,还会在 TSF 侧留下永不释放的回复帧,而 Server 已按 Normal 清掉组合 - 上屏前按当前组合同步重建候选页:候选页异步发布,提交路径读的 ui.items / page_words 否则可能还停在第三码那一拍 - 非唯一四码不做顶字上屏:一个按键只能回一条管道消息,真顶字需要扩 IPC 协议
Input engine (engine/)
The C++ conversion engine behind Metasequoia IME for Windows: input sessions, candidate lookup, helpcodes, the shared contracts and the voice module.
This directory used to be a submodule of metasequoiaime/MSIME-Engine. It is now a component of this repository, a sibling of server/, ui/, windows/ and installer/. Its upstream commit, and exactly what the Windows specialization removed, are recorded in UPSTREAM.md. Treat it as first-party code: reviewed, formatted and tested like anything else here, no longer merged from upstream.
| Directory | Purpose |
|---|---|
core/, quanpin/, shuangpin/, english/, japanese/ |
Input sessions and candidate lookup |
contracts/ |
The authoritative IPC wire format, dictionary format, punctuation policy and WebView message schema |
helpcode/ |
Helpcode (形码) tables and generators |
local_modes/, providers/, user_dictionary/ |
Local modes, online candidate sources, the user dictionary |
voice/ |
Recording, WAV encoding, recognition and text cleanup; builds independently |
googlepinyinime-rev/, ngram/kenlm/, utfcpp/, voice/third_party/ |
Vendored third-party code, kept in its upstream formatting and licence |
Integration is through <metasequoia/session.h>. See runtime architecture.
Build
The product build does not build this directory on its own: server/CMakeLists.txt pulls it in with add_subdirectory, so CI compiles and exercises the engine through the server and the TSF frontend. After changing something here, run the server's build and tests.
Building it standalone still works and is much faster while working on the engine. Dependencies are CMake 3.25+, a C++17 compiler, Boost, fmt, spdlog and SQLite3.
vcpkg install --triplet x64-windows-static
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static
cmake --build build --config Release --parallel
ctest --test-dir build -C Release --output-on-failure --timeout 20
ctest runs every engine target registered in the root CMakeLists.txt: the segmentation, IPC and punctuation contracts, the platform API, data paths, runtime isolation, dictionary state and the per-mode session tests. tests/ additionally holds a separate Windows-only project that is not part of that build — add new tests to the registered targets so they actually run.
Formatting is driven from the repository root by scripts/format.sh, using the .clang-format in this directory (voice/ has its own with a wider column limit). The vendored third-party trees and the generated headers are excluded.
Contract rules
The IPC wire format, opcodes, voice framing and WebView message definitions live in contracts/ and are the single source of truth. Consumers include the same headers; do not restate them on either side. Dictionary naming is defined by contracts/dictionary/format.json, shared with the repository root's scripts/dictionary_product.py.
Data and licensing
The dictionaries are neither stored nor built here. They arrive as a release pinned by tag and digest in product-lock.json and are downloaded at build time; the pipeline that produced them left with the specialization. Per-source licensing is tracked in NOTICE.md — read it before redistributing the built databases.
Recognition goes through a cloud provider; local Whisper inference was removed. The only committed model is voice/assets/models/silero_vad.onnx, loaded solely by the standalone Windows host that is off by default.
Licence
GPL-3.0. Vendored googlepinyinime-rev, ngram/kenlm (LGPL-2.1-or-later), utfcpp and voice/third_party/miniaudio keep their upstream licences.