feat(param): wire semantic alias table into PreParse; pilot calendar event list

Unify runtime morphology on pkg/cmdutil.Morph (same function the generator uses),
add a SemanticAliasHandler that looks up the embedded generated table after
morphological normalization and rewrites synonyms to the command's canonical flag
(leaving blocked/ambiguous synonyms untouched for the did-you-mean path), and
thread the command CLIPath through the pipeline Context. Pilot the mechanism on
'calendar event list' by removing its hand-written hidden spelling variants; a
behaviour-preservation test locks the outcome.
This commit is contained in:
克谨 committed 2026-07-29 10:01:53 +08:00
1 parent 2733f510af
commit c26cbbbbb8
10 files changed
+598 -99

No files matched your search

+5 -1
View File
@@ -53,7 +53,11 @@ func RunPreParse(root *cobra.Command, engine *Engine) {
}
ctx := &Context{
Args: append([]string{}, rawArgs...),
Args: append([]string{}, rawArgs...),
// target.CommandPath() still carries the "dws" prefix; PreParse
// handlers that key off a command (e.g. the semantic-alias table)
// normalize it themselves, so the runtime key matches the build key.
Command: target.CommandPath(),
FlagSpecs: flagInfos,
}