[Userscript] ConfusionGuesser

It’s a sad world :joy:

1 Like

Is there a way to tell if IDS is successfully activated?

You can test it in the following way:

  1. Start a review session (https://www.wanikani.com/review/session)
  2. In the ConfusionGuesser settings in the tab “Interface”, activate “Show ratings”
    2a. You might also need to disable “Guess only learned items” in the tab “Functionality”
  3. Open the console of your webbrowser (Ctrl+Shift+I), paste the following code into it, and press the enter key in the console:
$.jStorage.set("questionType", "meaning");
$.jStorage.set("currentItem", {kan: "歹"});
document.getElementById("user-response").value = "evening";
document.querySelector("#answer-form fieldset").classList.add("incorrect");

The first two lines pretend that you are currently reviewing the kanji 歹, the third line gives the answer “evening” (which is wrong, as that would be 夕), and the fourth line triggers my userscript to provide guesses. If it successfully uses the ideographic description sequences, the top guess should be 夕 with a similarity rating of 0.5. If it didn’t use the IDS, then it is only rated with 0.1, which I’ve set as the minimum for kanji similarity.


Afterwards, you should close or refresh this tab.

Why were you asking? Did you get strange results after activating the usage of IDS?

3 Likes

@Sinyaven Do you mind if I add your script to the API thread? Many users are directed there for an index of many of the best and most popular scripts. Afaik, yours isn’t there, and I’m sure a lot of users are missing out (or will be, once this thread disappears into the ether).

4 Likes

Oh yes, please add it :slight_smile:
I had forgotten that this thread exists. Thanks for checking if my script is in there. I guess I could also add it myself, but the list seems overwhelmingly long, so it would probably take me some time to find the place where it belongs.

4 Likes

My pleasure. I had to disconnect your name (@ Sinyaven) in the mentions because there’s some bug going on with the 10 mention limit. The thread is easier to navigate when you find the table of contents (albeit well hidden).


The worst part is having to scroll to the bottom to find the edit button :rofl:

3 Likes

It’s not a bug, so sadly we have to do that with the wikis. There’s a list at the top of that post (only visible in the editor) which details which users have the most entries in the list, so we mention only the 10 most frequent users.

Yeah, if you can think of a better way to display the ToC that would be great

You can also click the edit history button first, and then there’s a more accessible edit button in that popup.

1 Like

I literally forgot to download this last time, and only started using this now. It is absolutely amazing. It just tackled like three of my big leeches in the first few minutes. 10/10

1 Like

And here I thought you didn’t like it since I couldn’t find it in the list of your userscripts that you have posted in your level 60 post XD
I hope that it is helpful to you :slight_smile: Even if the IDS-based kanji similarity rating is still pretty bad. I should probably think up a better algorithm when I get time.

2 Likes

The answer I was confusing it with has so far always been in the list, so it’s perfect still :slight_smile:
Sorry I caused you to think I didn’t like it :cold_sweat:

EDIT: Gave you some much deserved publicity boost. :yum:

2 Likes

I’m just surprised the 10 user limit isn’t disabled for Wiki’s. That’s a pretty glaring oversight on Discourse’s part it seems. Thanks for the tips. I’ll have a think on the ToC.

1 Like

I’m wondering :thinking:
Can this script not suggest the same thing I had typed? This case is for a kanji that has more than one reading.

For example, this one, can I have “goku” as the suggestion instead of “kyoku” because that’s the same thing as I typed.

The guesses are not suggestions - the script tries to display the WK item that led you to giving this answer. In this case, you thought of 極 with the きょく reading, so this is what you are shown.

In addition to this reasoning, I also think きょく is more informative than ごく would be here: it tells you that きょく was indeed a valid reading for 極. ごく on the other hand would just duplicate the information already available through WaniKani’s Item Info button, where it shows you that the correct vocab reading would have been ごくらく.

And last but not least, it might also be more fun to not immediately get the correct answer displayed. When you see on⬄on きょく, you realize that you have thought of the wrong on’yomi and then might recall the correct reading for this vocab on your own, leaving you with some sense of accomplishment even though you failed the review.

2 Likes

Loving it so far but any chance you can add a font size setting? I often do my reviews from across a room, certainly no way I can read them. While I’m certainly willing to change my behavior, others have difficulty with their eyes and font size options can be a godsend.

I have added a dropdown menu in the settings dialog to choose a font size (script version 1.1). I hope these presets are good enough - if not please let me know.

1 Like

They work well for me, thanks a lot for adding them.

1 Like

Version 1.2 patch-notes:

WaniKani's hidden whitelist can now be considered for guesses (deactivated by default)

Some WK items have additional meanings in a hidden whitelist. For example 矛 was once translated as “halberd” which is still in the whitelist. This also applies to the radical names that were changed in the big overhaul - 廴 for example still has “big bird” whitelisted. ConfusionGuesser can now guess 殳 if you somewhere wrongly answer with “ikea”, and also show you what the thing is that Koichi likes so much that he had named three radicals after it:

Your own added synonyms can now be considered for guesses (deactivated by default)

WK allows users to enter their own synonyms. ConfusionGuesser can now base guesses on these user synonyms.

Adaptions to mapping of reading to kanji

examples: 挿絵 - さし|え instead of さ|しえ; 巻尺 - まき|じゃく instead of ま|きじゃく

  • until now the mapping was prioritized from left to right; for vocab where okurigana was “pulled into the kanji”, this led to wrong mappings
    example: 挿絵 was split up さ|しえ - 挿 has kun’yomi さ, and しえ was assumed to be a special reading for 絵
    changed so that it now prioritizes shorter matches on the right:
    挿絵 is now split up さし|え - 絵 has on’yomi え, and さし is assumed to be a special reading for 挿
Adaptions to similarity rating
  • increased rating if two consecutive kanji are swapped
    example 1: 栄光 and 光栄 are now rated 0.85 instead of 0.5
    example 2: 過疎 and 疎開 are now rated 0.4 instead of 0.1
    Reason for this change: I wanted 疎開 to win against 避難 in their similarity to 過疎
  • manually defined two component pairs as equal (IDS similarity)
    囗 is defined equal to 口
    厶 is defined equal to ム
    example: 公 and ム now have IDS similarity 0.38 instead of 0.1 (minimum similarity)
Prevent removal of important guesses that happened in rare cases

example: until now, when answering with へいじ for 幽閉, no top guess for the wrong じ was displayed; it would have been 閉, but 閉 was already a guess for へい with an equally high rating, and duplicate guesses are deleted

If I broke something please let me know.
Link to previous script version for downgrading in case version 1.2 doesn’t work for you

2 Likes

This script is amazing, thank you!

2 Likes

Version 1.3 patch-notes:

Changed guess duplicate removal

In version 1.2 I’ve changed the duplicate removal function to remove fewer guesses. Of course I overshot and now left in too many guesses. Example: 那 has two valid reading answers: な and だ; if I answered with ぐん, the script guessed 郡 for the な version as well as for the だ version of the question, and the duplicate removal wasn’t allowed to remove either of them as they were the top guesses for each version.

This patch changes the duplicate removal to only consider guesses as equal if they match in item AND reading (so answering へいじ for 幽閉 still shows you (へい) as well as ()), but it is now again allowed to remove top guesses (so that in the 那 case described above, you only get (ぐん) displayed once).

If I broke something please let me know.
Link to previous script version for downgrading in case version 1.3 doesn’t work for you

1 Like

Just wanted to let you know that this user script is amazing. This has heavily improved my studying. This script is a must-have in my opinion.

1 Like