Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

漢字 Linear Algebra

Multiply Japanese or Chinese characters by their radicals to discover new characters. What happens when 木 × 木 = 林? Type any characters to find out.

Try it live

Discussed on r/LearnJapanese (2,000+ upvotes)

linear-algebra.mov

How It Works

Enter CJK characters as a column vector and a row vector. The app computes their "product": for each pair of characters, it finds all characters composed of those two components using Ideographic Description Sequences. For example, 木 × 木 yields 林 because 林 = ⿰木木.

Radical variants are mapped to their base forms (e.g. 氵→水, 灬→火), so 水 × 火 → 淡 works even though 淡 is technically ⿰氵炎.

Other mathematical operations may be coming soon.

Running Locally

Open index.html in a browser. No build step or server needed. It's a single HTML file plus a generated data.js.

Regenerating data

If you want to rebuild data.js from the source dictionaries:

python3 preprocess.py

This requires ids.txt, zh-defs.json, and jp-defs.json in the project root.

Acknowledgements

This project uses the following data sources:

About

Perform linear algebra operations on Japanese or Chinese characters.

Topics

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages