Learn Kanji Sound Components
About the Project
(This is a sister project to Learn Kanji Radicals, therefore the copy here will be similar.)
This is a simple app that assists in helping learn how to pronounce Japanese Kanji characters.
I have been learning Japanese on my own for over five years.
Japanese uses two types of scripts, kana and kanji.
Kanji were brought to Japan from China over a thousand years ago by immigrants.
At this time, Japanese was only a verbal language, it did not have a writing system of its own.
The Japanese writing system began by taking existing Chinese characters, preserving their original Chinese meaning and attaching the Japanese pronunciation of these concepts.
There are thousands of kanji that are currently in use, and most kanji have multiple valid pronunciations.
Happily, the original Chinese characters had an inbuilt system that made it easier to infer the meaning and pronunciation of a kanji by looking at it.
Basically, they are made up of components, these components hold information about the meaning and pronunciation about the kanji.
By committing to memory how these components are pronounced, it’s possible to infer the pronunciation of a lot of kanji - even in the case where you are unfamiliar with said kanji.
If you are interested in the specifics of how this works, please read this article by Natalie Cumming Hamilton.
It was her book The Kanji Code, that inspired this app.
How it is used
The app is very straightforward.
Basically there is a grid of flashcards each with a “sound component”, and you can click on one to see the pronunciation (represented by a phonetic Kana character).
By default, they are all grouped into categories according to what kind of sound they make.
There are buttons to turn off the categories as well as scramble the order.
The idea here is that it’s more efficient to learn the pronunciation of components that sound the same together, but it is more meaningful to test yourself without categories or a consistent order.
How it was built
Learn Kanji Sound Components was written in Elm, a functional, strictly-typed, ML-inspired language that compiles to Javascript.
It’s tagline is “A delightful language for reliable web applications” which I definitely agree with.
The idea of a functional language, is basically that an app is written as a large collection of functions which simply take an input and modify an output with no side effects.
Building software in this way makes it much easier to parse, read and maintain over the long term.
My experience using functional languages like Elm has definitely improved my ability to write clean, maintainable code even when using other languages.
Elm here replaced both the HTML and the Javascript, and I used the package Elm UI to style the app, effectively replacing CSS.
Instead of three different languages, and potentially one or more Javascript frameworks, the whole app was written in Elm.
The only thing I don’t like about Elm is that when it compiles to HTML, CSS and Javascript, the compiled code is illegible.
If you were to view the source from the browser, the result would be difficult to read and make sense of. The names of variables, functions, classes and so forth would not be meaningful as they were generated at compile time.