yomidevs / yomitan

Pop-up dictionary browser extension. Successor to Yomichan.
https://yomitan.wiki
GNU General Public License v3.0
1.3k stars 101 forks source link

Add `primary_reading` option for "dictionary deinflection" definition type #1507

Open stephenmk opened 1 month ago

stephenmk commented 1 month ago

Earlier this year, StefanVukovic99 informed me of a new definition type for supporting dictionary-level deinflections. Currently this syntax allows dictionary authors to redirect from a given term to a different term based upon a single query string. It would be convenient* if an additional primary_reading string could also be included with this redirect, similar to the internal link functionality implemented by khaitruong922 in pull request #1497

* For the dictionaries that I make, at least.

stephenmk commented 1 month ago

@khaitruong922 linked this issue to #1497, but I am actually describing a different feature that is not solved by that pull request.

With the way that deinflection definitions are currently designed, redirections are sometimes not sorted correctly. This could be fixed by allowing a priority_reading parameter to be included in the dictionary deinflection definition type.


For example, a search for 一かど pulls up the entry for いっかく on top instead of ひとかど.

Example: 一かど ![hitokado](https://github.com/user-attachments/assets/b9194bc2-e0eb-4f22-9aad-f97361b49cbc)

A search for ひと押し pulls up the entry for いちおし on top instead of ひとおし.

Example: ひと押し ![hitooshi](https://github.com/user-attachments/assets/d2910724-0e03-49af-83b6-c595848d5eb0)

A search for ひと文字 pulls up the entry for いちもじ on top instead of いちもじ.

Example: ひと文字 ![hitomoji](https://github.com/user-attachments/assets/8edadada-8b6f-47c7-88fc-8abae99738e6)
stephenmk commented 1 week ago

Adding another example. A search for "ひでぇ" currently pulls up the entry for "むごい" before "ひどい"

Example: ひでぇ ![hidee](https://github.com/user-attachments/assets/1bda3ab4-af09-4ed8-8474-6acdee8ee492)