Project Report: Kana and Kanji Conversion

Facebook
LinkedIn
Twitter
Email

The link to the GitHub directory is near the bottom of the page!
GitHubディレクトリのリンクは本ページの下側にあります。

Creating an Extension that Converts Between Kyūjitai/Shinjitai and Historical/Modern Kana Orthography

The extension's GUI

Introduction

This post may be seen as a follow-up post on traditional kana orthography and kyūjitai that I made this time last last year. In it, I created a dictionary with over 10,000 entries for the Japanese Google IME that covers the many traditional characters and their variations. I also posted several resources to converters for kana and kanji.

Ever since this post, I have delved much more into studying older Japanese, and I have increasingly been interested in somehow creating an extension that dynamically converts characters from their shinjitai (simplified character forms) into their kyūjitai (traditional character forms). For some background, many people are aware that Chinese (Mandarin) has two main character sets: simplified and traditional. While the spoken language doesn’t change, the character sets are quite different in their appearance. Since many people still use the traditional character in their daily lives, several extensions exist that change a webpage’s characters from simplified to traditional and vice versa. However, since only a small percentage of Japanese speakers decide to still use any combination kyūjitai and traditional kana orthography, the demand to make an extension like this is extremely small. Before I made the extension, only static webpage converters existed (i.e. you input text in and it gives text back out on a dedicated converter page).

 
 

Process

To create this extension, I decided to first start by learning some HTML and CSS. While I won’t dive into the specifics, I did complete a 6.5 hour-long course on the subject and I felt quite comfortable in being able to read and create fundamental web code. After this, I intended to begin delving into JavaScript, however I first decided to try my luck and download a copy of the open-source Simplified/Traditional Chinese character converter I use and looked at its code. 

To my surprise, I was able to break down the extension’s code and understand what parts did what in relation to converting the characters. Because of this, I was able to avoid reinventing the wheel and only had to format the relevant kana orthography dictionaries, implement the correct kanji character sets, and rewrite some parts of the plugin’s code (especially around its interface) to achieve what I wanted to do.

 
 

Result

As a result of this tinkering, I now have a functional extension that can convert any webpage’s Japanese into its traditional counterparts. There are a few drawbacks, however. Firstly, when converting kana, large webpages seem to lag the browser as it undergoes conversion. In the future, I would like to remedy this, but for the time being I am happy the extension still works in the first place. Secondly, the extension can sometimes stop working on a given webpage. This is a bug that is inherited from the main extension, and while I would like to fix this, it more than likely requires a fundamental rewrite of the code. Lastly, the extension file has two versions, one that does kana and total kanji conversion (this not only includes uniformly converting a given character i.e. “general kanji conversion”, but also certain words where traditional kanji got merged/replaced by a new one i.e. “fine character conversion”) all at once, and one that is able to independently convert kana (while also maintaining some rough kanji conversion capability). While I tried my best to combine this functionality into one extension file, the program kept breaking and I had to compromise by making two versions of the file.

In any case, the extension is available for Google Chrome, and can be found on GitHub for free. Please refer to the GitHub page for download instructions.

 
 
Facebook
LinkedIn
Twitter
Email

Contact me

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.