Skip to content

Tabs [wip] - #1204

Open
fxliang wants to merge 12 commits into
rime:masterfrom
fxliang:tabs
Open

Tabs [wip]#1204
fxliang wants to merge 12 commits into
rime:masterfrom
fxliang:tabs

Conversation

@fxliang

@fxliang fxliang commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Pull request

Issue tracker

Fixes will automatically close the related issue

Fixes #

Feature

Describe feature of pull request

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

after this pr,prism tabs will be selectable

Screenshot_20260805_163834

fxliang added 11 commits July 29, 2026 13:17
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.
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.
@lotem

lotem commented Aug 7, 2026

Copy link
Copy Markdown
Member

掃了一眼,記錄已選編碼、在音節圖上架都在意料之中,但是獲取編碼候選的算法感覺還不太通用。

另外 Tab 這個詞是什麼意思?

@fxliang

fxliang commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

分片?差不多意思随手用了个不喜欢可以再改了

通用嘛,没想到更好的

@jimmy54

jimmy54 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

9键拼音筛选,有很多交互逻辑。比如:1,选择,前端需要显示已经选择的preedit;2,选择,再点退格键,是先取消选择,再点格键才是删除;

另外支持:14键?18键嘛?

@fxliang

fxliang commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

9键拼音筛选,有很多交互逻辑。比如:1,选择,前端需要显示已经选择的preedit;2,选择,再点退格键,是先取消选择,再点格键才是删除;

另外支持:14键?18键嘛?

准确来说是选syllable,选择之后会向后推进音节,退格就向前回退,最后才是退格删除编码。目前这样其实还有一个问题是如果带辅助码的话会出来很多tabs,有性能问题,暂时没解决。

多少键无所谓

@fxliang fxliang changed the title Tabs Tabs [wip] Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants