Language transliterator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
7.8 KiB

  1. Plan 9がRelase 3になってソースが公開されました。このため、更に多くのユーザがPlan 9を
  2. 使い始める事になると思います。このバージョンになって、Windowシステムが8½からrioに
  3. 変更になり、それにともなって、release 2に含まれていたktransが無くなりました。
  4. そこで、Rob Pikeさんにお願いしたら、pipefileというすばらしいアイデアを考えて戴け
  5. ました。これはrelease 2でDennis Ritchieさんが提供した/dev/kbdを置き替えるもので、
  6. このいきさつは、Pikeさんの9fansのlmailing-listへの投稿を同封してありますので、
  7. そちら(pipefile)を御覧下さい。この方法は何時でもどのウィンドへも日本語を入力出来る
  8. ので、以前のバージョンの様にウィンド毎にktransを起動する必要がなくなりました。
  9. pipefileはrioより前に起動される必要がありますので、ここに同封したKanjiという
  10. スクリプトを各自のlib/profileにrioを起動する替わりに、このKanjiスクリプトを
  11. 起動する様にして下さい。
  12. Main features are as follows:
  13. 1) There is a "local" dictionary file for translation from kana to kanji, which can
  14. easily be edited by the user. The default file name is $home/lib/ktrans-jisho.
  15. If you want to use another dictionary file, set the KTJISHO environment
  16. variable to point to that file. This dictionary comprises many lines of
  17. edittable text strings.
  18. 2) Capital romaji input is used for words such as verbs or adjectives with okurigana,
  19. which follows the idea of the SKK system by Masahiko Sato of Kyoto Univ.
  20. ( If you want to get the kanji string (runes)
  21. "動かす", which is a verb, you may input "ugoKasu" from the keyboard.
  22. Note here the Kasu's k is a capital (important). You will see hiragana
  23. runes "うごかす", and then the kanji runes of "動かす", when you type
  24. "Shift+Space".
  25. If you are satisfied by that translation, continue to input the next word.
  26. If you are not pleased with that candidate, hit 'Shift+Space' once more
  27. to see more candiates for that hiragana input. When there are no more candidates
  28. registered in your dictionary, you will see the initial hiragana input.
  29. 3) For Japanese "joshi", a post-positioned short word after a noun, you can use another
  30. method that I developed for this work. If you want the kanji string (runes) "私は",
  31. then type "watashiHA" from the keyboard. Note that the sound of "wa(ha)" is expressed
  32. as capitalized "HA". You will see a hiragana string of "わたしは", and then "私は"
  33. after `Shift+Space'.
  34. 4) A control sequence of 'ctl-l' is introduced to leave input hiragana runes unchanged.
  35. This is occasionally neccessary.
  36. 5) A simple leaning mechanism has been implemented for the in-memory hashing
  37. dictinary, in which the most recently used kanji runes (candidate) moves to the top
  38. of the list of candidates. This is valid only during the session you called ktrans.
  39. It is done this way intentionally, because the present learning method is ..well...
  40. naive. ^_^ I know this; however, I believe you can solve it by making a good
  41. dictionary best fitted to your purposes on your own.
  42. 6) 'ctl-x' re-reads the new kana-kanji translation dictionary when you have edited your
  43. kana-kanji translation, and want to incorporate it into your current in-memory translation
  44. dictionary. The kana-kanji translation dictionary is usually read only once, at the
  45. beginning of the ktrans session. I believe this simplification is not a serious constraint,
  46. because you can edit the dictionary anytime by co-working with acme and using this ctl-x
  47. mechanism.
  48. 7) A mode change to kana-input is triggered by 'ctl-n', ctl-k for katakana mode,
  49. ctl-g for Greek mode, and ctl-r for Russian mode.
  50. 8) As the starting $home/lib/ktrans-jisho, you may re-format the SKK-JISYO.S (66.9KB) of the
  51. SKK system, which can be retrieved from The next three lines
  52. show the short sed filter to transform from an SKK type dictionary to Plan 9. Before
  53. this, you should change the kanji code of the SKK dictionary from ujis(euc) to UTF-8 by
  54. the tcs utility, of course.
  55. s/\// /g
  56. s/ / /g
  57. s/ $//g
  58. The header items are sorted in a strange order in the original SKK dictionary.
  59. This implementation does not care about the order, therefore, you can change it on
  60. your own.
  61. 9) SKK jisho, such as SKK-JISYO.S, is composed of two parts, okuri-ari and okuri-nashi
  62. entries. This greatly depends on the Japanese grammer, and okuri-ari may represent
  63. verb/adjective etc., i.e., not noun. These two parts work differently in the original
  64. SKK system, however, I did not employ that method; rather, I took a simple approarch
  65. as described in (2) and (3). Here, we make no difference between these two parts,
  66. and the reason why I left the two-part structure is just to make it easier to read for
  67. editting. Of course, you can change it without any side-effects.
  68. 10) The essence of this Japanese input method is to convert every one word by one key
  69. triggering. This may cause some cumbersome feelings for Nihongo users who are accustomed
  70. to, say, Windows. I know this. However, I intended to keep the codes as compact as
  71. possible as a first step towards developing a Nihongo input system on Plan 9.
  72. Furthermore, I've never seen the latter work perfectly. I think the conversion failed
  73. essentially when we see more than, say, five/six candidates for one set of hiragana runes.
  74. Finaly, I'd like to add that I have no problem to write long Japanese documents by
  75. this version.
  76. 11) The translation trigger key has been changed from ^t to Shift+Space, because
  77. we experienced butting of the trigger key sequence sometime. For this reason,
  78. you have to edit the key-binding table, such as kbtabshift[0x39] in /sys/src/9/pc/kbd.c
  79. or keymapshift[0x79] in /sys/src/9/ss/screen.c to assign Shift+Space to '^\'.
  80. I use here '^\' as the trigger key. Therefore, you can trigger translation
  81. from kana to kanji by Shit+Space or just '^\'.
  82. 12) A usage example: If you want to make the Japanese text as below:
  83. 私は毎日35分以上歩いて、 更に10分電車に乗って学校に通います。
  84. 健康の維持にも役だっていますが、 なかなかたのしいものです。
  85. your keyboard typing stream should be:
  86. watashiHA[^t]mainichi[^t]35[^l]fun[^t]ijou[^t]aruIte, [^t]saraNI[^t]
  87. 10[^l]fun[^t]denshaNI[^t]noTte[^t]gakkouNI[^t]kayoImasu.[^t]
  88. kenkouNO[^t]ijiNImo[^t]yakuDAtteimasuga, [^t]nakanaka[^l]tanoshiI[^t]
  89. monodesu.[^l]
  90. where [^t], [^l] indicates 'Shift+Space' and 'ctl-l', respectively.
  91. Kenji Okamoto August 14, 2000
  92. これはRelease 2のPlan 9に含まれていたDennis Ritchieさんのktransを機能強化したもので、
  93. 大阪府立大学の岡本健二が作成いたしました。 疑問、提案等がございましたら、
  95. なお, Plan 9そのものにつきましては、
  96. に95年度より
  97. ささやかなWeb Pageをもっていますので、そちらも参照くださいませ。
  98. なおこのプログラムはPlan 9のderived workとしてのライセンスを持った配布となります。
  99. Plan 9のLicense fileを同封してありますので、ここに書かれている事を守ってお使い
  100. 下さいませ。
  101. 大阪府立大学総合科学部 岡本健二 August 14, 2000