Do You Even Kana? Okurigana Matcher

I noticed that this doesn’t accept a trailing 'n' if the vocab word ends in a literal 'ん' (it already worked for words ending in kanji because it just uses /.+/ for them). If anyone else wants it, I changed answerChecker.evaluate to:

answerChecker.evaluate = function(e, t) {
    var isLesson = /^http.*:\/\/www\.wanikani\.com\/lesson/.test(location.href);
    var cI = $.jStorage.get(isLesson ? "l/currentQuizItem" : "currentItem");
    var type = $.jStorage.get(isLesson ? "l/questionType" : "questionType");
    if (cI.voc !== undefined && type === "reading" && !kanaMatches(cI.voc, t)) {
        logMutations();
        return { exception: true };
    } else {
        return oldEvaluate(e, t);
    }
}

function kanaMatches(vocab, input) {
    return makeRegex(vocab).test(input.replace(/n$/, "ん"));
}
3 Likes

I’m thinking this script could use an override or “submit anyway” function for cases where we legit don’t remember the correct answer. Without it, the script refuses to let me submit my answer, and I have to resort to looking up the correct value to continue, which defeats the purpose of the review. Perhaps if the user presses enter more than once (or twice), the script should let the answer be submitted?

Probably a little late for you and I’m not sure if I understood your request correctly but here are two scripts that might help:

  • Double Check: for correcting your answers if you made a typo and manually override the right/wrong identification
  • Don’t know Button: adds a ? to the answer bar if you don’t know the answer and it will submit a long string that cannot possibly be correct

Do you mean if you can’t remember the Kana?
eg. That り is ‘ri’ etc?

It should let you submit anything so long as the kana is correct. You should absolutely be able to get things wrong if you mess up the Kanji. Let me know if that’s not the case.

does this work for the hiragana typing?

I mean if I want to type 作業(さぎょう) but instead I type さぎょ does it have a shake animation to warn it is not correct?

In my understanding this script only checks the okuriganas, that is kana explicitly present in the vocabulary word. For example in 見る the okurigana is る while み is not an okurigana.

In the example you bring I don’t expect any shake because the word doesn’t contains okurigana.

1 Like

@prouleau is correct. I don’t see any benefit of second chances on the Kanji, that’s what we’re here to learn. Might as well install Never Wrong at that point.

With okurigana though, the answer is in the question.

2 Likes

This is the script I didn’t know I needed but I probably don’t deserve.

If you are still developing it, a feature like “only warn if the kanji part matches” would be quite nice. I usually just input something random like あ into the input box if I don’t know a word and this would help me be lazy basically.

3 Likes

Did you say something about wanting to get some practice with your keyboard?

image

It broke btw, so I’m waiting for replacements to arrive tomorrow

But yeah, it’s on the list already, alongside my rabbit hole idea and the latest request in the request thread

1 Like

That is kind of hilarious. What keyboard is it, btw?

tldr, the lesson is, don’t buy shoddy arduino knock offs

1 Like

Cool! I was wondering if it was something like that, though I have not seen that version before

1 Like

I’ll think about it. I don’t think it should be too difficult but I haven’t looked at it for a while.
It’s a good idea.

2 Likes