Tabs [wip] - #1204
Open
fxliang wants to merge 12 commits into
Open
Conversation
Add virtual CollectInputTabs/primary_dictionary/reverse_lookup_prefix to Translator and Engine, eliminating all dynamic_cast<*Translator*> calls and removing 4 gear includes from the API layer.
- Keep the longest span when the same syllable is returned by both completion and full-match graph edges.
…rigger context update
Constraint labels like "hao3" (4 chars) or "xian1" (5 chars) could exceed their span in the original input, shifting syllable-graph positions in ApplyTabConstraints and breaking multi-character candidate lookup for pinyin tone selection and bopomofo schemes. Two-stage fix in Context::shadow_input: 1. Strip trailing tone digits (1-5) from the label, handling pinyin tone markers that add characters beyond the span. 2. When the label is still longer than the span after stripping (e.g. bopomofo input where pinyin labels are longer than the bopomofo characters they replace), keep the original input substring and rely on ApplyTabConstraints to filter by syllable ID. Verified against terra_pinyin (tone tabs), T9 (digit disambiguation), and bpmf_def (bopomofo).
…_prefix API The IsReverseLookupSegment filter in TranslateSegments incorrectly excluded non-reverse-lookup translators (table_translator) from translating abc segments tagged with 'reverse_lookup' by abc_segmentor extra_tags. Since each translator already filters segments by its own tags in Query(), the external IsReverseLookupSegment/IsReverseLookupPosition filter and the GetReverseLookupPrefixes/reverse_lookup_prefix() API are unnecessary.
Member
|
掃了一眼,記錄已選編碼、在音節圖上架都在意料之中,但是獲取編碼候選的算法感覺還不太通用。 另外 Tab 這個詞是什麼意思? |
Contributor
Author
|
分片?差不多意思随手用了个不喜欢可以再改了 通用嘛,没想到更好的 |
Contributor
|
9键拼音筛选,有很多交互逻辑。比如:1,选择,前端需要显示已经选择的preedit;2,选择,再点退格键,是先取消选择,再点格键才是删除; 另外支持:14键?18键嘛? |
Contributor
Author
准确来说是选syllable,选择之后会向后推进音节,退格就向前回退,最后才是退格删除编码。目前这样其实还有一个问题是如果带辅助码的话会出来很多tabs,有性能问题,暂时没解决。 多少键无所谓 |
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.
Pull request
Issue tracker
Fixes will automatically close the related issue
Fixes #
Feature
Describe feature of pull request
Unit test
Manual test
Code Review
Additional Info
after this pr,prism tabs will be selectable