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$/, "ん"));
}
2 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.

1 Like