Repository navigation
Conversation
两个相关的问题,都是双拼候选没按拼音完全对上: 1. 每个方案里 lo 这两个键都同时对应 luo 和语气词 lo。解码出的第一个变体是 wang'lo,而 lo 又是 lou、long 的前缀,末音节补全把 望楼、王龙 排到最前面, wang'luo 的词(网络、网罗)反而排到后面。现在把少见的 lo 排到 luo 后面 (RARE_SYLLABLES,目前只有这一个跨方案重码)。 2. 双拼每个音节固定两个键,打满的音节就是完整的,不该再当「没打完」去补全: whlo 不再出 wang lou / wang long,ud(=shuang)不再出 shuan'guo(涮锅)。 末音节补全只在最后一个键是没打完的声母(vsg = zhong'g)时开启, 由新的 shuangpin::has_open_key 判断,并显式传进 query_plain / run_query / append_more_candidates。 回归:7 种方案 × 10 种输入与改动前逐条对比,除上述两类候选外全部相同; 全套 276 个测试通过,并新增 shuangpin_completed_syllable_does_not_expand。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
开着双拼时,候选词没有完全按拼音匹配。例如输入
whlo,预期只出wang'luo的词,实际最前面是望楼(wang lou)、王龙(wang long)这类拼音对不上的词。另外打满的音节还会冒出补全词:ud(= shuang)会出涮锅(shuan'guo)。根因
lo两个键都同时对应luo和语气词lo。解码变体按音节顺序排,第一个变体是wang'lo;而lo又是lou、long的前缀,末音节补全把望楼、王龙排到了最前面,wang'luo的结果只在第二个变体里补到后面,用户基本看不到。completion: true,导致“完整音节 + 补全边”的候选混进来。修改
shuangpin.rs:table()里把少见的lo排到luo后面(RARE_SYLLABLES,目前只有这一个跨方案重码);新增has_open_key()——键数为奇数(最后一个键是没打完的声母)才需要补全。lib.rs:query_plain/run_query/append_more_candidates显式传入completion,双拼下由has_open_key决定;变体合并路径同样传入。验证
whlo→网络 网罗 往罗 …,ud→双 爽 霜 …(涮锅消失),vsg(= zhong'g)补全照常出中国。shuangpin_completed_syllable_does_not_expand;cargo test -p wowtype-core --no-default-features全套 276 个测试通过,clippy 无新增警告。本地安装后实测:输入
whlo第一个候选是「网络」,不再出现「望楼」「王龙」。