How to create a new IME in about 15 minutes with SCIM and scim-tables

Introduction

There are many input methods available in SCIM. But sometimes we may need something special - maybe you want to input cuneiform, Tangut, Jurchen, Rongo Rongo or Tocharian. You will not find IMEs for these languages (at least now. I guess it will change in the future :-) ) Another reason can be your desire to input a supported language more conveniently. If you you use English keyboard and are not a native speaker, the existing IMEs may not be convenient for you at all. Yet another example: maybe you came up with a proposition of a new transcription for an existing language (I know this happened with Cantonese) and want to use it in IME on your own computer.

I assume that your system already supports the language you need IME for, ie. there is some standard of encoding, you have fonts and generally programs on your system handle the data in your target language, you just lack suitable IME.

With SCIM, you can create a table based input method without programming. We are going to use scim-tables IME engine.

Specification of the problem

Let us assume that we want to modify existing Korean IME to allow input using transcription (similar to Chinese pinyin input). It is more convenient for non-native speaker with English keyboard.

It is easier with a simple project

We can save ourselves effort by creating a simple project with a makefile. I mean, it saves effort if we continue to work on one or more input tables. I did create a project, you do not have to follow my example. It is not worth the effort for one-time job, but if you want to spend some time editing your tables, I suggest you to create a project.

First, we create a directory structure (yours can be different, but then you will have to modify makefile):

mkdir tables
cd tables
touch Makefile
mkdir bin
mkdir icons
mkdir src

My Makefile looks like this (I have three tables in the ./src right now):

It generally means that if I am in the tables directory and run make command, it will generate source files with correct icon path in ./bin directory (the .in extension gets cut off), and compile it afterwards. For example in case of Korean table the compile command looks like this: scim-make-table ./bin/korean.txt -b -o ./bin/korean.bin . The binary table will be written to ./bin directory. If I update one file, for example korean.txt.in, I do not need to compile and reinstall everything. In this case I use command make install-korean. This command will first compile the updated table, and install it afterwards.

The installation is equal to copying the binary table and icon to correct locations:

This is enough to compile and install the table ( make && make install ). Now is your part - modify the table data and do not forget to update MAX_KEY_LENGTH value after that.

Sometimes we start the table from scratch. In these cases it may help to generate the dummy table of characters to begin your work with. I do it with Perl - it saves me time. For example, I am going to start work on an latin prefix notation table to allow input of latin accented characters. The script I used to generate the raw table to begin my work with was: