2008/08/23

Ecrire en japonais sous OpenSuse11.0

(see English translation in this blog)

Cette page explique comment configurer le système Linux (OpenSuse 11.0) pour pouvoir entrer du texte en japonais dans une application du type traitement de texte ou explorateur internet.

La première chose à comprendre, c'est quil ne s'agit pas d'un problème de disposition de clavier. Le choix de la disposition clavier est affaire de préférence personnelle et sera discuté plus tard.

La chose que vous devez réellement faire, c'est installer un composant logiciel qui interprètera votre frappe (disons par exemple en caractères latins) et la traduira en caractères japonais (hiragana, katakana or Kanji). Ce type de logiciel s'appelle un Editeur de méthode de saisie ou IME pour Input Method Editor (appellation essentiellement utilisée dans l'univers MS Windows). Il en existe un certain nombre, mais le seul vraiment opérationnel que je connaisse dans l'univers Linux est SCIM. SCIM signifie Smart Common Input Method ou Smart Chinese Input Method selon les sources.

En premier lieu, j'expliquerai ce qu'un IME fait quand il est activé.


Que fait l'IME

Considérons les mots (expressions) suivants :voisinage and serviette de plat.

Ils se traduisent tous deux en japonais par ふきん
Ecrits en japonais ils se présentent respectivement sous la forme 付近 et 布巾
Ces deux mots sont obtenus en tapant fukin mais comment obtenir celui qu'on désire.
C'est à cet instant qu'intervient l' IME (pour notre cas SCIM).

SCIM en action

Quand vous tapez f vous voyez f. En continuant et tapant u vous voyez 。 A partir de cet instant vous pouvez décider que votre mot est complet mais ce que vous pourriez obtenir à ce stade ce sont uniquement les mots japonais épelés fu. Ce n'est pas ce que vous souhaitez aussi continuez-vous en tapant ふk puis ふき puis ふきn. A cet instant, qui est l'instant crucial, deux possibilités s'offrent à vous:
  1. decider que le mot doit être écrit en hiragana. Alors vous tapez entrée.
  2. decider que le mot doit être écrit sous une autre forme . Alors vous tapez espace.
Dans le second cas, la frappe de la touche espace déclenche la transformation du mot en écriture Kanji. Le choix entre 布巾 or 付近 depend alors du contexte et de la performance de l'IME. Aujourd'hui, le meilleur IME, selon mon épouse japonaise est, ATOK . ATOK est utilisé par MS Windows . Il y a des possibilités pour Linux mais elles ne sont ni opensource ni gratuites.

Après que le mot a été transformé en Kanji, vous avez toujours deux possibilités:
  1. decider que le mot présenté sous cette forme vous convient. Alors vous tapez entrée.
  2. decider que le mot doit être écrit sous une autre forme . Alors vous tapez espace.
Dans le second cas encore, l'IME vous propose une autre forme d'écriture kanji (un mot différent) et le processus se poursuit tant que vous tapez espace. La seule nouveauté est que vous voyez apparaître un menu dynamique (pop up menu) qui vous présente toutes les possibilités. Chaque fois que vous pressez espace, votre choix évolue. Dès que vous avez obtenu le mot que vous désirez, sous la forme que vous désirez, vous devez taper entrée.

Comment installer SCIM et comment l'activer

D'abord vous devez savoir que pour entrer du texte en japonais, en plus de SCIM, vous avez besoin des polices de caractères japonaises. Dans OpenSUSE 11.0 et dans les versions précédentes, tout ceci est fourni par le paquet linguistique japonais.

Etape 1: Installer the le paquet linguistique japonais avec YAST.































Etape 2 : redémarrer la machine


Etape 3: activer SCIM

Après avoir redémarré la machine, regardez la barre des tâches, en installation de base, en bas à droite de l'écran.

Vous voyez une petite icone représentant un clavier.

Lancez une application comme OpenOffice writer.

Cliquez du bouton gauche sur l'icone clavier, et dans le menu déroulant, sélectionnez Japonais . Tout en gardant le bouton gauche enfoncé, dans le nenu qui se déroule en cascade, selectionnez Anthy (le choix avec un icone représentant une couronne). Après sélection, une nouvelle barre (la barre de SCIM) apparaît au dessus de la barre des tâches ( photo ci-dessous).








Cette barre comprend l'étiquette SCIM, l'icone en forme de couronne de Anthy, un hiragana , un kanji , un livre、 une icone en forme de page de texte et un point d'interrogation. Si au lieu d'un hiragana vous avez autre chose (katakana ou autre), cliquez dessus et selectionnez hiragana (c'est le choix de base pour taper du japonais).

Tapez votre texte comme présenté plus haut.  Souvenez-vous, chaque fois que vous tapez entrée vous validez un nouveau mot. Si vous avez fait une erreur, tapez immédiatement Retour arrière (backtab) et la possibilité de choisir avec la touche espace reviendra.

Parfois le mot est présenté en plusieurs tronçons (ex: un en kanji et l'autre en hiragana). Faites votre choix dans le premier troncon avec espace puis déplacez vous sur le deuxième avec la flèche à droite et faites votre choix pour ce dernier toujours avec la touche espace.

Comment revenir à la saisie normale

Pour revenir au mode de saisie habituel, cliquez sur l'icone de la couronne de Anthy dans la barre des tâches et choisissez Clavier Français ou Clavier Direct selon le nombre de dispositions clavier que vous avez validées dans KDE ou GNome).


Une méthode de basculemnt plus rapide entre les modes de saisie.

Pressez Ctl-space pour commuter entre la méthode de saisie "Clavier direct" et la méthode SCIM. Ceci est particulièrement efficace quand vous voulez écrire un texte mixant votre langue et le japonais.


Maintenant, amusez-vous bien。

2008/08/22

Writing Japanese with OpenSuse11.0

(voir traduction en français dans ce blog)

This page aims at explaining how to set the linux system in order to allow Japanese writing in application like web browser or word processors.

The first thing you must accept is that the problem is not a matter of keyboard layout. The choice of a keyboard layout is just a matter of personal preference and will be discussed later on.

What you really have to do, is to install a bit of software which will interpret your typing (let us say in Latin Characters) and transform it into Japanese characters (hiragana, katakana or Kanji). This kind of software is called an Input Method Editor IME (mainly in the MS Windows universe). There are a lot of them but the only efficient one I know for Linux is SCIM. SCIM stands for Smart Common Input Method or Smart Chinese Input Method.

First of all I will try to explain what this IME does when activated.

What an IME does

Let's consider the following words (expressions) :neighborhood and dish towel.

They both are translated into japanese by ふきん
Writen in kanji they will be、respectively, 付近 and 布巾
These two words are both obtained typing fukin but how to get the one you want.
It is the point where the IME (here SCIM) comes into action.

SCIM in action

When you type f you see f. If you go on typing u you see 。 At this point、 you have the possibility to decide that your word is completed but what you could get at this stage are only the Japanese words spelled fu. It is not your choice presently so you go on typing ふk then ふき then ふきn. At this time, and it is the most important time, you have two possibilities:
  1. decide that you want the word written in hiragana. If so type enter.
  2. decide you want to enter the word in an other form. if so type space.
In the second case, typing space will trigger the transformation of the word into Kanji. The choice between 布巾 or 付近 depends on the context and on the performance of the IME. At the moment the best IME, according to my Japanese wife, is ATOK . ATOK is used mainly with the MS Windows OS. There are Linux possibilities but they are not free (I mean neither open nor gratis).

After the word has been transformed into kanji you still have two possibilities:
  1. decide that you want the word written as it is presented. If so type enter.
  2. decide you want to enter the word into an other form. if so type space.
In the second case again the IME proposes you an other kanji form (a different word) and the process goes on as long as you type space. The only difference is that a dialog box pops up showing you all the possible candidates. Each time you press space your choice changes. As soon as you have get the word you want, in the form you want, press enter.

How to install SCIM and how to get it working

First you must be aware that in order to be able to write Japanese, in addition to SCIM, you need Japanese fonts. All this, in OpenSUSE 11.0 and other previous version, is provided by the Japanese Language Package.

Step 1: Install the Japanese Language Package from YAST.































Step 2 : restart the computer


Step 3: get SCIM working

After having restarted the computer look at the task panel, in standard installation at the low right corner of the screen.

You can see a small keyboardlike icon.

Open an application like OpenOffice writer.

Left click on the keyboardlike icon, and in the pop up menu select Japanese. Keeping the left button pressed select Anthy (the one with a crown icon). After selection a new bar (the SCIM bar) will appear over the task panel ( see picture).








This bar consists of The label SCIM, the Crownlike icon, an hiragana icon, a kanji icon, a booklike icon、 a textlike icon and a question mark. If instead of the hiragana icon you have an other thing, click on it and select hiragana (this the basic choice for Japanese writing).

Type your text has explained above.  Remember each time you press enter you finish and enter a new word. If you have made a mistake in the choice press the backtab and the possibility to toggle the choices with space will appear again.

Sometime the word is presented in several section (e.g. one in kanji and one in hiragana). make your choice for the first section with space then press the right arrow key to make your choice for the second section.

How to return to the previous input method

To come back to the habitual way of typing. Click on the Crown of Anthy in the task bar and chose English/keyboard or Direct keyboard depending on how many keyboard layout you have enabled in the window manager (one or several).


A faster way of toggling the typing method.

Press Ctl-space to toggle between the typing method "Direct keyboard" or the SCIM method. This is very efficient each time you want to write a text mixing your own language and the Japanese language.


Have a lot of fun。