Repository navigation
Reformat config JSON and align s2twp conversion chain - #1286
Conversation
bbfaf24 to
d54bf75
Compare
|
在 #366 中 tw2sp.json 的 conversion chain 已由三层改为两层,但是 s2twp.json 一直未做对应的修改。者导致 s2twp 转换时,经过 TWPhrases 词表匹配一次后,还会再被 TWVariantsPhrases 和 TWVariants 转一次。 此问题近期由 @danny0838 编辑「喫茶小舖」等词时重新发现 #1027,故作调整。 验证:扫描了 |
Format all data/config JSON files in a more readable compact style. Change s2twp so TWPhrases participates in the same grouped conversion stage as TWVariantsPhrases and TWVariants. This means a TWPhrases match is treated as the final phrase conversion for that span instead of continuing through the later Taiwan variant stage, making the forward chain symmetric with the reverse tw2sp chain. Verified with: bazel test //data/config:config_dict_validation_test; bazel test //test:command_line_converter_test.
d54bf75 to
220cc3d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 220cc3dc98
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
有沒有考慮改成預設縮排二格的輸出? 即 |
|
我是用 dprint 及如下配置格式化的(关键点在 {
"json": {
"indentWidth": 2,
"lineWidth": 80,
"preferSingleLine": true
},
"excludes": [
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/json-0.21.3.wasm"
]
}很多其他工具也支持。 这种格式还有一个额外的好处,就是 diff 的时候会比纯粹 JSON.stringify(input, null, 2) 清楚一些。修改也会容易一些。 |
Format all data/config JSON files in a more readable compact style.
Change s2twp so TWPhrases participates in the same grouped conversion stage as TWVariantsPhrases and TWVariants. This means a TWPhrases match is treated as the final phrase conversion for that span instead of continuing through the later Taiwan variant stage, making the forward chain symmetric with the reverse tw2sp chain.
Verified with: bazel test //data/config:config_dict_validation_test; bazel test //test:command_line_converter_test.