Skip to content

Comments

Display word frequency under token#879

Merged
killergerbah merged 4 commits intomainfrom
token-frequency
Feb 19, 2026
Merged

Display word frequency under token#879
killergerbah merged 4 commits intomainfrom
token-frequency

Conversation

@ShanaryS
Copy link
Collaborator

This adds a new option TokenFrequencyAnnotation which can be Always, Uncollected only, and Never.

Currently we need an API request to yomitan per token so it's slow and cannot be bulked. To mitigate this, fetching the frequency is non-blocking and will trickle in over time. A full solution will require changes in Yomitan which should hopefully be resolved.

Users will need to have frequency dictionaries installed and they need to be rank-based. Checking for this will also be present the Yomitan PR.

@ShanaryS ShanaryS self-assigned this Feb 14, 2026
@ShanaryS ShanaryS added the enhancement New feature or request label Feb 14, 2026
Copy link
Owner

@killergerbah killergerbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you planning for the styling? At first glance it feels like using numbers to express the frequency might make the text feel crowded for the average user. But in any case this is pretty awesome work.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 14, 2026

Deploying asbplayer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 40a9dc0
Status: ✅  Deploy successful!
Preview URL: https://ddc6810d.asbplayer.pages.dev
Branch Preview URL: https://token-frequency.asbplayer.pages.dev

View logs

@ShanaryS ShanaryS force-pushed the token-frequency branch 2 times, most recently from 1805a64 to c57b770 Compare February 14, 2026 16:02
@ShanaryS
Copy link
Collaborator Author

ShanaryS commented Feb 14, 2026

I changed the in flight loading to use a new class AsyncSemaphore which is from one of my other projects. This maintains the FIFO ordering so that relevant frequencies are calculated first. I also added this.initialized which is set to true on the small initial cache build. This ensures that we only start getting frequencies after the main tokenize work is done (if frequencies aren't supported in tokenize).

What are you planning for the styling? At first glance it feels like using numbers to express the frequency might make the text feel crowded for the average user.

I've only ever thought of using numbers for this. I think using another abstraction like color (something that covers ranges of frequencies) is actually more complex since the user will need to remember what it means along with token status. It would now require a lot more settings too so a user can customize what each level means. Also if we ever add pitch accent we will need to use a token styling for that and so it can become extremely infromation dense.

I think the frequency is useless for everything except uncollected tokens, the only real value of it is to know if something is worth adding to Anki. So if they use uncollected only, they can hover+shift to check the frequencies in Yomitan as needed for everything else to reduce the clutter. This feature only brings value if it can be more convenient than the already convenient Yomitan lookup (aside from future features using frequency for automations).

@killergerbah
Copy link
Owner

killergerbah commented Feb 15, 2026

Interesting, expressing frequency with numbers make sense then

Copy link
Owner

@killergerbah killergerbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debating whether to merge this now or release 1.14 first

@ShanaryS
Copy link
Collaborator Author

I think we should merge and release with 1.14. It's pretty low stakes since it loads it asynchronously and if it's kept as NEVER then it has no effect on the existing features. It also contains a few bug fixes like the Yomitan reset and trackStates not updating properly causing duplicate requests at startup.

@killergerbah killergerbah added this to the Extension v1.14.0 milestone Feb 19, 2026
@killergerbah killergerbah merged commit 71f530d into main Feb 19, 2026
2 checks passed
@ShanaryS ShanaryS deleted the token-frequency branch February 19, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants