Input methods

From OLPC
Revision as of 01:17, 3 June 2007 by Mokurai (talk | contribs) (Installation: Correct and clarify how to use.)
Jump to: navigation, search
  english | 한국어 HowTo [ID# 40904]  +/-  


In order to input text in any particular language and writing system, we need a Unicode font to display it in, a rendering engine that knows how to display it, and a keyboard layout or Input Method Editor (IME) that provides a way to get all of the needed characters. Most alphabetic and syllabic languages can be typed on fairly simple keyboards that produce one Unicode character per key combination, using the ordinary typing keys together with Meta (usually Alt) and Compose keys. Any of several keys, including Menu and Windows keys, can be set to act as Compose. Then on Latin keyboards Compose-a-' produces á, Compose-c-, produces ç, and so on. Any accented letter that is included in Unicode in precomposed form falls within this capability. This covers letters that occur in any widely-used pre-Unicode character set, such as Latin-1 (ISO-8859-1), which supports French, German, Spanish, Italian, Scandinavian languages, and some other languages that use only the accented letters in Latin-1.

Multiple diacritics can be entered sequentially on simple keyboards of this type, while more elaborate input methods can enter more than one Unicode character code into the input buffer for each key combination. Yoruba is an example of a language that poses this choice, because it has vowel letters with an acute accent above and a dot below that are not available precomposed in Unicode.

The most elaborate IMEs are for input of CJKV characters for Chinese, Japanese, Korean, and the historical Vietnamese Chu Nomh writing. Each of these languages requires several thousand characters at a minimum, and there is a desire to have much more extensive CJKV sets available, including a number of Hong Kong characters and other recent additions, or the tens of thousands of historical characters important for scholarship.

Several hundred methods for entering CJKV characters have been invented over several decades. Among the most important (due to efficiency of use or ease of learning, or in a few cases both) are language-specific phonetic conversion systems for Chinese, Japanese, or Korean, and shape-based systems that are in principle independent of language, but in practice specific to particular countries up to now.

See also countries, languages, writing systems, fonts, locales, and keyboard layouts.

Tools

Tools for keyboard layouts, to come. loadkeys utility to load keyboard layouts.

Tools for IMEs, to come.

Input Methods

Phonetic conversion

The concept of phonetic conversion is that any CJKV language typed in any alphabet or other sound-based writing system can be converted using a combination of dictionary lookup together with grammatical and semantic analysis. The first successful phonetic conversion word processor was the Xerox 8010 J-Star, an outgrowth of the Xerox Alto computer and Smalltalk programming language in 1981. Thanks go to Alan Kay for the Alto and Smalltalk ideas, and to Joseph Becker for the language handling software. Phonetic conversion to CJKV characters exists for the following combinations, in many variations.

  • Romazi (Latin alphabet) or Zhuyin to either Traditional or Simplified Chinese hanzi 漢字
  • Romaja 로마자 (Latin alphabet) or Hangeul 한글 Korean alphabet to hanja 漢字
  • Romaji ローマ字 (Latin alphabet) or hiragana ひらがな syllabary to Japanese kanji 漢字

Phonetic conversion systems depend on a native alphabetic or syllabic representation, or on one or more Romanizations of the target language.

  • Chinese: Pinyin 拼音, Gwoyeu Romatzyh 國語羅馬字, Wade-Giles, and Yale are a few of hundreds
  • Japanese: Hepburn, Kunrei-shiki, Nippon-shiki, Yale
  • Korean: McCune-Reischauer (MR), Revised Romanization of Korean (RR), Yale

(Yes, the Yale Department of Linguistics was busy on the issue for decades.)

Dasher - gesture text entry

Dasher is an information-efficient text-entry interface, driven by natural continuous pointing gestures. It is a competitive text-entry system wherever a full-size keyboard cannot be used - for example, when operating a computer one-handed, by joystick, touchscreen, trackball, or mouse—particularly interesting when the OLPC is in e-book mode. It can be used for many languages (>60), and is extensible through XML files. You can try it in your browser (w/Java).

Shape-based

It has been evident to everyone who has studied Chinese characters, including ancient Chinese scholars, that one can analyze most Chinese characters into a variety of smaller parts, many of which are characters themselves, and further, into a number of specific brush strokes (or the corresponding elements for characters cast in bronze, carved into seals, scratched into oracle bones, and so on). Many attempts were made over thousands of years to analyze the character shapes for various reasons, among them dictionary making. The best known is the system of 214 radicals set forth in the 1615 CE Zihui (字彙 "Character Glossary"), edited by Mei Yingzuo (梅膺祚) during the Ming Dynasty, and made a de facto standard by the 1716 CE Kangxi Zidian (康熙字典 "Kangxi Dictionary"), compiled under the Kangxi Emperor of the Qing Dynasty.

In the computer age, numerous analyses of character shapes were made as the basis for methods for typing Chinese, including those described below, which remain in widespread use, and others. As with the radicals, shapes are generally somewhat variable. In shape-based IMEs, several shapes may be grouped together and assigned a single key. Different shape-based IMEs are usually used for Traditional and Simplified characters.

Methods by language

Traditional Chinese

Zhuyin conversion

Zhuyin 注音, or Bopomofo ㄅㄆㄇㄈ, is a Chinese alphabet used for teaching children as well as for typing Chinese input. It has multiple keyboard layouts. Zhuyin is one of the standard conversion methods for Chinese, appearing on almost all computers and some cell phones.

[Wikipedia: Zhuyin]

[Unicode: Bopomofo] code table (PDF)

Phonetic conversion method

Pinyin conversion

Phonetic conversion method, using the standard Romanization of Chinese, converted to Simplified Chinese characters.

Example: zhongguo results in 中国

Cangjie

` 1 2 3 4 5 6 7 8 9 0 [ ]
   手 田 水 口 廿 卜 山 戈 人 心 [ ] 、
    日 尸 木 火 土 竹 十 大 中 ; ‘
     z  難 金 女 月 弓 一 , 。 /

Shape-based. The Cangjie keyboard layout has 24 simple Chinese characters on it, plus a key for "difficult" 難 characters. All of the common brush strokes and many common combinations are mapped to the 24 base characters. Characters are analyzed into these combinations, and then 1 to 5 of them are selected for typing, according to a moderately complex set of rules.

Example: 日月 results in 明.

Four Corners

Shape-based. The corners of a character are encoded, and a code for the whole character created from them.

etc.

Simplified Chinese

Pinyin

Wubi

etc.

Japanese

Romaji (ASCII) conversion

Kana conversion

etc.

Korean

Romaja (ASCII) conversion

Hangeul conversion

etc.

Descriptions of IME engines

SCIM Smart Common Input Method platform

The SCIM platform supports the following IMEs on Linux and other forms of Unix. Although IMEs are not essential for entering text in most alphabets, they add capabilities that cannot be provided on simple one-character-per-key layouts. Among other benefits, this makes it possible to enter accented letters that have no Unicode code points, where it is necessary to provide a sequence of Unicode code points to an application in order to represent a single letter. Accented letters are encoded in Unicode only if they were in some previous standard.

English/European

Adds combining characters to any ASCII keyboard layout, including Dvorak. IMEs are provided for English, Croatian, Slovak, Sampa, and Swedish.

Arabic

Includes Arabic, M17N-ar-kbd, UIM-m17n-ar-kbd keyboard layouts for Egyptian Arabic.

Ethiopic/Amharic

Amharic and other languages of Ethiopia are written in a syllabary with too many symbols to fit on a simple keyboard. However, it can be typed in an IME. One types a base syllable, then a vowel, to get the syllable with the consonant from the base syllable plus the specified vowel.

This is the basic keyboard layout.

` 1 2 3 4 5 6 7 8 9 0 [ ]
   ቅ ው እ ር ት ይ ኡ ኢ ኦ ፕ [ ] \
    አ ስ ድ ፍ ግ ህ ጅ ክ ል ፤   
     ዝ ሽ ች ቭ ብ ን ም ፣ . /

The syllable and vowel letters combine as in the following example.

For   Type
ታ     ት አ
ቶ     ት ኦ
ተ     ት እ
ቱ     ት ኡ
ቲ     ት ኢ

Cyrillic

This is called a phonetic layout, where the letter on most keys is the closest Cyrillic letter in sound to the Latin letter on the same key in QWERTY. But it is not simply a keyboard layout. Letters not on the keyboard can be typed as combinations. For example, the sequence 'ыо' results in 'ё', and similarly 'ыу' results in 'ю'.

` 1 2 3 4 5 6 7 8 9 0 [ ]
   я в е р т ы у и о п [ ] \
    а с д ф г х й к л ; 
     з х ц в б н м , . 

SCIM includes six other Cyrillic layouts for Russian, and others for Serbian.

Alphabets and Languages of India

Inscript and other keyboard layouts for nine writing systems of India, used for hundreds of languages.

Nepali

Written in Devanagari. Traditional and Romanized input is supported.

Greek

Two IMEs provided.

Iranian

aka Persian or Farsi. Two IMEs provided.

Tibetan

Two IMEs provided.

Hebrew

Two IMEs provided.

Cambodian

Two IMEs provided.

Laotian

Four IMEs provided.

Thai

Four IMEs provided.

Inuktitut

Again, a base keyboard layout with combining rules.

` 1 2 3 4 5 6 7 8 9 0 - =
   ᖅ  w e ᕐ ᑦ ᔾ ᐅ ᐃ ᐅ ᑉ [ ] \
    ᐊ ᔅ d ᕝ ᒡ ᔅ ᔾ ᒃ ᓪ ; 
     z x ᒡ ᕝ b ᓐ ᒻ , . /

Example: ᔾ ᐅ results in ᔪ.

IPA

Keyboard layout with combining rules.

` 1 2 ʒ 4 5 6 7 8 9 0 - =
   q w e r t y u i o p [ ] \
    a s d f g h j k l ; '
     z x c v b n m , . /

Note that the character 'ʒ' on the 3 key is not a 3, but U+0292 LATIN SMALL LETTER EZH.

Example: 'sh' results in 'ʃ'.

Vietnamese

` 1 2 3 4 5 6 7 8 9 0 - =
   q w e r t y u i o p [ ] 
    a s d f g h j k l ; 
     z x c v b n m , . /

Example: 'dd' results in 'đ'

Japanese

  • Hiragana (romaji-hiragana conversion)

Typing a consonant key produces the syllable with that consonant plus a. Typing a consonant followed by a different vowel in most cases produces the syllable with the consant-vowel combination indicated. Some syllables are spelled in other ways, in an attempt to simplify things for the English-speaking user.

` 1 2 3 4 5 6 7 8 9 0 [ ]
    q わ え ら た や う い お ぱ [ ] 、
     あ さ だ ふ が は じ か l  ;  ' 
      ざ x  ち v  ば ん ん ,  。  /

Examples: kkikukeko produces かきくけこ; tctsteto produces たちつてと

  • Katakana (romaji-katakana conversion)
` 1 2 3 4 5 6 7 8 9 0 ー=
   q ワ エ ラ タ ヤ ウ イ オ パ [ ] 、
    ア サ ダ フ ガ ハ ジ カ l  ;  '
     ザ x チ v バ ン ン , 。 /

Example: kkikukeko produces カキクケコ; tctsteto produces タチツテト

  • Nippon (romaji-kanji conversion)

Type a syllable in romaji. A menu appears, offering characters to be chosen by number. It is essential to know the readings expected by the software, such as naka1kawa1 to get the name read Nakagawa 中川. This IME does not recognizes the modifications to readings that occur when characters are combined.

Example: ni1hon1 produces 日本.

Korean

  • 2bul
  • 3bul (five variants)
  • Hangul
  • Hangul Romaja
  • Hanja
  • M17N (two variants)
  • UIM (six variants)

and many others

Simplified Chinese

  • Cangjie (two variants)
  • Erbi
  • Erbi-QS
  • Pinyin (many variants)
  • Quick (two variants)
  • Wubi
  • Ziranma

Traditional Chinese

  • Wu
  • Array30
  • CNS11643
  • Cangjie
  • Cangjie 3
  • Cangjie 5
  • Canton HK
  • Cantonese Pinyin
  • Chewing
  • Dayi3
  • EasyBig
  • Jyutping
  • Quick
  • Simplex
  • Stroke 5
  • ZhuYin
  • ZhuYin Big

Installation and Activation

On Debian Linux, use apt-get, aptitude, or Synaptic to install the scim package along with im-switch (required for Chinese, Japanese, and Korean) and scim-gtk2-immodule. You can also install skim, the KDE graphical frontend, which puts an icon on the toolbar. On systems using Red Hat packages, install the corresponding software. Follow the configuration instructions to set the necessary environment variables. Then run

scim -d

from the command line.

In X, open a supported application such as OpenOffice Write or Firefox/Iceweasel. Click the keyboard icon in the system tray to get the main IME menu. This is separate from the KDE Keyboard Tool flag menu for selecting X keyboard layouts, and from other such tools used in other desktop environments.

xcin

Used with bitmap fonts and the rxvt Chinese terminal program.

IIIMF

Internet/Intranet Input Method Framework of OpenI18n.org is a new Unicode-based input method framework.

Chinput

Chinese XIM Input Server

Help

Tests of IMEs, need help from expert users.

External links