[Userscript] Keisei 形声 Semantic-Phonetic Composition

On kanji item pages, you should see a new section called “Phonetic-Semantic Composition” located right after the reading mnemonic:

The section should also appear during lessons and reviews.

Can you go through the steps in this guide to gather more information about the problem?

Ok so I’m not dumb, I looked at the right place but… nothing.

Is there a modification to do in the code? Also, is there a file I should maybe download?

Edit woops, didn’t see the end of your message. Will do

1 Like

I found the problem!

So, after testing, there’s one script I have that completely disables this one, it’s called “Advance Context Sentence 2”. I’ve disabled it and it works perfectly.

EDIT

community.wanikani.com/t/userscript-advanced-context-sentence-2 is the script that invalidates this one. Just in case someone needed to know that for troubleshooting purposes?

This is now fixed in version 2.24 of Advanced Context Sentence 2 (the problem was a bugged version of the Custom Icons library script). I also went ahead and updated Keisei and Niai to the newest version of the Custom Icons library script so that all scripts use the same version.

3 Likes

Thanks for your hard work :). I should probably install Niai as well :smiley:

Has anyone been abled to get this script to work on mobile? I’ve tried installing it using Userscripts on Safari but it doesn’t work

Hello! Thank you for a great extension, I’ve been using it quite a lot!

I’ve noticed that some kanji created using semantic-phonetic composition in fact don’t contain 音符()おんぷ in its original form. For example, is said to use 弗 as its phonetic component. It’s likely due to historical evolution and simplification.

So I wonder, if there is any extension that shows the original form of kanji?

1 Like

I don’t know of any WaniKani script doing that but I do have the raw data here with kyuujitai forms:


I finished WaniKani a while ago so I can’t be bothered to hack scripts anymore, but I suppose it wouldn’t be too difficult for a motivated individual to take the data from this spreadsheet and integrate it into the script.

Note that I compiled the data using Wiktionary so it may differ a bit from this keisei script in some corners (I actually believe that my data is more complete, although the difference is probably insignificant).

2 Likes

I just installed this as my first user script, it looks very helpful!

One question though: What do the colored circles in the top left of the kanji mean? There are 天 and 下 circles in red, yellow, and green, as far as I’ve seen, but I can’t find an explanation on them.

天 = perfect phonetic match
上 = strong phonetic connection
中 = weak phonetic connection
下 = no phonetic connection

2 Likes

Thank you!
I think I still don’t understand fully, though. On the page for 的 / Target, the composition looks as follows:

The phonetic component seems to be called しゃく, but the “target” kanji is called てき. The icon however says “perfect phonetic match”.

I think I am misunderstanding something… could you clear that up?

1 Like

This script checks if the readings from a kanji are based of the readings from one of its compounds. Compounds are also kanji, and as you probably know by now kanji can have multiple readings.

If all readings from a kanji are derived from any one of the readings from the compound, it is considered a perfect match. In the example above the compound has both てき and しゃく as reading. This means that kanji with either the てき or しゃく reading, as well as kanji with both readings, are considered a perfect match.

For me this means that the phonetic-composition is only really useful for compounds with just one reading. The non-perfect matches are usually even less usefull.

1 Like

The icons are missing for me here. Does anyone know how to fix it?

Hey guys, trying to use on Safari (Mac, M1) as I’ve loved using this script in the past! Having some problems getting going though.

  • I’ve disabled all other scripts and haven’t been able to get this working.
  • I’ve got Open Framework and tried running with it both disabled and enabled.
  • Using the latest version of the script
  • I don’t have any browser extensions besides my script manager (UserScripts)
  • I have attached the error message in my console

Any help appreciated!

Using this on Firefox and doesn’t seem to be working as of right now. Does anyone know why? It says it is active according to tampermonkey but the actual section isn’t coming up.

It works for me on Chrome. The section shows up only for radicals and kanji pages. This information doesn’t exist for vocabulary.

Script does not work on Firefox, because it seems that jQuery is not injected by Firefox into script context (at least according to ChatGPT :man_shrugging:).

I get the following error when script loads:

Uncaught (in promise) ReferenceError: $ is not defined
    createKeiseiSection WaniKani-Keisei-Phonetic-Semantic-Composition.user.js:2158
    injectKeiseiSection WaniKani-Keisei-Phonetic-Semantic-Composition.user.js:2794

Which is for this part:

        const $section = $(`<section></section>`)
                         .attr(`id`, `keisei_section`)
                         .attr(`style`, style)
                         .addClass(`${GM_info.script.namespace} col1`);

Adding the following line to the script makes it work:

// @require     https://code.jquery.com/jquery-3.6.0.min.js

Ok, installing Open Framework also fixes this issue. I wonder if it would help to add this to the installation instructions. :thinking:

2 Likes

Not working at all for me on chrome. Would be nice to have this again

It works fine on Chrome for me. I suggest looking for a problem on your end.