9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] I updated ktrans
@ 2000-01-07  2:53 okamoto
  0 siblings, 0 replies; 2+ messages in thread
From: okamoto @ 2000-01-07  2:53 UTC (permalink / raw)


Hmmm...

UTF-8 is judged as quated-printable. :-)

Then I try again by adding a line of Content-Transfer-Encoding exprecitely.

I updated my patch to ktrans, and put it on our usual Web site
(http://basalt.cias.osakafu-u.ac.jp/plan9/p9index.html).
The following is that README.kenji file:

---from here---
  This is a modified version of ktrans of the original in Plan 9 distribution 
by Kenji Okamoto, Aug. 16, 1998.   I tried (actually learned) to keep the art 
level of the original codes.  However, it's too smart to me, and seems beyond 
my skill.  I'm afraid I made it seriously brain damaged.  If so, I applogize.
My only one excuse for this version is "it's works".

                                           revised by K Okamoto Jan. 7, 2000

Newly added features are as follows:

1) have a "local" dictionary file for translation from kana to kanji which can 
      easily editted by user.  The default file name is $home/lib/ktrans-jisho.
      If you want to use other dictionary file, set the KTJISHO environment 
      variable to point to that file.  This dictionary complize many lines of
      text strings.  

2) capital romaji input for a word such as verbs or adjectives with okurigana, 
      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 (runes)
      "動かす", which is a verb, you may input "ugoKasu" from the keyboard.  
      Note here the Kasu's k is a capital (important).  You will see a hiragana
      runes "うごかす", and then, the kanji runes of "動かす", when you hit 
      "Shift+Space". 
        If you are satisfied by that translation, continue to input next word.   
      If you are not pleasure with that candidate, hit 'Shift+Space' once more 
      to see more candiate for that hiragana inputs.  When no more other candidates
      are registered in your dictionary, you will see the initial hiragana 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)
      "私は", then, try to hit "watashiHA" from the keyboard.  Note that the sound
      of "wa(ha)" is express as capitalized "HA".  You will see a hiragana string
      of "わたしは", and then, "私は" after `Shift+Space'.

4) a control sequence of 'ctl-l' is introduced to leave input hiragana runes 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 of the
      list of candidates.  This is valid only during the session you called ktrans.
      This is done so intentionally, because present learning method is ..well... 
      naive. ^_^  I know this, however, I believe you can solve it by making a good 
      dictionary best fitted to your purpose by yourself.

6) 'ctl-q' ends the session when you want to edit your kana-kanji translation 
      dictionary by sam or acme.  I chosed this way only by the reason for simplicity.
      The dictionary is read only once at the beginning of the ktrans session.
      I believe you will be suffered nothing from this simplification, because you can
      end and then restart ktrans session anytime if you use acme.

7) mode change to kana-input is triggered by 'ctl-n' but not 'ctl-g' (original).
      This is by a simple reason why I feel it better for Japanese (nihongo)
      trigger key.  I re-arranged 'ctl-g' to greek mode.  If I'm doing something
      wrong, please tell me.  I know the feeling for Japanese, but not for
      greek.

8) as the starting $home/lib/ktrans-jisho, you may re-format the SKK-JISYO.S 
      (66.9KB) of SKK system, which can be reached from ftp.kuis.kyoto-u.ac.jp.  
      The next three lines shows the short sed filter to transform from SKK type 
      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 
      dictionary.  This implementation does not care the order, therefore, 
      you can change it by yourself.

9) SKK jisho, such as SKK-JISYO.S, is composed of two parts, okuri-ari and 
      okuri-nashi entries.  This is greatly depend on the Japanese grammer,
      and okuri-ari may represent verb/adjective etc., i.e., not noun.
        These two parts work differently in the original SKK system, however,
      I did not employed that method, rather, a simple approarch as described
      in (2) and (3).  Here, we have no difference between these two parts, 
      and the reason why I leaved the two part structure remained is just 
      to make easier to read for editting.  Of course, you can change it
      without any side-effects.
    
8) This implementation of Japanese input method is to convert every one word 
      by one key triggering essentially.  This may cause some cumbersome feeling 
      to Nihongo users who are accustomed to, say, Windows. I know this.  
      However, I intended to keep the codes compact as possible as a first step 
      to develope Nihongo input system on Plan 9.  Furthermore, I've never seen 
      the latters worked perfectly.  I think the conversion failed essentially 
      when we see more than, say, five/six candidates for one input hiragana
      runes.

9) The trabslation trigger key has been chnaged from ^t to Shift+Space, because
      we experienced butting of the trigger key sequence sometime.  For this 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+Space to '^\'.
      In my patch to translate.c, I use '^\' as the trigger key.  Therefore, you can
      trigger translation from kana to kanji by Shit+Space or just '^\'.

10) a usage example: if you want to make the Japanese text as below:

           私は毎日35分以上歩いて, 更に10分電車に乗って学校に通います.
           健康の維持にも役だっていますが, なかなかたのしいものです.

      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] <-- NO! :-)
      monodesu.[^l]

    where [^t], [^l] indicates 'Shift+Space' and 'ctl-l' respectively.

11) I editted maps.c to make it more flexible to youger generations Japanese usage, 
     say Manga generations.  Those are not formal of course, however, they feel missing
     something without them. ^_^

12) yes, tons of TODO lists of course. ^_^


		       				Kenji    January 7, 2000

---end---




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [9fans] I updated ktrans
@ 2000-01-07  2:33 okamoto
  0 siblings, 0 replies; 2+ messages in thread
From: okamoto @ 2000-01-07  2:33 UTC (permalink / raw)


I updated my patch to ktrans, and put it on our usual Web site
(http://basalt.cias.osakafu-u.ac.jp/plan9/p9index.html).
The following is that README.kenji file:

---from here----
  This is a modified version of ktrans of the original in Plan 9 distribution 
by Kenji Okamoto, Aug. 16, 1998.   I tried (actually learned) to keep the art 
level of the original codes.  However, it's too smart to me, and seems beyond 
my skill.  I'm afraid I made it seriously brain damaged.  If so, I applogize.
My only one excuse for this version is "it's works".

                                           revised by K Okamoto Jan. 7, 2000

Newly added features are as follows:

1) have a "local" dictionary file for translation from kana to kanji which can 
      easily editted by user.  The default file name is $home/lib/ktrans-jisho.
      If you want to use other dictionary file, set the KTJISHO environment 
      variable to point to that file.  This dictionary complize many lines of
      text strings.  

2) capital romaji input for a word such as verbs or adjectives with okurigana, 
      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 (runes)
      "動かす", which is a verb, you may input "ugoKasu" from the keyboard.  
      Note here the Kasu's k is a capital (important).  You will see a hiragana
      runes "うごかす", and then, the kanji runes of "動かす", when you hit 
      "Shift+Space". 
        If you are satisfied by that translation, continue to input next word.   
      If you are not pleasure with that candidate, hit 'Shift+Space' once more 
      to see more candiate for that hiragana inputs.  When no more other candidates
      are registered in your dictionary, you will see the initial hiragana 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)
      "私は", then, try to hit "watashiHA" from the keyboard.  Note that the sound
      of "wa(ha)" is express as capitalized "HA".  You will see a hiragana string
      of "わたしは", and then, "私は" after `Shift+Space'.

4) a control sequence of 'ctl-l' is introduced to leave input hiragana runes 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 of the
      list of candidates.  This is valid only during the session you called ktrans.
      This is done so intentionally, because present learning method is ..well... 
      naive. ^_^  I know this, however, I believe you can solve it by making a good 
      dictionary best fitted to your purpose by yourself.

6) 'ctl-q' ends the session when you want to edit your kana-kanji translation 
      dictionary by sam or acme.  I chosed this way only by the reason for simplicity.
      The dictionary is read only once at the beginning of the ktrans session.
      I believe you will be suffered nothing from this simplification, because you can
      end and then restart ktrans session anytime if you use acme.

7) mode change to kana-input is triggered by 'ctl-n' but not 'ctl-g' (original).
      This is by a simple reason why I feel it better for Japanese (nihongo)
      trigger key.  I re-arranged 'ctl-g' to greek mode.  If I'm doing something
      wrong, please tell me.  I know the feeling for Japanese, but not for
      greek.

8) as the starting $home/lib/ktrans-jisho, you may re-format the SKK-JISYO.S 
      (66.9KB) of SKK system, which can be reached from ftp.kuis.kyoto-u.ac.jp.  
      The next three lines shows the short sed filter to transform from SKK type 
      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 
      dictionary.  This implementation does not care the order, therefore, 
      you can change it by yourself.

9) SKK jisho, such as SKK-JISYO.S, is composed of two parts, okuri-ari and 
      okuri-nashi entries.  This is greatly depend on the Japanese grammer,
      and okuri-ari may represent verb/adjective etc., i.e., not noun.
        These two parts work differently in the original SKK system, however,
      I did not employed that method, rather, a simple approarch as described
      in (2) and (3).  Here, we have no difference between these two parts, 
      and the reason why I leaved the two part structure remained is just 
      to make easier to read for editting.  Of course, you can change it
      without any side-effects.
    
8) This implementation of Japanese input method is to convert every one word 
      by one key triggering essentially.  This may cause some cumbersome feeling 
      to Nihongo users who are accustomed to, say, Windows. I know this.  
      However, I intended to keep the codes compact as possible as a first step 
      to develope Nihongo input system on Plan 9.  Furthermore, I've never seen 
      the latters worked perfectly.  I think the conversion failed essentially 
      when we see more than, say, five/six candidates for one input hiragana
      runes.

9) The trabslation trigger key has been chnaged from ^t to Shift+Space, because
      we experienced butting of the trigger key sequence sometime.  For this 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+Space to '^\'.
      In my patch to translate.c, I use '^\' as the trigger key.  Therefore, you can
      trigger translation from kana to kanji by Shit+Space or just '^\'.

10) a usage example: if you want to make the Japanese text as below:

           私は毎日35分以上歩いて, 更に10分電車に乗って学校に通います.
           健康の維持にも役だっていますが, なかなかたのしいものです.

      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] <-- NO! :-)
      monodesu.[^l]

    where [^t], [^l] indicates 'Shift+Space' and 'ctl-l' respectively.

11) I editted maps.c to make it more flexible to youger generations Japanese usage, 
     say Manga generations.  Those are not formal of course, however, they feel missing
     something without them. ^_^

12) yes, tons of TODO lists of course. ^_^


		       				Kenji    January 7, 2000

---end ------




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-01-07  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-07  2:53 [9fans] I updated ktrans okamoto
  -- strict thread matches above, loose matches on Subject: below --
2000-01-07  2:33 okamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).