Fix incorrect pinyin highlight for polyphonic characters (e.g. 核查 with hecha/heia) - #4607
Draft
VictoriousRaptor with Copilot wants to merge 2 commits into
Draft
Fix incorrect pinyin highlight for polyphonic characters (e.g. 核查 with hecha/heia)#4607VictoriousRaptor with Copilot wants to merge 2 commits into
VictoriousRaptor with Copilot wants to merge 2 commits into
Conversation
3 tasks
…d of bulk GetPinyinList
The ToolGood library's GetPinyinList() performs context-sensitive disambiguation
that can produce incorrect pinyin for some characters. For example, '查' in '核查'
was incorrectly returned as 'Zha' instead of 'Cha', causing both full-pinyin
("hecha") and double-pinyin ("heia" in XiaoHe) searches to fail to highlight
the matched characters.
Fix: Use WordsHelper.GetAllPinyin() per character, which returns pronunciations
sorted by frequency (most common first), avoiding incorrect context-sensitive
disambiguation.
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect highlight when using pinyin in Flow Launcher
Fix incorrect pinyin highlight for polyphonic characters (e.g. 核查 with hecha/heia)
Aug 6, 2026
Jack251970
requested changes
Aug 7, 2026
Jack251970
left a comment
Member
There was a problem hiding this comment.
I think we can continue this work in #4544 instead of this new PR.
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.
Searching for
核查using full pinyin (hecha) or XiaoHe double pinyin (heia) produced no highlights because the ToolGood library'sGetPinyinList()applies context-sensitive disambiguation across the whole input string — incorrectly returning"Zha"for查in"核查"instead of"Cha". This caused the translated form to be"He Zha"/"he va"(XiaoHe), which doesn't match the user's query.Changes
PinyinAlphabet.cs—BuildCacheFromContent: Replace bulkWordsHelper.GetPinyinList(content)with per-characterWordsHelper.GetAllPinyin(c, false)[0], which returns pronunciations sorted by frequency and avoids erroneous cross-character disambiguation.With the fix,
核查translates to"He Cha"(full pinyin) /"he ia"(XiaoHe), correctly matching and highlighting both characters.