From mboxrd@z Thu Jan 1 00:00:00 1970 From: okamoto@granite.cias.osakafu-u.ac.jp Message-Id: <200008160247.WAA05212@cse.psu.edu> Subject: [9fans] ktrans for Release 3 Plan 9 Date: Wed, 16 Aug 2000 11:49:09 +0900 To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: fb4e754c-eac8-11e9-9e20-41e7f4b1d025 I put "ktrans for Release 3 Plan 9" on our web site=20 (http://basalt.cias.osakafu-u.ac.jp/plan9/p9index.html). =20 Ktrans was included in the Release 2 Plan 9, which enables us to=20 input Japanese and Greek and Russian using English key board. =20 This is a "derived work" Licensed distribution of Plan 9. Above page=20 is written in UTF-8, and you can search the part read as English, and=20 take it, even if you'd find many of strange language there. =E2=98=BA Below is my README file for convenience to others. This version of ktrans works with pipefile by Rob Pike, which replaces /d= ev/kbd of the Release 2 Plan 9 by Dennis Ritchie. By this new idea, we can input J= apanese anytime onto any windows. I included his post to 9fans mailing-list here= (pipefile file). This is a distribution as a derived work license of Plan 9, and I include= d the Plan 9 License term here. Please refer to it on the details of this lice= nse. Main features are as follows: 1) have a "local" dictionary file for translation from kana to kanji whic= h can=20 easily editted by user. The default file name is $home/lib/ktrans-= jisho. If you want to use other dictionary file, set the KTJISHO environme= nt=20 variable to point to that file. This dictionary complize many line= s of text strings. =20 2) capital romaji input for a word such as verbs or adjectives with okuri= gana,=20 which follows the idea of SKK system by Masahiko Sato of Kyoto Univ. (masahiko@kuis.kyoto-u.ac.jp). If you want to get kanji string (ru= nes) "=E5=8B=95=E3=81=8B=E3=81=99", which is a verb, you may input "ugoK= asu" from the keyboard. =20 Note here the Kasu's k is a capital (important). You will see a hi= ragana runes "=E3=81=86=E3=81=94=E3=81=8B=E3=81=99", and then, the kanji r= unes of "=E5=8B=95=E3=81=8B=E3=81=99", when you hit=20 "Shift+Space".=20 If you are satisfied by that translation, continue to input next = word. =20 If you are not pleasure with that candidate, hit 'Shift+Space' once= more=20 to see more candiate for that hiragana inputs. When no more other = candidates are registered in your dictionary, you will see the initial hiragan= a input. 3) for Japanese "joshi", a postpositioned short word after noun, you can = use another method which I developed for this work. If you want kanji string (= runes) "=E7=A7=81=E3=81=AF", then, try to hit "watashiHA" from the keyboar= d. Note that the sound of "wa(ha)" is express as capitalized "HA". You will see a hiragan= a string of "=E3=82=8F=E3=81=9F=E3=81=97=E3=81=AF", and then, "=E7=A7=81=E3=81= =AF" after `Shift+Space'. 4) a control sequence of 'ctl-l' is introduced to leave input hiragana ru= nes unchanged. This is occasionally neccessary. 5) simple leaning mechanism has been implemented on the on-memory hashing= dictinary where most recently used kanji runes (candidate) moves to the top o= f the list of candidates. This is valid only during the session you call= ed ktrans. This is done so intentionally, because present learning method is .= .well...=20 naive. ^_^ I know this, however, I believe you can solve it by mak= ing a good=20 dictionary best fitted to your purpose by yourself. 6) 'ctl-x' re-reads the new kana-kanji translation dictionary when you e= dited your kana-kanji translation to update by acme, and want to reflect it in= to your current on memory translation dictionary. The kana-kanji translation dictionary is, usually, read only once a= t the=20 beginning of the ktrans session. I believe you will be suffered not= hing=20 from this simplification, because you can edit the dictionary anyti= me by co-working with acme, and use this ctl-x. 7) mode change to kana-input is triggered by 'ctl-n', ctl-k for katakana = mode,=20 ctl-g for Greek mode, and ctl-r for Russian mode. 8) as the starting $home/lib/ktrans-jisho, you may re-format the SKK-JISY= O.S=20 (66.9KB) of SKK system, which can be reached from ftp.kuis.kyoto-u.= ac.jp. =20 The next three lines shows the short sed filter to transform from S= KK type=20 dictionary to Plan 9. Before this, you should change kanji code of= the SKK dictionary from ujis(euc) to UTF-8 by tcs utility, of course. s/\// /g s/ / /g s/ $//g The header items are sorted in a strange order in the original SKK=20 dictionary. This implementation does not care the order, therefore= ,=20 you can change it by yourself. 9) SKK jisho, such as SKK-JISYO.S, is composed of two parts, okuri-ari an= d=20 okuri-nashi entries. This is greatly depend on the Japanese gramme= r, and okuri-ari may represent verb/adjective etc., i.e., not noun. These two parts work differently in the original SKK system, howe= ver, I did not employed that method, rather, a simple approarch as descr= ibed in (2) and (3). Here, we have no difference between these two part= s,=20 and the reason why I leaved the two part structure remained is just= =20 to make easier to read for editting. Of course, you can change it without any side-effects. =20 10) This implementation of Japanese input method is to convert every one = word=20 by one key triggering essentially. This may cause some cumbersome = feeling=20 to Nihongo users who are accustomed to, say, Windows. I know this. = =20 However, I intended to keep the codes compact as possible as a firs= t step=20 to develope Nihongo input system on Plan 9. Furthermore, I've neve= r seen=20 the latters worked perfectly. I think the conversion failed essent= ially=20 when we see more than, say, five/six candidates for one input hirag= ana runes. 11) The trabslation trigger key has been chnaged from ^t to Shift+Space, = because we experienced butting of the trigger key sequence sometime. For t= his reason, you have to edit key binding table such as kbtabshift[0x39] in /sys= /src/9/pc/kbd.c or keymapshift[0x79] in /sys/src/9/ss/screen.c to assign Shift+Spac= e to '^\'. In my patch to translate.c, I use '^\' as the trigger key. Therefo= re, you can trigger translation from kana to kanji by Shit+Space or just '^\'. 12) a usage example: if you want to make the Japanese text as below: =E7=A7=81=E3=81=AF=E6=AF=8E=E6=97=A535=E5=88=86=E4=BB=A5=E4=B8= =8A=E6=AD=A9=E3=81=84=E3=81=A6=E3=80=81 =E6=9B=B4=E3=81=AB10=E5=88=86=E9=9B= =BB=E8=BB=8A=E3=81=AB=E4=B9=97=E3=81=A3=E3=81=A6=E5=AD=A6=E6=A0=A1=E3=81=AB= =E9=80=9A=E3=81=84=E3=81=BE=E3=81=99=E3=80=82 =E5=81=A5=E5=BA=B7=E3=81=AE=E7=B6=AD=E6=8C=81=E3=81=AB=E3=82=82= =E5=BD=B9=E3=81=A0=E3=81=A3=E3=81=A6=E3=81=84=E3=81=BE=E3=81=99=E3=81=8C=E3= =80=81 =E3=81=AA=E3=81=8B=E3=81=AA=E3=81=8B=E3=81=9F=E3=81=AE=E3=81=97=E3= =81=84=E3=82=82=E3=81=AE=E3=81=A7=E3=81=99=E3=80=82 your keyboard hitting stream should be: watashiHA[^t]mainichi[^t]35[^l]fun[^t]ijou[^t]aruIte, [^t]saraNI[^t= ] 10[^l]fun[^t]denshaNI[^t]noTte[^t]gakkouNI[^t]kayoImasu.[^t] kenkouNO[^t]ijiNImo[^t]yakuDAtteimasuga, [^t]nakanaka[^l]tanoshiI[^= t] monodesu.[^l] where [^t], [^l] indicates 'Shift+Space' and 'ctl-l' respectively. Kenji Okamoto August 14, 2000