[Userscript] Keisei 形声 Semantic-Phonetic Composition

I can add it to the options, or maybe make it drag-able to change the position and store it. I’m currently on a trip, but it’s simple to add when I’m back.

It shows how useful the phonetic mark for a kanji is. Both the phonetic components and kanji can have several readings, so it’s hard to see how useful the phonetic components is for a kanji.

For example, let’s say we have a phonetic component that reads ほう and a kanji that includes it.

Signs

  • 天: The kanji is also read ほう (and nothing else).
  • 上: The kanji is read ほう and (say) ぼう. ほう is still the main reading, so the phonetic mark helps, but rarely it’s wrong.
  • 中: The main reading is not ほう, but rarely it can appear as ほう. The phonetic component is not very helpful.
  • 下: This kanji is never read as ほう. You have to remember this kanji as a “phonetic exception”.

There is also a “dakuten mode” that is more lenient what is considered a good match. Maybe you noticed that readings like ほう, ぼう, もう or き, ぎ often appear as readings together. This is because they were almost interchangeable in the past, and with some intuition you can reconstruct the reading from the phonetic component even if it doesn’t literally match.

Colors

  • Green – good match
  • Red – bad match
  • Yellow – “obscure” kanji, the phonetic component got changed somehow, or even replaced. The kanji looks different, but the reading comes from the phonetic component. (After WW2 the Japanese government did some script reforms to “simplify” kanji usage, but made everything less regular and intuitive).

You can also click the circle to manually change the color to yellow (like a personal marker).

8 Likes

Thanks a bunch. You probably should add this information as docs to the original post. It’s really helpful.

2 Likes

this is great

I’ve just started using userscripts. is there no way to add this to any of the wanikani apps? I use allicrab normally and under settings it only provides 5 userscripts as options unfortunately!

Unfortunately the app creator has to add each script manually. I requested a way to load arbitrary scripts, but it hasn’t happened yet.

Ah that’s a shame. As a primarily mobile user it would be great to have more scripts on there!

I also wanted to be able to add more scripts to Allicrab and after a few months of using my own Allicrab build (which I can’t do anymore since my Apple Developer license expired) I ended up with: Running userscripts on iOS: a workaround

Coincidentally, I tried adding the Semantic-Phonetic Composition script to my iOS app today. Unfortunately it seems like it uses a couple of userscript specific features and it would need a bit more adjustments than the other scripts I included so far. I’m planning on doing that eventually but it seems like no one else is interested in going through the trouble of deploying their own app (which I can understand, of course).

I was considering to rewrite some parts to make “Keisei2”, using the open framework and getting rid of the GM_x parts because they have compatibility issues despite doing simple operations, but I’m a bit unmotivated lately :slight_smile:

I could also generate a one-file version with everything included to make the integration easier.

:exploding_head: never knew this!

Agreed!

If that was super duper easy and quick for you then I would appreciate it but otherwise I don’t want to waste your time on this. At the moment it seems that no one else is interested in deploying their own app so if it was just me using it, it wouldn’t really be worth it.

I would love to improve my little workaround app and make it easily available for everyone via the app store, including the Keisei script. However, I can not do that without an apple developer license and since I had some negative experiences with the app store approval process so I don’t really want to pay for the license anymore. That leaves only the option of people installing XCode and deploying the app to their own devices (and updating it weekly) but it seems like that is too much trouble for most people to go through.

There are also people who want to edit the script on their machine, which is currently not possible because everything is included as files.

Installing xcode alone is already a hassle without editing some files, I can understand why people rather pass :slight_smile:

Oh, I can completely understand that too. I usually don’t have XCode installed either and during the installation process I was close to just cancelling and giving up at that point already.

I’m still tempted to buy a license again and try and make my little userscript app available as least as a Beta version… I’ll keep an eye on this thread and see if motivation has snuck up on you and there is a merged version of the script available.

New version 1.7.6, finally I came around to fix the layout a bit (at least make it more sane).

@jbradleyc @valeth Unfortunately the dark theme still looks a bit off because it forces wrap for all character grids, but it should be easier to fix now because it is just two uls side-by-side now.

5 Likes

Awesome, thanks! This script is honestly one of WK’s biggest advantages over using alternatives like Anki IMO. Learning all the phonetic components and their exceptions, and being able to see them at a glance brings a massive shortcut to the learning process.

2 Likes

@acm2010 Looks like the latest update messed up the expanded view.

1 Like

Fixed now in 1.7.8, there was a typo in a class name, and the non-compound grid worked a bit different than expected.

I also changed the layout for small screens a bit with the change to flexbox, it should finally look OK on phones as well.

1 Like

I wasn’t aware you could even use userscripts on mobile, how does that work?

I haven’t really tried it on my own, but for Android there is Tampermonkey in the play store, and I believe Firefox mobile has extension support built in.

Apple forbids stuff like running code that doesn’t come from the App Store, but apps could include the script (it uses a few Tampermonkey extensions at the moment, though), you could build your own, see a bit above :slight_smile:

1 Like

@acm2010 can you help me?
I have no idea how it work
for instance can you describe this image? How it work, what it mean

Hi, I´m using your script on firefox, and if I start it after the browser opens, it works fine, but if I restart my browser (I have it set to always restore my last browsing session) it crashes all my scripts (but not the browser itself). I’ve tried disabling scripts, clearing the cache, and looking at the debug info but I can’t seem to find the problem. Any ideas?

I think there is a bug in the script manager extension that completely stops it. Are you using Tampermonkey?

My guess is that one of the functions it provides to store files or settings fails under certain circumstances. I was never able reproduce it, someone would have to run Tampermonkey in a debugger to see what the problem is. You could try to set Tampermonkey’s logging level to debug and see if there are more clues.

After the scripts crash, do they work again after reload or closing a tab?

The only thing I could do is to rewrite all parts that use Tampermonkey specific functionality and switch to the WK open framework, but I am not totally certain that will fix the issue.

1 Like