Dev Log (Kanji Aid #1)

It’s super hard to write a blog while putting 100% of your all into learning something else.

But blog we must. And blog we shall.

June 2nd, 2022: Kanji Radicals

Today was Day 2 working on the kanji radical system. It is frustrating to develop this because Japanese, like all languages, isn’t consistent at all. The irregularities and exceptions are endless. Here is a my attempt at it.

Every kanji is made up of several radicals.

Radicals can be another kanji: 木 (tree) in 朴 (crude).

Or they can be pure radicals: ⼚ (cliff) in 坂 (slope). In this case ⼚ isn’t a kanji. It’s just a piece used in many kanji.

So I needed to develop a system that:

  1. Takes a kanji and finds what radicals it has (from a json).
  2. Ignore that radical is it has the same keyword as the kanji it belongs to. (Tree is a radical and a kanji, don’t want to show it to the user)
  3. Find radicals in the kanji json by keyword.
  4. But some radicals have multiple keywords, so we need to create a special list every time we look for radicals to make sure no duplicate kanji/radicals appear and which also gives us access to those keywords so the users can use them to make mnemonics later.
  5. Some radicals are “pure” and aren’t in the json at all. These we have to get another way.
  6. But those “pure” radicals share keywords with kanji that are in the json. So searching for stuff by keyword returns false positives.

7. Just give up and live in a cave. Send my family mushrooms.

Confused?

So I gotta make an algorithm that does all that and I’m still learning Swift and Swift UI and hoo boy, what a day. Can’t wait for those bugs to start popping up.

Trying to write the algorithm.

Thanks for reading. Any advice or wanna chat? Please reach out.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Liyicky

Liyicky

Hey, I’m Jason Cheladyn. Going back to the coding world after 6 years of teaching English in Japan. https://www.twitter.com/liyicky https://www.liyicky.com