ref: ffb48be969338833a69e576e7d62353bbd831226
dir: /sys/man/1/ktrans/
.TH KTRANS 1 .SH NAME ktrans \- language transliterator .SH SYNOPSIS .B ktrans [ .B -l .I lang ] [ .I kbdtap ] .SH DESCRIPTION .I Ktrans transliterates a stream of keyboard events. Without any arguments, .I ktrans reads events from standard input and writes out converted events to stdout. If a .I kbdtap file is given, it is used for both input and output instead. .SH CONVERSION Conversion is done in two layers, an implicit layer for unambigious mappings, and an explicit layer for selecting one match out of a list of ambigious matches. .PP The implicit layer happens automatically as characters are input, transforming a consecutive set of key strokes in to their rune counterpart. A series of these runes can then be explicitely converted using ctrl-\\. Consecutive inputs of ctrl-\\ can then be used to cycle through all the matches. A newline may also be used to perform an explicit conversion, but will not cycle through other possible matches. .PP Input is always passed along, when a match is found .I Ktrans will emit backspaces to clear the input sequence and replace it with the matched sequence. .SH CONTROL The language is selected by typing a control character: .TP .B ctl-t Passthrough mode .TP .B ctl-n Japanese mode. Implicit layer converts hepburn sequences to hiragana. Explicit layer converts sequences of hiragana with optional trailing particle or okurigana. .TP .B ctl-k Implicit only Japanese Katakana layer. .TP .B ctrl-c Chinese Wubi mode. No implicit conversion is done. Explicit layer converts sequences of latin characters to hanzi. .TP .B ctl-l Clear the explicit layer's current input sequence. .TP .B ctl-r Russian mode. Implicit layer converts latin to Cyrillic; the transliteration is mostly phonetic, with .B ' for .IR myagkij-znak (ь), .B '' for .I tverdyj-znak (ъ) .I yo for ё, .B j for .IR i-kratkaya (й). .TP .B ctl-o Greek mode. .TP .B ctl-s Korean mode. Implicit layer converts latin to Korean Hangul. .TP .B ctrl-v Vietnamese Telex input. .SH SOURCE .B /sys/src/cmd/ktrans .SH SEE ALSO .IR rio (4) .IR kbdfs (8) .br .IR /sys/src/cmd/ktrans/README.kenji .br .IR /sys/src/cmd/ktrans/READMEJ.kenji .SH EXAMPLES To type the following Japanese text: .ft Jp 私は毎日35分以上歩いて、 更に10分電車に乗って学校に通います。 健康の維持にも役だっていますが、 なかなかたのしいものです。 .ft your keyboard typing stream should be: watashiHA[^\\]mainichi[^\\]35[^l]fun[^\\]ijou[^\\]aruIte,[^\\] saraNI[^\\]10[^l]fun[^\\]denshaNI[^\\]noTte[^\\]gakkouNI[^\\] kayoImasu.[\\n]kenkouNO[^\\]ijiNImo[^\\]yakuDAtteimasuga,[^\\] nakanakatanoshiImonodesu.[\\n] where [^\\] and [^l] indicate 'ctl-\\' and 'ctl-l', respectively. See README.kenji for the details of this Japanese input method. .SH BUGS .PP There is no way to generate the control characters literally. .SH HISTORY Ktrans was originally written by Kenji Okamoto in August of 2000 for the 2nd edition of Plan 9. It was imported in to 9front in July of 2022, with patches by several contributors. It was towed inside the environment during the 2022 9front hackathon.