[Userscript] Niai 似合い Visually Similar Kanji

:warning: This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.

Niai Visually Similar Kanji

by acm

This is the stable release of my latest script, Niai Visually Similar Kanji!

This is a completely new implementation, and a substitute for the old Wanikani Similar Kanji script, and a more full-featured version of Wanikani’s own Visually Similar Kanji section.

Installation Instructions

  1. Get Tampermonkey (installation instructions in this thread)
  2. Click on the installation link (Tampermonkey should auto-detect .user.js files)
  3. Install the script after you check the security (at least see that script will only change the wanikani website, all @include should be related to WK :wink:)

News

  • v1.2.0 Level detection now working, and WKOF support
  • More control over how many kanji are shown
  • Added new DB based on kanji differences in the Noto font
  • Put vocab examples on top again in lessons
  • Opens all jisho links in a new window
  • The position of kanji in the grid is now stable even when deleting
  • Enter button problems in lessons and reviews should be fixed now (for good now?)

Example Screenshot

snow

Features

  • Five different databases for similar kanji: two from Lars Yencken’s PhD thesis (see below), the Keisei database for phonetic compounds, the database of the old “similar kanji” script, and (planned) manual additions
  • You can add and remove kanji from the list as you like, it will be stored locally in your browser
  • Replaces WK’s section on kanji content pages
  • Also works in reviews, lessons, and lesson reviews

User Poll

I want to find out who is using the script, and send out @notifications I case I break something seriously in the future (happens rarely :wink:). Please click something!

  • I use the script and want notifications
  • I use the script but will just suffer silently
  • I just like to click on polls
0 voters

Controls

buttons

Buttons:

  1. Show/hide badges than can be clicked to delete kanji (see below)
  2. Add a similar kanji (dropdown menu)
  3. Revert your changes (deleted and added similar kanji) for the current kanji only, click twice
  4. Show/hide the section contents once
  5. Settings
  6. Information

Buttons:

  1. Show more debug messages in the console (in case of problems)
  2. Delete all your changes to all kanji (click twice)
  3. Mini mode: always start out with hidden character grid
  4. Edit mode: always start out with the delete badges visible

Editing

=> Click on the x badges to delete

In the + dropdown you can add kanji, only kanji in WK can be added (but at least it fills readings and meanings for you). Enter or paste the kanji, click the button.

License

GPL v3, just do what you want with it.

Data Sources Information

URL: http://lars.yencken.org/datasets/phd/

Original Notice:
This page describes a number of data sets released as part of my PhD work.
All data sets on this page are released under the Creative Commons Attribution 3.0 Unported license.
Unless otherwise specified, the appropriate academic citation for any of these datasets is:

Yencken, Lars (2010) Orthographic support for passing the reading hurdle in Japanese. PhD Thesis, University of Melbourne, Melbourne, Australia.

Disclaimer

I am not responsible for any problems caused by this script. It currently has “works for me (most of the time)” status.

This is still work in progress, any data you enter may get lost accidentally. Just don’t put your PhD work on similar kanji in there yet. In Tampermonkey you can copy/paste your override_db under Edit>Storage.

This script was developed on Chrome Version 61.0.3163.100 (Official Build) (64-bit) with Tampermonkey 4.4. It uses some fairly new features, but a recent browser version should do fine.
I tested it at some stage with Firefox + Tampermonkey/ViolentMonkey, but just message me if you run into trouble.

Other Scripts

One database is imported from the composition script:

76 Likes

At least @patjennings24 and @Ryouki were interested in this (I found nice DBs, release faster than expected :wink: ).

1 Like

Wow, that was fast! Thank you so much! I’ll certainly be installing it today!

Awesome. Gonna try it out now. Thanks!

Looks nice. I love these more passive, micro-informational scripts. :smile:

If you add a link to greasyfork.org in the OP then this script will be listed by the [Unsupported] App Store script. Please consider including the app store hook (see script OP) so that folks can tell if it’s installed (and how many active users of the script there are).

Any link to greasyfork, or to where? Also, I get a 404 for https://www.wanikani.com/script/appStore, what am I doing wrong (Chrome/Tampermonkey)?

I didn’t realize that you weren’t hosting your script on greasyfork. That app store only knows to look for links to the greasyfork.org. :man_shrugging: I might have to change the app store away from tampering with a 404 page. It seems to cause more problems that it’s worth.

@hitechbunny Not sure how you find the scripts, you might also check for links to files ending in .user.js.

Looks like there were now major problems, marked as stable now.

Fixes:
Changed sorting in grid. Kanji in the grid are sorted by a score, previously the order was not unique when the score was equal, so the kanji would shift around in the grid after deletion (annoying when you wanted to delete two kanji in a row quickly)

1 Like

https://www.wanikani.com/kanji/%E5%88%83

匁 has “undefined” under reading. I am aware it has no 音読み listed on Jisho, just thought I’d mention it.

1 Like

@gzovak, Thanks, I also found it, it’s fixed now. It was the only one in the database.

I was pleasantly surprised to see this pop up during lessons (I missed reading this was a thing).
However I wasn’t happy with it’s position within the examples tab so I went to edit it in Tampermonkey to change it to how I would like but the way you have things set up doesn’t allow me to easily change it. I would have liked to put it underneath the Vocabulary Examples section i.e. after the div#supplement-kan-related-vocabulary instead of before it. Maybe have it as a variable in the script so one can change the location of the Visually Similar Kanji section to their liking?

Would you be able to do something like this?

Or maybe I completely missed something, in which case could you point me in the right direction?

I was thinking about some way to move it (like drag and drop or up/down buttons) and then remember the change. I will move the vocab examples up by default for now, it has a fixed height so it’s better on top.

Edit: you can get the new version now :wink:

1 Like

@jprspereira

Your questions is related to Niai :wink:

Actually I am not really checking which items you have unlocked, I just show everything on your current level or higher as locked. It looked like you need to download a lot of stuff each time to make the check. However I’m considering to use new API v2 to fetch this from WK. The readings and meanings I use are also detached from WK, this will be better then as well.

1 Like

I see, thank you for the clarification :slight_smile:

1 Like

This is an amazing plugin, very helpful, thank you!

Suggestion (or maybe I’m stupid and haven’t found it): please make reordering of the similar kanji possible. Now I have to delete the non-similar kanji in front (how does the plugin determine them anyway?) which presumably makes them disappear forever?

1 Like

My pleasure :wink:

There is a “reset button” to make everything factory state again for a single kanji, it basically deletes the current kanji from the override DB (see below).

The userscript uses several data sources that give “points” to kanji, which determines the order.

Items 2. and 3. come from a doctoral thesis of someone (http://lars.yencken.org/datasets/phd/). They are machine-generated as far as I understand. Mostly very good, but sometimes there is a 一 or 二 or something with an insanely high score hidden in-between. Main reason why there is an editing feature :wink: These two databases already contains a score from 0–1, so I just use that. (They only have 1945 kanji, however, so a few hundred kanji in WK are not covered.)

If a kanji appears in several places the “higher number” database in this list is used.

  1. The database from the obsolete similar kanji script, everything gets score 0.4
  2. A “Yeh and Li” dataset, somehow based on radicals
  3. “Stroke distance”, I think it tries to figure out how much must change to get from one kanji to the other
  4. Keisei DB (from my other plugin), here the radicals change but the tone mark stays the same (score 0.5)
  5. Manual DB (I’m adding a few kanji that were missed but I feel they should show up (score 0.8)
  6. Override DB: this is what you are editing, deleting gives score -1.0, adding score 1.0

So in principle it is possible to shift kanji around by pushing more differentiated scores than -1 or 1 to the override DB, but I haven’t figured out a way make it user-friendly :slight_smile: Drag’n’drop is possible, but probably not so simple to implement. You could add a kanji that is already in the list to give it a 1 score to move it to the front a bit, but at the moment there are no more user ordering options.

Thanks for your thorough explanation! Yeah, drag 'n drop would make this plugin perfect :slight_smile: Here’s to hoping :smiley:

1 Like

Adding kanji is a very slow process I found out, what would be super-slick is a “community edition” where sorting and additions are synced to others and you can move them around or delete them again (and get a score from that). But it seems there are not that many people who use this script, and a few weeks full-time would need some funding :slight_smile: