Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisiting headword display #877

Closed
birtles opened this issue Jan 15, 2022 · 1 comment
Closed

Revisiting headword display #877

birtles opened this issue Jan 15, 2022 · 1 comment

Comments

@birtles
Copy link
Member

birtles commented Jan 15, 2022

I was reading through the issue here JMdictProject/JMdictIssues#46 (comment) and thinking about tweaks we should make to our headword rendering.

For background, the way it currently works is that when we do a word search our look up utility (hikibiki-data) gives us back the matching entries along with annotations indicating which headwords "match" and the text range for which part matched too when applicable.

If we did a lookup based on kanji then we will consider all kana headwords to match unless there are annotations indicating that they only apply to certain kanji headwords (that we didn't match). Similarly, if we do a lookup based on kana we will consider all kanji headwords to match, unless there are annotations indicating otherwise.

We can consider a headword a "direct match" if it both a match and it also has a text range indicating which characters matched. That is, that particular headword corresponds to the text we looked up.

So, looking up 食べる will give you:

  • kanji: 食べる (match + text range, i.e. direct match), 喰べる (not matched)
  • kana: たべる (match)

Looking up たべる will give you:

  • kanji: 食べる (match), 喰べる (match)
  • kana: たべる (match + text range, i.e. direct match)

We currently hide any unmatched kana headwords but show unmatched kanji headwords in a dimmed, translucent manner.

I think we could probably improve this in the following ways:

  • If the kana headword is the only direct match and it is irregular/rare (ik/rk), we should show other non-irregular/non-rare/non-old kana headwords (e.g. looking up ふいんき should show ふんいき as well)
  • Dim irregular kana headwords if it was a match on the kanji (e.g. dim ふいんき when looking up 雰囲気)
  • Dim irregular kanji headwords if there is a common one that matches (e.g. when looking up お袋 or おふくろ, お母 should be dimmed). In fact, perhaps we should always dim them unless they are a direct match?

Any thoughts?

birtles added a commit that referenced this issue Jan 17, 2022
…dings

This implements the first suggestion from #877.
birtles added a commit that referenced this issue Jan 20, 2022
@birtles
Copy link
Member Author

birtles commented Jan 26, 2022

This is done for now.

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

No branches or pull requests

1 participant