* fix(engine,server): 全拼多字纠错收窄为仅 QWERTY 邻键插入 多字(插入)纠错只保留「误插 QWERTY 邻键」:生成器 insertion_variants 不再生成重复相邻键(双击),生成式空间不再生成任意字母插入(远键插入)。autocorrect_table.h 随生成器重新生成。 * fix(engine): 全拼纠错开关关闭时真正不再改写切分 纠错开关关掉后真正不纠错:把手误拼写别名层从常开改为跟掩码走(ü 归一 jv->ju / nue->nve 仍常开);两个早于掩码可知的切分入口 QuanpinScheme::build_request 与 QuanpinDictionary::get_or_compute_segments 显式带上掩码,切分缓存键随之隔离。 * fix(engine,server): 纠错开关关闭时辅助码、写回与排序上下文也按字面切分 关掉全拼纠错后,只有方案的 build_request 和查询自身切分不再跑手误别名层, 其余几条路径仍用默认(带别名)的切分,和查询落在不同的键上: - 辅助码路径自己切底串作为显式切分交给词典,haoyonga 仍被切成 hao'yong'ga; - 调频、造词、删词、建 SQL、校验去掉分隔符后重切,开关关掉时选中 hao'yong'a 的词会去更新 hao'yong'ga,调频静默失败; - 排序 / 固定位置的上下文 key(引擎与 server 两处)仍按别名切,laing 与 liang 的固定位置互相串。 改动: - cut_pinyin_by_mode 的 include_correction_aliases 改为必填,每个调用点显式决定; 双拼词典、设置页词库校验和离线工具传 true,保持原行为。 - 新增 quanpin::correction_aliases_enabled,方案、词典、辅助码与排序 key 共用 (只看换位、邻键两位),修正只带删除 / 插入位的掩码在方案与词典两层判断不一致。 - 词典按最近一次 query 的掩码记录别名开关,写回路径统一走 cut_for_write。 - 会话改为在换方案、改开关时 bind_quanpin_scheme 一次,不再每次 refresh 下发。 - 方案只存 bool;jv -> ju 放回纠错表,去掉合并表。 - 在 CI 实际执行的 test_input_session 中补回归用例(写回、辅助码、固定位置、 方案掩码),每条都确认回退修复后会失败。 --------- Co-authored-by: fanlusky <1730976608@qq.com>
Metasequoia IME Server(水杉输入法 Server 端)
This is the server end of MSIME-Windows.
How to build
Prerequisites
- Visual Studio 2026
- CMake
- vcpkg
- Python3.10+
- Boost
- Node.js and pnpm 10 (settings page build)
Make sure vcpkg and Boost are installed by Scoop.
Build steps(For Dev)
Clone the product and provision the reviewed dictionary release from its root:
git clone --recursive https://github.com/metasequoiaime/MSIME-Windows.git
cd MSIME-Windows
python scripts/product_lock.py fetch-dictionaries --staging-root .
if ($LASTEXITCODE -ne 0) { throw 'Dictionary verification failed' }
$devLocalData = Join-Path $PWD 'build/dev-local'
$devData = Join-Path $devLocalData 'metasequoiaime'
New-Item -ItemType Directory -Force $devData | Out-Null
Copy-Item MetasequoiaImeDict/out/* $devData -Force
Copy-Item engine/helpcode/helpcodes $devData -Recurse -Force
Copy-Item server/assets/tables/* $devData -Force
Copy-Item server/assets/config/config.toml $devData -Force
Push-Location ui-html/webview2/settings/ime-settings
try {
pnpm install --frozen-lockfile
if ($LASTEXITCODE -ne 0) { throw 'Settings dependencies failed' }
pnpm build
if ($LASTEXITCODE -ne 0) { throw 'Settings page build failed' }
} finally { Pop-Location }
$devWebview = Join-Path $devData 'html/webview2'
New-Item -ItemType Directory -Force $devWebview | Out-Null
foreach ($part in @('shared', 'candwnd', 'ftb', 'menu')) {
Copy-Item "ui-html/webview2/$part" $devWebview -Recurse -Force
}
$devSettings = Join-Path $devWebview 'settings/ime-settings'
New-Item -ItemType Directory -Force $devSettings | Out-Null
Copy-Item ui-html/webview2/settings/ime-settings/dist $devSettings -Recurse -Force
python server/scripts/prepare_env.py
if ($LASTEXITCODE -ne 0) { throw 'Server environment setup failed' }
$env:LOCALAPPDATA = $devLocalData
$env:METASEQUOIA_IME_DATA_DIR = $devData
cd server
Use a dedicated PowerShell terminal. These steps stage the same locked data as CI
and the current product pages in a separate development directory. Both
LOCALAPPDATA (Windows config/pages) and METASEQUOIA_IME_DATA_DIR (Engine data)
are set for that terminal; setting only the latter would still use installed
Windows configuration and pages. Close the terminal after development.
Dictionary source changes belong in Engine's dictionary/; use its root build_profile.py
to build data instead of calling internal stages in the archived Dict repository.
Then, build and run,
.\scripts\lcompile.ps1
.\scripts\lrun.ps1
If you want to build and run in one step, run the following command,
.\scripts\llaunch.ps1
Watchdog
MetasequoiaImeWatchdog.exe is built next to the server. Starting the server directly also starts the watchdog,
which monitors the server from the same directory and restarts it after an unexpected exit. Repeated early crashes use
an exponential restart delay (up to 30 seconds) to avoid a restart storm.
The developer terminate shortcut stops both processes. The restart shortcut asks the watchdog to start a fresh server after the current process exits.
English prefix candidates
Place english.db next to msime.db in %LOCALAPPDATA%\metasequoiaime. Set
general.cn_en_mixed_input = true in config.toml to enable asynchronous English prefix candidates for Quanpin and
Shuangpin. The master switch utility.mixed_candidates must also be on; English, emoji, kaomoji and date/time mixed
candidates are queried together on the single MixedCandidates worker thread (src/mixed/).
Developer Shortcuts
The server process includes a few built-in global shortcuts that are useful during development:
Ctrl + Shift + Alt + T- terminate
MetasequoiaImeServerimmediately
- terminate
Ctrl + Shift + Alt + R- restart
MetasequoiaImeServer - Settings exposes the same restart under 外观 → 重启输入法进程; it reaches the server over the Aux pipe because Settings runs in its own process
- restart
Ctrl + Shift + Alt + C- clear IME engine cache
Ctrl + Shift + Alt + 1toCtrl + Shift + Alt + 8- delete candidate
1to8from the current candidate window - this only works while the candidate window is visible
- delete candidate
Screenshots
Shared voice providers
The server links Engine VoiceCapture and Voice. WAV encoding and batch transcription/polish codecs come from the public library; Windows keeps provider configuration, SiliconFlow padding/retry behavior and Doubao streaming. Batch uploads are bounded to 20 MiB and responses to 1 MiB. Failed or empty polish responses retain the original transcript.
本地 Release 构建脚本可通过 -ManifestTool <mt.exe 路径> 使用其他 Windows SDK;未指定时沿用现有 SDK 路径。配置、编译或 manifest 嵌入失败都会中止,避免安装器收集旧产物。






