Adding custom vocabulary to WaniKani

Personally I don’t make distinctions between Kanji and Radicals.

Also, if Radicals aren’t a Kanji, it’s probably not worth learning or focusing on remembering deeply.

1 Like

@saraqael

Thank you for that link! Seeing @polv 's thought process reminds me that I don’t have the knowledge to build new vocabulary or Kanji decks myself haha, I can only provide the tool to do so for others. This gives me hope that more advanced users like him can build some pretty awesome WK expansion decks.

Side note: It’s kind of funny, locally my project is named WaniBeyond :sweat_smile:, which seems to be the name of his project already. I’ve gone ahead and changed the name.

@polv

After reading your thread, I think I agree. I’m thinking no custom radicals, because I’m not entirely sure how that would even be handled since WaniKani custom radicals are served as images. I guess in theory people could make their own images …, but that could get interesting

3 Likes

A simple way is like this, (<big lang="ja">繋</big>), then capture screen with ShareX. Normal screenshot is possible too, but that would add extra steps of cropping.

About vocabularies / Kanji deck, it is unlikely that I would add enough Kanji as well… Certainly, I might not take time to add Kanji I don’t need to learn. However, Wanikani Kanji themselves might be numerous enough

For helpful vocabularies associated with Wanikani Kanji, they can be found in any dictionaries, but to keep up with reading choices and categorized meanings, a JJ dictionary is pretty much unavoidable. So I might say, vocabularies can be scraped from there. Jisho Kanji’s KANJIDIC is a discontinued project, or so I believe. An alternative, a good paperback reference in English, might be available, however.

It shows it well, how little time I had, that I couldn’t really form a really good response in this thread either for a few weeks now :joy:

What my goal was for WICS, was basically being able to create entirely custom decks of cards with all of the features, that wanikani already offers, be it radicals, kanji or vocab items. Then those files could be shared through either a dedicated thread, or possibly later on on a dedicated site (just like ankiweb), and if someone happens to want to study those words, they could just grab that, load it in and then they could learn those words. For example, one could have mathematics words, biology words, words for book clubs, etc etc. Eventually I even wanted to do stuff like kana-only items, that would function very much like regular vocab words, but wouldn’t need a separate reading question (because of course).

I didn’t do much work on it because of 2 major reasons. One is of course, that I didn’t have much time for it, though I certainly did do other programming projects since then, so that’s not the whole story. Secondly though, there was this pesky little thing called script compatibility mode, that meant, that any work I did was going to be needed to be doubled up, first to support the old-style review endpoint, then to support the new-style review endpoint with its accompanying endpoints. This also meant a different potential issue.

How would one go about this? How do you make the experience completely seamless? Well, simple, you hijack the web request, that gets the items for you, and you put in additional content before passing it back to the caller. Now, as far as I can tell, half of wanikani uses… shivers jquery, while the other half uses good old fetch. Fetch is easy enough to monkeypatch for this purpose. JQuery though is a different beast. You either catch the moment between it and the script using it being loaded (which isn’t as bad, as it sounds… because it’s actually worse), or you monkeypatch XmlHttpRequest, which is fun, because jquery already is using a monkeypatched xmlhttprequest, so your possibilities are very much limited. Btw, this is the reason, I needed to move over to an extension, rather than a userscript. Chrome is just so awesome at its job, a script just can’t reliably load before anything on the page does.

Up until now, I was basically in the state of waiting for compatibility mode to let out the review changes from its claws (though I certainly didn’t expect it to be because it’s getting slain, but oh well), just so I can see if jquery is a thing that stays with us, or if the review stack will forget the past already. It’s certainly staying with us now, but I planned to finally get some workable code down at the start of 2023. (Could call it a New Year’s Resolution as well, I call it “finally gorbit is not being lazy”, but either works).

Regardless, would be great to have a similar project going on, could compare some notes, and I’ll start that right now.

Promised note comparing here

In my mind, if you already have kanji and vocab working, radicals are such a small step, that even a virtually nonexistant usefulness outweighs it. Some people would probably want to at least have some radicals of their own. Especially if a bunch of kanji with a similar meaning share one of their parts.

I was meaning to use some feature like chrome’s built in extension sync, or some other server or storage solution to actually synchronize progress, so you could move between computers without much worry (Yes, I do sometimes do wanikani at work, don’t at me)

I would much rather rewrite haku, than that, thank you very much

It’s a good idea to look into the Webextensions API for firefox, mainly because it has a great polyfill for chrome, and that could knock out 99% of all browsers actually used in one motion.

As long as you give them a

95% of the cases, it would just be an already existing kanji. But technically speaking, if someone is motivated enough to make a comprehensive deck, then they could probably do that as well. Storing these as a base64 image link wouldn’t be a big issue either.

5 Likes

If you are both going to make extensions for this, it would definitely be amazing if the same custom decks worked in both, whether that be by using the same format for them (almost certainly the best way) or making the extensions convert the other’s decks to their own format (obviously a less ideal and more complicated option) :sweat_smile:
Also, depending on how you make the extensions work, it could be nice to be able to import/export decks with SRS progress saved in them (so for example when exporting a deck, if that’s something you’re planning on implementing, having a checkbox or something to include SRS data, therefore making it possible to transfer progress between extensions, or PCs if there’s no online syncing built into the extension)

Kana-only items is also a possible feature I forgot to mention before @jhendrix13, but which would be amazing to have. There’s quite a lot of very common japanese words which are kana-only (or which virtually never are written in kanji) which are exactly what’s missing from WaniKani!

Thank you both for your hard work :smiley:

2 Likes

Yup! To be able to just simply browse some sort of directory of pre-built decks for whatever topic and install them straight to the WaniKani interface … super useful, imo. Also, a big part of the WaniKani community seems to be book clubs. So maybe even decks for each new book week?

While I recognize the usefulness and power of Anki and other similar platforms, I’ve personally tried them and I just can’t stick to them. There is something about WaniKani that grabs me, so this idea has been in my head since my beginning here.

there was this pesky little thing called script compatibility mode

I’ve heard of it, but I never looked into it. I just recently saw that it was being removed. I chose the best time to start this project. :joy:

Well, simple, you hijack the web request, that […]

Exactly! I have actually already written the majority of the code for the extension, and this has been my approach. You intercept the web request at the lowest level possible, inject your data, then return the request back to WaniKani. In theory, this method should not interfere with the majority of userscripts already available.

I haven’t looked at a lot of userscripts, but every one I did review I noticed they use WKOF. I assume the author if that took the same if not a similar approach.

Btw, this is the reason, I needed to move over to an extension, rather than a userscript. Chrome is just so awesome at its job, a script just can’t reliably load before anything on the page does.

Yup, you get a little bit more freedom with an extension I think.

Plus, with Manifest V3, I think support is going to be killed for remote code (read: Tampermonkey).

Regardless, would be great to have a similar project going on, could compare some notes, and I’ll start that right now.

Absolutely! Any collective effort to bring a better product to the community is always welcomed. I’d be happy to share my ideas & challenges and vice versa.

Thank you!


With all that said, an update on the project: now most of my time currently is wrapped up in building the “marketplace”/directory website portion of this project. I’m working with a completely unfamiliar tech stack, so it’s taken a bit more effort to get that going (plus, it’s been about two years since I’ve written code . . . ).

1 Like

If you are both going to make extensions for this, it would definitely be amazing if the same custom decks worked in both

I truly underestimated how many userscripts some of you guys have installed at any given time :sweat_smile:. So with that said, compatibility is definitely one of my priorities with this project.

Also, depending on how you make the extensions work, it could be nice to be able to import/export decks with SRS progress saved in them

I’m not sure I understand. Where would you be exporting your SRS data to?

If you mean, for example, something like Anki then I wouldn’t be entirely sure how that program implements intervals. I’m not really familiar with Anki.

making it possible to transfer progress between extensions, or PCs if there’s no online syncing built into the extension

If a user choses to opt-in, yes online syncing will be available. Wherever you install the extension your decks and progress would come with it.

Kana-only items is also a possible feature I forgot to mention before @jhendrix13, but which would be amazing to have.

This is, personally, one of the biggest reasons I wanted to start this project. :grin:

1 Like

I was thinking mainly of being able to switch between the (possibly) various extra vocab extensions and making use of the (hopefully) compatible decks without losing all my progress :sweat_smile: Or also making backups of progress.
Obviously it’s a lower importance feature, but I imagine it maybe wouldn’t be too hard to for example include an optional field in the vocab sets (a key-value for each object/word in a JSON for example if that was the chosen format), which if it wasn’t there just defaulted to start that item as a lesson, or otherwise to start it at the determined SRS level. For example:

{
  {
    type: "kana-only",
    word: "キラキラ",
    translation: "glitter, sparkle",
    mnemonic: "...",
    srsStage: 3, //eg. 0=new, 1=apprentice 1, 2=app. 2, etc - this line optional defaulting to 0
  }
}

In any case, just an idea for making everything more interoperable and convenient, obviously no obligation to make this a feature, and I’ve no idea how hard it might be with whatever approach you’re taking for the vocab packs!

1 Like

First of all, thank you so much for working on it! It’s honestly the biggest thing I’m missing in Wanikani, it would be such an amazing addition.

A suggestion/question (I tried reading through the thread but I might have missed it, so I apologize in advance if I’m bringing up something you already addressed) - I think it would be great if we could add new vocabulary attached to an existing kanji - for example, if I add the vocabulary “友情”, it would be great if it only appears in lessons once both 友 and 情 are guru-ed, and when I open any of the relevant Kanji pages, it would appear ther too.
I’m not sure how feasible that is, but nevertheless, this would be amazing.

Thanks again for working on it! Have a great week :slight_smile:

1 Like

This is something I hadn’t considered, but that actually sounds like a really cool idea. So if I understood correctly, I could simply add a “Required Conditions” field for each item in your deck. In that field, you can just select options like “Only show when [ other item ] is [ level ].” e.g.: In your example, only show your new vocabulary word when 友 is guru and 情 is guru. Now the item won’t show in your lessons until both of those condition have been met.

Fortunately, to implement this it would be pretty straight forward! Thanks for the cool idea.

3 Likes

Any progress with the project? Just curious :innocent:
I was full of energy last year at some time to make an extension for Wankikani Highlighter. But then a lot of unextected work popped up in my RL so ATM I’m happy to be able to manage my Wanikani schedule concerning my Japanese activities.
So no sweat :+1:

don’t want to advertise in others’ threads, but my version is mostly working on the base features front

2 Likes

Yep! I have just recently released the first version of this project. You can see the thread for it here.

As mentioned, @Gorbit99 has a very similar script too.

3 Likes

Actually, both scripts don’t work for me. I can add vocabularies, but not doing the actual reviews.

Can you report your error on the extension thread please?

1 Like