[Userscript] Keisei 形声 Semantic-Phonetic Composition

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

No, they stay broken until I disable Keisei and restart firefox. I´m using tampermonkey. I´ve looked, and the console gives me this error

TypeError: r.$next_tip is undefined[Learn More] application-256bfaa1f8d87013b0517aedbadf8f3eed22cd095caf3d1b422e410bcd1864c2.js:5:298

pos_default https://cdn.wanikani.com/assets/default-v2/application-256bfaa1f8d87013b0517aedbadf8f3eed22cd095caf3d1b422e410bcd1864c2.js:5:298 init/</< https://cdn.wanikani.com/assets/default-v2/application-256bfaa1f8d87013b0517aedbadf8f3eed22cd095caf3d1b422e410bcd1864c2.js:4:29879 dispatch https://cdn.wanikani.com/assets/default-v2/application-256bfaa1f8d87013b0517aedbadf8f3eed22cd095caf3d1b422e410bcd1864c2.js:2:21544 add/g.handle https://cdn.wanikani.com/assets/default-v2/application-256bfaa1f8d87013b0517aedbadf8f3eed22cd095caf3d1b422e410bcd1864c2.js:2:18274

1 Like

That error looks like it’s coming from WK, it handles the displaying of a tooltip or something. I don’t think it is related, it will only prevent something from disappearing on screen.

If you have to restart Firefox then something more fundamental is breaking (something that should be untouchable by userscripts). Either a bug in Firefox or Tampermonkey.

Did this problem start recently? If you don’t use the session restore for WK, does it work without issues? Like closing WK before closing the browser, restarting, opening WK again?

I finally fixed it! I did a factory reset of all my scripts, and it works fine now! Thanks!

1 Like

@acm2010 Any reason 搾 doesn’t belong in the 乍 group?

I’m always splitting the kanji into two parts, so 搾 is 手 + 窄. Then 窄 can be further divided into 穴 + 乍 (where it gets its reading from as well), so the on-reading comes from 乍 in a way, but the phonetic element is still 窄.

This actually happens quite frequently, but it is less obvious than in 搾, like 湧 = 水 + (勇 = 力 + 甬), so I think it better to treat the “compound phonetics” as they are, so everything is split in two parts only.

I added 窄 as a phonetic component, so now 乍 will now show up in the “more info fold” for 搾.

1 Like

Perhaps a foolish question, but what do you mean by factory reset?

From what you describe, I might be having a similar problem with the script with Firefox and TamperMonkey. At seemingly random times, all my scripts break - but everything fixes itself if I turn Keisei off and refresh.

So far, I got it to work most of the times by closing and restarting the browser, but this morning it kept not working (of course when I want to do lessons - where I need this script most. :joy:).

Do you mean you reinstalled things from scratch?

It looks like 日 on top of 女 might be a phonetic component for えん. The following kanji all have the on’yomi えん:

I don’t see any other kanji on jisho with that same configuration for 日 and 女.

1 Like

Thanks, I added two components 妟 and 匽. I didn’t add them yet because they only have one compound in WK joyo/jinmeiyo, but jigen lists a few more (probably needs some more complete font to see :slight_smile:):

: , 𩷑
匽: , , , , , , 𧓱, ,

3 Likes

Wow, that’s a lot! Two of those won’t even render on my phone. I can’t even find on’yomi readings listed on that website though.

The site doesn’t list the Japanese readings for all kanji, it could be that the kanji were never really used in Japan so they didn’t get an on yomi, or the site just doesn’t have it.

It does list the reading in some Chinese dialect (no idea about the details :smile:), the lower part is about Middle Chinese (from the time the readings were imported to Japan).

1 Like

Thanks for making this, @acm2010. I just installed this a little bit ago at level 25, and while it’s already useful, I can see that it will be even more helpful on later levels.

Should there also be an entry for “Work” under the “Heavy” radical? I just mistook “Work” for “Move” and expected to see both kanji in the same lineup.

image

1 Like

I was looking this up a bit, it turned out to be quite interesting :slight_smile:

Initially I had the category “kokuji” for kanji made in Japan. 働 was made in Japan, from 人 and 動. Just because it was in that category I didn’t check further because why should a kokuji have a Chinese reading?

That was wrong of course, 働 has a “fake Chinese reading”, which was created with semantic-phonetic composition by the Japanese. But the composition is still 人 + 動, you are only splitting a kanji once. But you could view 動 as 重 giving an “inherited” reading to the whole kanji. But that doesn’t always work, so the phonetic component is 動.

Another thing is that the reading of 動 is not fitting nicely with 重, it turns out that 重 and are closely related, and 動 was even using 童 instead of 重 before. So in a way 童 is the “real actual” phonetic component of 動, and by inheritance also of 働.


So in summary I added 動 as a phonetic of its own, and connected 重 and 童 in the database.

4 Likes

I just installed this yesterday and I’m really appreciating it so far. I’ve also been really surprised at how much I’d managed to internalise and without consciously knowing it!

Thanks for the excellent script!

1 Like