三三(’_`)<终端上的日语输入法skk(简单的假名到汉字转换)
sentimental-skk的Python项目详细描述
这是什么?
This program provides Simple Kana Kanji conversion (SKK) input method service to your terminal. It depends on “Canossa”(https://github.com/saitoha/canossa), which is an off-screen terminal emulation service, “Canossa” makes application enable to restore specified screen region on demand!! So this SKK service can provide cool popup feature.
SKK外壳
You can enter SKK-shell mode by “C-j / $”.
在skk shell中启动控制台应用程序时,它们在浮动窗口中运行。 由“canossa”管理的每个程序在每个窗口中异步工作。 可以使用鼠标操作调整每个窗口的大小并移动它们。 “CANOSSA”包括终端复用器/任务交换引擎。
查阅维基百科
You can consult Wikipedia by pressing C-w.
设置
You can enter configuration mode by “C-j / @”.
要求
python 2.5/2.6/2.7 unix/linux/cygwin版本
安装
通过Github
$ git clone --recursive https://github.com/saitoha/sentimental-skk.git sentimental-skk $ cd sentimental-skk $ python setup.py install
或通过PIP
$ pip install sentimental-skk
通过pip升级install
$ pip install sentimental-skk --upgrade
用法
$ sskk [options]
选项:
-h, --help show this help message and exit --version show version -t TERM, --term=TERM override TERM environment variable -l LANG, --lang=LANG override LANG environment variable -o ENC, --outenc=ENC set output encoding -u, --use-titlebar use title bar manipulation feature
工作原理
此程序用作终端筛选器应用程序,并且 创建一些pty。它在终端和应用程序之间挂接I/O流 在上面跑。
被识别为应用程序stdout句柄的输出流, 与终端仿真引擎(称为 “卡诺萨”。canossa有一个虚拟终端屏幕缓冲区,它包含 两个字符单元对象,并作为另一个终端模拟器。
+---------------------------------------------+ | | | Terminal | | | +---------------------------------------------+ | ^ | | < input > < output > | | | +----------------+ | | [ PTY 1 ] +------|------|-------------------------------+ | v | | | +----------+---+ +----------------+ | | | Master |=======| Slave | | | +--------------+ +--+-------------+ | | | ^ | +----------------------------|--------|-------+ | | < input > | | | +---------------+ < output > | | [ sskk ] | | [ canossa ] +------------|------------------------|------------+----------------------+ | | | | | | | |<------------------------+ | | v | | | | | +-----------------+ +---------+------+ | +---------+------+ | | | | | | | | | | | | | | | | | | | | | InputHandler | | OutputHandler | | | Canossa | | | | | | | | | | | | | | | | | | | | | +--------+---+----+ +----------------+ | +----------------+ | | | | ^ | ^ ^ | | | | | | | | | | | | | | | | | | | | +-------------------+ | | +----+----+ | | | | | | | | | | | | | | | TFF Multiplexer +-----------+ | widgets | | | | | | | | | | | | | | +-----------+-------+ | +---------+ | | | | | | ^ | | | | | | | | | | +------------------------------------------------+ | | | | | | +------------|------------------------|------------+----------------------+ | | < input > < output > | | | +----------------+ | | | | [ PTY 2 ] +-------|-------|-----------------------------+ | v | | | +------------+--+ +---------------+ | | | Master |=======| Slave | | | +---------------+ +----+----------+ | | | ^ | +-------------------------------|------|------+ | | +--------------------+ | | | +---------------+----------------------------------------------+ | | | Application Process | | | +--------------------------------------------------------------+
由上图表示的组件,如inputhandler、outputhandler, 卡诺萨,多路复用器是基于tff的。
TFF(终端过滤器框架):
Scanner Event Driven Parser Event Dispatcher +-----+ +-----+ +-----+ << I/O Stream >> | | << CodePoint Stream >> | | << Event Stream >> | | << I/O Stream >> ------------------->| |------------------------>| |-------------------->| |---||--------------------> (Raw Sequences) | | (Unicode Points) | | (Function Call) | | (Raw Sequences) +-----+ +-----+ +--+--+ ISO-2022 ISO-6429 | Compatible Parsing | v +-----+ Event Observer | | << I/O Stream >> (I/O Handler) | |---||--------------------> | | (Raw Sequences) +-----+
依赖性
- Masahiko Sato et al./SKK Development Team’s SKK dictionaries http://openlab.jp/skk/skk/dic
- Hayaki Saito’s Canossa https://github.com/saitoha/canossa
- Hayaki Saito’s TFF, Terminal Filter Framework https://github.com/saitoha/tff
- Hayaki Saito’s termprop https://github.com/saitoha/tff
参考
- Daredevil SKK (DDSKK) http://openlab.ring.gr.jp/skk/ddskk-ja.html
- libfep https://github.com/ueno/libfep
- uim https://code.google.com/p/uim/
- uobikiemukot / yaskk https://github.com/uobikiemukot/yaskk
- Unicode Text Editor MinEd http://towo.net/mined/