Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Port to Vala from Python using libskk.

  • Loading branch information...
commit ad0b820ff14d7fd8f85e8f8fb8b4c83c9b4d03f8 1 parent 543f599
@ueno authored
Showing with 7,171 additions and 6,525 deletions.
  1. +2 −0  .dir-locals.el
  2. +17 −6 Makefile.am
  3. +17 −29 README
  4. +18 −23 configure.ac
  5. +0 −3  engine/.gitignore
  6. +0 −63 engine/Makefile.am
  7. +0 −580 engine/engine.py
  8. +0 −90 engine/factory.py
  9. +0 −29 engine/ibus-engine-skk.in
  10. +0 −690 engine/kzik.py
  11. +0 −105 engine/main.py
  12. +0 −217 engine/nicola.py
  13. +0 −2,156 engine/skk.py
  14. +0 −936 engine/test.py
  15. +0 −179 engine/virtkbd.py
  16. +0 −10 ibus-skk.json.example
  17. +68 −9 ibus-skk.spec.in
  18. +3 −6 po/POTFILES.in
  19. +3 −1 po/POTFILES.skip
  20. +79 −83 po/ja.po
  21. +0 −1  setup/.gitignore
  22. +0 −47 setup/Makefile.am
  23. +0 −119 setup/config.py
  24. +0 −27 setup/ibus-setup-skk.in
  25. +0 −827 setup/ibus-skk-preferences.ui.in
  26. +0 −289 setup/main.py
  27. 0  {engine → }/skk.xml.in.in
  28. +75 −0 src/Makefile.am
  29. +13 −0 src/config.vapi
  30. +512 −0 src/engine.vala
  31. +1 −0  src/ibus-1.0.deps
  32. +4,743 −0 src/ibus-1.0.vapi
  33. +857 −0 src/ibus-skk-preferences.ui.in
  34. +3 −0  src/ibus-skk.deps
  35. +99 −0 src/plist.vala
  36. +117 −0 src/preferences.vala
  37. +544 −0 src/setup.vala
View
2  .dir-locals.el
@@ -0,0 +1,2 @@
+((c-mode . ((indent-tabs-mode . nil)))
+ (vala-mode . ((indent-tabs-mode . nil))))
View
23 Makefile.am
@@ -20,8 +20,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
SUBDIRS = \
- engine \
- setup \
+ src \
icons \
m4 \
po \
@@ -30,18 +29,30 @@ SUBDIRS = \
ACLOCAL_AMFLAGS = -I m4
+component_DATA = skk.xml
+componentdir = $(datadir)/ibus/component
+
+skk.xml: skk.xml.in
+ $(AM_V_GEN) \
+ ( \
+ libexecdir=${libexecdir}; \
+ pkgdatadir=${pkgdatadir}; \
+ s=`cat $<`; \
+ eval "echo \"$${s}\""; \
+ ) > $@
+
EXTRA_DIST = \
autogen.sh \
+ skk.xml.in.in \
ibus-skk.spec.in \
- python-config.py \
- ibus-skk.json.example \
$(NULL)
-noinst_DIST = \
+CLEANFILES = \
+ skk.xml \
$(NULL)
-
DISTCLEANFILES = \
+ skk.xml.in \
po/stamp-it \
$(NULL)
View
46 README
@@ -1,42 +1,34 @@
ibus-skk -- a Japanese SKK input engine for IBus
-* What's it?
+* What's this?
ibus-skk is an implementation of the SKK (Simple Kana-Kanji) input
-method on the IBus input method framework. Since SKK is quite
-different from other Japanese input methods, if you haven't heard of
-it, please consult the following Web pages before complaining about
-the differences:
+method on the IBus input method framework. To learn about SKK, see:
http://openlab.jp/skk/
https://secure.wikimedia.org/wikipedia/ja/wiki/SKK
* How to install
-$ sudo apt-get install libibus-dev skkdic
-$ ./configure --prefix=/usr # --libdir=/usr/lib64
-$ make
-$ sudo make install
+You will need libskk, a library which implements SKK algorithm, from:
-* Configuration
+http://github.com/ueno/libskk.git
-There is a GUI setup tool to customize ibus-skk. It can be started
-from the command line by "ibus-setup-m17n", or from the language
-panel.
+Since libskk and ibus-skk are written in Vala, you will need valac.
-For complex settings, such as romaji-to-kana conversion table, you can
-use configuration file located at ~/.config/ibus-skk.json. Use
-ibus-skk.json.example as a template.
+$ sudo apt-get install valac
+$ git clone git://github.com/ueno/libskk.git
+$ cd libskk && ./autogen.sh --prefix=/usr && make && sudo make install
-* Thumb shift keyboard support
+$ sudo apt-get install libibus-dev skkdic
+$ git clone git://github.com/ueno/ibus-skk.git
+$ cd ibus-skk && ./autogen.sh --prefix=/usr && make && sudo make install
-Since the version 1.3.4, ibus-skk supports thumb shift typing method
-(aka NICOLA). Currently the keymap is fixed and cannot be changed:
-Left Shift is assigned to Muhenkan and Right Shift is assigned to
-Henkan.
+* Configuration
-See the following blog entry for detail:
-http://blog.du-a.org/?p=74
+There is a GUI setup tool to customize ibus-skk. It can be started
+from the command line by "ibus-setup-skk", or from the IBus language
+panel.
* How to report bugs
@@ -46,9 +38,5 @@ http://github.com/ueno/ibus-skk/issues
https://bugzilla.redhat.com/buglist.cgi?component=ibus-skk&product=Fedora
http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=ibus-skk;dist=unstable
-Even though some developers read Japanese, please write in plain
-English so that we can forward it to other components when your
-problem is not specific to ibus-skk.
-
-If you can write Python, it would be helpful to add some failure test
-cases in engine/test.py and to attach the diff to the bug reports.
+Please write in plain English so that we can forward some bugs to
+other components.
View
41 configure.ac
@@ -21,10 +21,10 @@
# if not 1, append datestamp to the version number.
m4_define([package_name], [ibus-skk])
-m4_define([ibus_released], [1])
+m4_define([ibus_released], [0])
m4_define([ibus_major_version], [1])
m4_define([ibus_minor_version], [3])
-m4_define([ibus_micro_version], [9])
+m4_define([ibus_micro_version], [99])
m4_define(ibus_maybe_datestamp,
m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
@@ -57,22 +57,20 @@ m4_define([ibus_datedisplay], ibus_maybe_datedisplay)
DATE_DISPLAY="ibus_datedisplay"
AC_SUBST(DATE_DISPLAY)
-# check python
-AM_PATH_PYTHON([2.5])
+# check libskk
+PKG_CHECK_MODULES(IBUS_SKK, [ibus-1.0 >= 1.4.0 libskk], ,
+ AC_MSG_ERROR([can't find libskk]))
-AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
-if test x"$PYTHON_CONFIG" = x""; then
- AC_PATH_PROG(PYTHON_CONFIG, python-config)
-fi
-if test x"$PYTHON_CONFIG" != x""; then
- PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
- PYTHON_LIBS=`$PYTHON_CONFIG --libs`
-else
- PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
- PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
-fi
-AC_SUBST(PYTHON_CFLAGS)
-AC_SUBST(PYTHON_LIBS)
+# check gtk+
+PKG_CHECK_MODULES(GTK, [gtk+-3.0], ,
+ AC_MSG_ERROR([can't find gtk+-3.0]))
+
+# check vala
+AM_PROG_VALAC([0.10.0])
+
+AC_PATH_PROG(VALAC, valac, valac)
+AC_SUBST(VALAC)
+AC_SUBST(VALAFLAGS)
# define GETTEXT_* variables
GETTEXT_PACKAGE=ibus-skk
@@ -87,12 +85,9 @@ IBUS_SET_SYMBOL([&#x3042;])
AC_CONFIG_FILES([ po/Makefile.in
Makefile
ibus-skk.spec
-engine/Makefile
-engine/ibus-engine-skk
-engine/skk.xml.in
-setup/Makefile
-setup/ibus-setup-skk
-setup/ibus-skk-preferences.ui
+skk.xml.in
+src/Makefile
+src/ibus-skk-preferences.ui
icons/Makefile
scripts/Makefile
scripts/ibus-skk-convert-jisyo
View
3  engine/.gitignore
@@ -1,3 +0,0 @@
-ibus-engine-skk
-skk.xml.in
-skk.xml
View
63 engine/Makefile.am
@@ -1,63 +0,0 @@
-# vim:set noet ts=4:
-#
-# ibus-skk - The SKK engine for IBus
-#
-# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-engine_skk_PYTHON = \
- engine.py \
- factory.py \
- main.py \
- skk.py \
- kzik.py \
- nicola.py \
- virtkbd.py \
- $(NULL)
-engine_skkdir = $(pkgdatadir)/engine
-
-libexec_SCRIPTS = ibus-engine-skk
-engine_DATA = skk.xml
-enginedir = $(datadir)/ibus/component
-
-skk.xml: skk.xml.in
- ( \
- libexecdir=${libexecdir}; \
- pkgdatadir=${pkgdatadir}; \
- s=`cat $<`; \
- eval "echo \"$${s}\""; \
- ) > $@
-
-test:
- DBUS_DEBUG=true \
- IBUS_SKK_PKGDATADIR=$(abs_top_srcdir) \
- PYTHONPATH=$(builddir)/.libs:@pyexecdir@ \
- $(PYTHON) \
- $(srcdir)/main.py
-
-EXTRA_DIST = \
- skk.xml.in.in \
- ibus-engine-skk.in \
- test.py \
- $(NULL)
-
-CLEANFILES = \
- skk.xml \
- *.pyc \
- $(NULL)
-
-DISTCLEANFILES = \
- $(NULL)
View
580 engine/engine.py
@@ -1,580 +0,0 @@
-# vim:set et sts=4 sw=4:
-# -*- coding: utf-8 -*-
-#
-# ibus-skk - The SKK engine for IBus
-#
-# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
-# Copyright (C) 2009-2010 Daiki Ueno <ueno@unixuser.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-import gobject
-import ibus
-from ibus import keysyms
-from ibus import modifier
-import sys, os, os.path, time
-import skk
-import nicola
-import virtkbd
-try:
- from gtk import clipboard_get
-except ImportError:
- clipboard_get = lambda a : None
-
-from gettext import dgettext
-_ = lambda a : dgettext("ibus-skk", a)
-N_ = lambda a : a
-
-# Work-around for older IBus releases.
-if not hasattr(ibus, 'ORIENTATION_HORIZONTAL'):
- ibus.ORIENTATION_HORIZONTAL = 0
-
-class CandidateSelector(skk.CandidateSelector):
- def __init__(self, lookup_table, keys, page_size, pagination_start):
- self.__lookup_table = lookup_table
- self.__keys = keys
- super(CandidateSelector, self).__init__(page_size, pagination_start)
-
- def set_candidates(self, candidates):
- super(CandidateSelector, self).set_candidates(candidates)
- if len(candidates) > self.pagination_start:
- self.__lookup_table.clean()
- for candidate, annotation in candidates[self.pagination_start:]:
- self.__lookup_table.append_candidate(ibus.Text(candidate))
-
- def lookup_table_visible(self):
- if self.index() >= self.pagination_start:
- return True
- return False
-
- def next_candidate(self, move_over_pages=True):
- super(CandidateSelector, self).next_candidate(move_over_pages)
- if self.lookup_table_visible():
- if self.index() == self.pagination_start:
- self.__lookup_table.set_cursor_pos(0)
- elif not move_over_pages:
- self.__lookup_table.set_cursor_pos(self.index() -
- self.pagination_start)
- return self.candidate()
-
- def previous_candidate(self, move_over_pages=True):
- super(CandidateSelector, self).previous_candidate(move_over_pages)
- if self.lookup_table_visible():
- if self.index() == self.pagination_start:
- self.__lookup_table.set_cursor_pos(0)
- elif not move_over_pages:
- self.__lookup_table.set_cursor_pos(self.index() -
- self.pagination_start)
- return self.candidate()
-
- __emacsclient_paths = ('/usr/bin/emacsclient',
- '/usr/local/bin/emacsclient')
-
- def candidate(self):
- candidate = super(CandidateSelector, self).candidate()
- if candidate is None:
- return None
- output, annotation, save = candidate
- if output.startswith(u'(') and output.endswith(u')'):
- for path in self.__emacsclient_paths:
- if os.system('%s --eval \'(ignore)\'' % path) == 0:
- pw, pr = os.popen2('%s --eval \'\
-(read (encode-coding-string (prin1-to-string %s) (quote utf-8)))\'' %
- (path, output))
- output = pr.read().decode('UTF-8').strip()
- if output.startswith('"') and output.endswith('"'):
- output = output[1:-1]
- return (output, annotation, False)
- return candidate
-
- def set_index(self, index):
- super(CandidateSelector, self).set_index(index)
- if self.index() >= self.pagination_start:
- self.__lookup_table.set_cursor_pos(self.index() -
- self.pagination_start)
-
- def key_to_index(self, key):
- if key not in self.__keys:
- raise IndexError('%s is not a valid key' % key)
- pos = self.__keys.index(key)
- if self.__lookup_table.set_cursor_pos_in_current_page(pos):
- index = self.__lookup_table.get_cursor_pos()
- return self.__pagination_start + index
- else:
- raise IndexError('invalid key position %d' % pos)
-
- def pos_to_index(self, pos):
- if self.__lookup_table.set_cursor_pos_in_current_page(pos):
- index = self.__lookup_table.get_cursor_pos()
- return self.__pagination_start + index
- else:
- raise IndexError('invalid key position %d' % pos)
-
-class Engine(ibus.EngineBase):
- config = None
- sysdict = None
- __setup_pid = 0
-
- __select_keys = [u'a', u's', u'd', u'f', u'j', u'k', u'l',
- u'q', u'w', u'e', u'r', u'u', u'i', u'o',
- u'z', u'x', u'c', u'v', u'm', u',', u'.']
-
- __input_mode_prop_names = {
- skk.INPUT_MODE_HIRAGANA : u"InputMode.Hiragana",
- skk.INPUT_MODE_KATAKANA : u"InputMode.Katakana",
- skk.INPUT_MODE_HANKAKU_KATAKANA : u"InputMode.HankakuKatakana",
- skk.INPUT_MODE_LATIN : u"InputMode.Latin",
- skk.INPUT_MODE_WIDE_LATIN : u"InputMode.WideLatin"
- }
-
- __prop_name_input_modes = dict()
- for key, val in __input_mode_prop_names.items():
- __prop_name_input_modes[val] = key
-
- __input_mode_labels = {
- skk.INPUT_MODE_HIRAGANA : u"",
- skk.INPUT_MODE_KATAKANA : u"",
- skk.INPUT_MODE_HANKAKU_KATAKANA : u"_ア",
- skk.INPUT_MODE_LATIN : u"_A",
- skk.INPUT_MODE_WIDE_LATIN : u""
- }
-
- def __init__(self, bus, object_path):
- super(Engine, self).__init__(bus, object_path)
- self.__is_invalidate = False
- labels = [ibus.Text(c.upper() + u':') for c in self.__select_keys]
- page_size = self.config.get_value('page_size')
- pagination_start = \
- self.config.get_value('pagination_start')
- self.__lookup_table = ibus.LookupTable(page_size=page_size,
- round=False,
- labels=labels)
- if hasattr(self.__lookup_table, 'set_orientation'):
- self.__lookup_table.set_orientation(ibus.ORIENTATION_HORIZONTAL)
-
- self.__candidate_selector = CandidateSelector(self.__lookup_table,
- self.__select_keys,
- page_size,
- pagination_start)
- usrdict = skk.UsrDict(self.config.usrdict_path)
- self.__skk = skk.Context(usrdict, self.sysdict,
- self.__candidate_selector)
- self.__skk.kutouten_type = self.config.get_value('period_style')
- auto_start_henkan_keywords = \
- self.config.get_value('auto_start_henkan_keywords')
- self.__skk.auto_start_henkan_keywords = \
- list(iter(auto_start_henkan_keywords))
- self.__skk.rom_kana_rule = self.config.get_value('rom_kana_rule')
- self.__skk.egg_like_newline = self.config.get_value('egg_like_newline')
- self.__skk.direct_input_on_latin = \
- self.config.get_value('direct_input_on_latin')
- self.__initial_input_mode = \
- self.config.get_value('initial_input_mode')
- self.__skk.translated_strings['dict-edit-prompt'] =\
- _(u'DictEdit').decode('UTF-8')
- self.__skk.translated_strings['kuten-prompt'] =\
- _(u'Kuten([MM]KKTT) ').decode('UTF-8')
- self.__skk.custom_rom_kana_rule = \
- self.config.get_value('custom_rom_kana_rule')
-
- if self.config.get_value('enable_virtual_keyboard'):
- try:
- self.__virtual_keyboard = virtkbd.VirtualKeyboardEekboard(self)
- except:
- self.__virtual_keyboard = virtkbd.VirtualKeyboardFallback(self)
- else:
- self.__virtual_keyboard = virtkbd.VirtualKeyboardFallback(self)
-
- self.__skk.reset()
- self.__skk.activate_input_mode(self.__initial_input_mode)
- self.__prop_dict = dict()
- self.__prop_list = self.__init_props()
- self.__input_mode = None # use invalid input mode (None) to force update
- self.__update_input_mode()
- self.__suspended_mode = None
- if self.config.get_value('use_nicola'):
- self.__nicola = nicola.Nicola(time_func=time.time)
- self.__nicola_handler = None
- else:
- self.__nicola = None
-
- input_mode = property(lambda self: self.__input_mode)
-
- def __init_props(self):
- skk_props = ibus.PropList()
-
- input_mode_prop = ibus.Property(key=u"InputMode",
- type=ibus.PROP_TYPE_MENU,
- label=u"",
- tooltip=_(u"Switch input mode"))
- self.__prop_dict[u"InputMode"] = input_mode_prop
-
- props = ibus.PropList()
- props.append(ibus.Property(key=u"InputMode.Hiragana",
- type=ibus.PROP_TYPE_RADIO,
- label=_(u"Hiragana")))
- props.append(ibus.Property(key=u"InputMode.Katakana",
- type=ibus.PROP_TYPE_RADIO,
- label=_(u"Katakana")))
- props.append(ibus.Property(key=u"InputMode.HankakuKatakana",
- type=ibus.PROP_TYPE_RADIO,
- label=_(u"HankakuKatakana")))
- props.append(ibus.Property(key=u"InputMode.Latin",
- type=ibus.PROP_TYPE_RADIO,
- label=_(u"Latin")))
- props.append(ibus.Property(key=u"InputMode.WideLatin",
- type=ibus.PROP_TYPE_RADIO,
- label=_(u"Wide Latin")))
-
- props[self.__skk.input_mode].set_state(ibus.PROP_STATE_CHECKED)
-
- for prop in props:
- self.__prop_dict[prop.key] = prop
-
- input_mode_prop.set_sub_props(props)
- skk_props.append(input_mode_prop)
-
- visible = not isinstance(self.__virtual_keyboard,
- virtkbd.VirtualKeyboardFallback)
- keyboard_prop = ibus.Property(key=u"virtual-keyboard",
- icon=u"input-keyboard",
- tooltip=_(u"Launch on-screen keyboard"),
- visible=visible)
- skk_props.append(keyboard_prop)
-
- skk_props.append(ibus.Property(key=u"setup",
- tooltip=_(u"Configure SKK")))
-
- return skk_props
-
- def __update_input_mode(self):
- if self.__input_mode == self.__skk.input_mode:
- return False
- self.__input_mode = self.__skk.input_mode
- prop_name = self.__input_mode_prop_names[self.__input_mode]
- self.__prop_dict[prop_name].set_state(ibus.PROP_STATE_CHECKED)
- self.update_property(self.__prop_dict[prop_name])
- prop = self.__prop_dict[u"InputMode"]
- prop.label = self.__input_mode_labels[self.__input_mode]
- if hasattr(self, 'set_icon_symbol'):
- self.set_icon_symbol(prop.label)
- self.update_property(prop)
- self.__virtual_keyboard.set_mode(input_mode=self.__input_mode,
- typing_mode=None)
- self.__invalidate()
-
- def __get_clipboard(self, clipboard, text, data):
- clipboard_text = clipboard.wait_for_text()
- if clipboard_text:
- handled, output = \
- self.__skk.append_text(clipboard_text.decode('UTF-8'))
- self.__check_handled(handled, output)
-
- def process_key_event(self, keyval, keycode, state):
- # ignore key release events
- if state & modifier.RELEASE_MASK:
- return False
- # ignore alt+key events
- if state & modifier.MOD1_MASK:
- return False
-
- if self.__skk.conv_state == skk.CONV_STATE_SELECT:
- if keyval == keysyms.Page_Up or keyval == keysyms.KP_Page_Up:
- self.page_up()
- return True
- elif keyval == keysyms.Page_Down or keyval == keysyms.KP_Page_Down:
- self.page_down()
- return True
- elif keyval == keysyms.Up or keyval == keysyms.Left:
- self.__skk.previous_candidate(False)
- self.__update()
- return True
- elif keyval == keysyms.Down or keyval == keysyms.Right:
- self.__skk.next_candidate(False)
- self.__update()
- return True
- elif state & modifier.CONTROL_MASK == 0 and \
- self.__candidate_selector.lookup_table_visible():
- try:
- index = self.__candidate_selector.\
- key_to_index(unichr(keyval).lower())
- handled, output = self.__skk.select_candidate(index)
- if handled:
- if output:
- self.commit_text(ibus.Text(output))
- gobject.idle_add(self.__skk.usrdict.save,
- priority = gobject.PRIORITY_LOW)
- self.__lookup_table.clean()
- self.__update()
- return True
- except IndexError:
- pass
- elif (self.__skk.dict_edit_level() > 0 or \
- self.__skk.conv_state == skk.CONV_STATE_START) and \
- (state & modifier.CONTROL_MASK) and \
- unichr(keyval).lower() in (u'y', u'v'):
- if unichr(keyval).lower() == u'y':
- clipboard = clipboard_get ("PRIMARY")
- else:
- clipboard = clipboard_get ("CLIPBOARD")
- if clipboard:
- clipboard.request_text(self.__get_clipboard)
-
- if keyval == keysyms.Tab:
- keychr = u'\t'
- elif keyval == keysyms.Return:
- keychr = u'return'
- elif keyval == keysyms.Escape:
- keychr = u'escape'
- elif keyval == keysyms.BackSpace:
- keychr = u'backspace'
- elif self.__nicola and keyval == keysyms.Muhenkan:
- keychr = u'lshift'
- elif self.__nicola and keyval == keysyms.Henkan:
- keychr = u'rshift'
- else:
- keychr = unichr(keyval)
- if self.__virtual_keyboard.keyboard_type == virtkbd.KEYBOARD_TYPE_JP:
- keychr = u'kana+' + keychr
- elif 0x20 > ord(keychr) or ord(keychr) > 0x7E:
- # If the pre-edit buffer is visible, always handle key events:
- # http://github.com/ueno/ibus-skk/issues/#issue/5
- return len(self.__skk.preedit) > 0
- if state & modifier.CONTROL_MASK:
- # Some systems return 'J' if ctrl:nocaps xkb option is
- # enabled and the user press CapsLock + 'j':
- # http://github.com/ueno/ibus-skk/issues/#issue/22
- keychr = u'ctrl+' + keychr.lower()
- elif self.__nicola:
- if keychr in (u'lshift', u'rshift') or len(keychr) == 1:
- self.__nicola.queue(keychr)
- else:
- return self.__skk_press_key(keychr)
- self.__nicola_dispatch()
- return True
- return self.__skk_press_key(keychr)
-
- def __nicola_dispatch(self, is_timer=False):
- if self.__nicola_handler:
- gobject.source_remove(self.__nicola_handler)
- result = self.__nicola.dispatch()
- for keychr in result.output:
- self.__skk_press_key(u'nicola+' + keychr)
- self.__nicola_handler = gobject.timeout_add(int(result.wait * 1000),
- self.__nicola_dispatch,
- True)
-
- def __check_handled(self, handled, output):
- if output:
- self.commit_text(ibus.Text(output))
- if handled:
- gobject.idle_add(self.__skk.usrdict.save,
- priority = gobject.PRIORITY_LOW)
- self.__update()
- return True
- return False
-
- def __skk_press_key(self, keychr):
- handled, output = self.__skk.press_key(keychr)
- if self.__check_handled(handled, output):
- return True
- # If the pre-edit buffer is visible, always handle key events:
- # http://github.com/ueno/ibus-skk/issues/#issue/5
- return len(self.__skk.preedit) > 0
-
- def __invalidate(self):
- if self.__is_invalidate:
- return
- self.__is_invalidate = True
- gobject.idle_add(self.__update, priority = gobject.PRIORITY_LOW)
-
- def page_up(self):
- if self.__lookup_table.page_up():
- self.page_up_lookup_table()
- self.__candidate_selector.previous_candidate(True)
- self.__update()
- return True
- return False
-
- def page_down(self):
- if self.__lookup_table.page_down():
- self.page_down_lookup_table()
- self.__candidate_selector.next_candidate(True)
- self.__update()
- return True
- return False
-
- def cursor_up(self):
- if self.__lookup_table.cursor_up():
- self.cursor_up_lookup_table()
- self.__candidate_selector.previous_candidate(False)
- self.__update()
- return True
- return False
-
- def cursor_down(self):
- if self.__lookup_table.cursor_down():
- self.cursor_down_lookup_table()
- self.__candidate_selector.next_candidate(False)
- self.__update()
- return True
- return False
-
- def candidate_clicked(self, index, button, state):
- try:
- index = self.__candidate_selector.pos_to_index(index)
- handled, output = self.__skk.select_candidate(index)
- if handled:
- if output:
- self.commit_text(ibus.Text(output))
- gobject.idle_add(self.__skk.usrdict.save,
- priority = gobject.PRIORITY_LOW)
- self.__lookup_table.clean()
- self.__update()
- except IndexError:
- pass
-
- def __possibly_update_config(self):
- if self.__skk.usrdict.path != self.config.usrdict_path:
- self.__skk.usrdict = skk.UsrDict(self.config.usrdict_path)
- self.__skk.kutouten_type = self.config.get_value('period_style')
- self.__skk.rom_kana_rule = self.config.get_value('rom_kana_rule')
- self.__initial_input_mode = \
- self.config.get_value('initial_input_mode')
- self.__skk.auto_start_henkan_keywords = \
- list(iter(self.config.get_value('auto_start_henkan_keywords')))
-
- # ABBREV_CURSOR_COLOR = (65, 105, 225)
- # INPUT_MODE_CURSOR_COLORS = {
- # skk.INPUT_MODE_HIRAGANA: (139, 62, 47),
- # skk.INPUT_MODE_KATAKANA: (34, 139, 34),
- # skk.INPUT_MODE_HANKAKU_KATAKANA: (138, 43, 226),
- # skk.INPUT_MODE_LATIN: (139, 139, 131),
- # skk.INPUT_MODE_WIDE_LATIN: (255, 215, 0)
- # }
-
- def __update(self):
- prompt, prefix, word, suffix = self.__skk.preedit_components()
- prefix_start = len(prompt)
- word_start = prefix_start + len(prefix)
- suffix_start = word_start + len(word)
- suffix_end = suffix_start + len(suffix)
- attrs = ibus.AttrList()
- # Display "[DictEdit]" way different from other components
- # (black/lightsalmon).
- attrs.append(ibus.AttributeForeground(ibus.RGB(0, 0, 0),
- 0, prefix_start))
- attrs.append(ibus.AttributeBackground(ibus.RGB(255, 160, 122),
- 0, prefix_start))
- if self.__skk.conv_state == skk.CONV_STATE_SELECT:
- # Use colors from skk-henkan-face-default (black/darkseagreen2).
- attrs.append(ibus.AttributeForeground(ibus.RGB(0, 0, 0),
- word_start, suffix_start))
- attrs.append(ibus.AttributeBackground(ibus.RGB(180, 238, 180),
- word_start, suffix_start))
- attrs.append(ibus.AttributeUnderline(ibus.ATTR_UNDERLINE_SINGLE,
- suffix_start, suffix_end))
- else:
- attrs.append(ibus.AttributeUnderline(ibus.ATTR_UNDERLINE_SINGLE,
- word_start, suffix_end))
- # Color cursor, currently disabled.
- #
- # if self.__skk.abbrev:
- # cursor_color = self.ABBREV_CURSOR_COLOR
- # else:
- # cursor_color = self.INPUT_MODE_CURSOR_COLORS.get(\
- # self.__skk.input_mode)
- # attrs.append(ibus.AttributeBackground(ibus.RGB(*cursor_color),
- # suffix_end, suffix_end + 1))
- # preedit = ''.join((prompt, prefix, word, suffix, u' '))
- #
- preedit = ''.join((prompt, prefix, word, suffix))
- self.update_preedit_text(ibus.Text(preedit, attrs),
- len(preedit), len(preedit) > 0)
- visible = self.__candidate_selector.lookup_table_visible()
- if self.config.get_value('show_annotation'):
- candidate = self.__candidate_selector.candidate()
- annotation = candidate[1] if candidate else None
- self.update_auxiliary_text(ibus.Text(annotation or u''), visible)
- self.update_lookup_table(self.__lookup_table, visible)
- self.__update_input_mode()
-
- if self.__skk.conv_state is not skk.CONV_STATE_SELECT:
- gobject.idle_add(self.__possibly_update_config,
- priority = gobject.PRIORITY_LOW)
-
- self.__is_invalidate = False
-
- def fill_lookup_table(self, candidates):
- self.__lookup_table.clean()
- for candidate in candidates:
- self.__lookup_table.append_candidate(ibus.Text(candidate))
- self.__lookup_table_hidden = False
-
- def lookup_table_visible(self):
- return not self.__lookup_table_hidden and \
- self.__lookup_table.get_number_of_candidates() > 1
-
- def show_lookup_table(self):
- self.__lookup_table_hidden = False
- super(Engine, self).show_lookup_table()
-
- def hide_lookup_table(self):
- self.__lookup_table_hidden = True
- super(Engine, self).hide_lookup_table()
-
- def __start_setup(self):
- if Engine.__setup_pid != 0:
- pid, state = os.waitpid(Engine.__setup_pid, os.P_NOWAIT)
- if pid != Engine.__setup_pid:
- return
- Engine.__setup_pid = 0
- setup_cmd = os.path.join(os.getenv('LIBEXECDIR'), 'ibus-setup-skk')
- Engine.__setup_pid = os.spawnl(os.P_NOWAIT, setup_cmd, 'ibus-setup-skk')
-
- def focus_in(self):
- self.register_properties(self.__prop_list)
- # skipped at first focus_in after ibus startup
- if self.__suspended_mode is not None:
- self.__skk.activate_input_mode(self.__suspended_mode)
- self.__suspended_mode = None
- self.__update_input_mode()
- self.__virtual_keyboard.enable()
-
- def focus_out(self):
- self.__suspended_mode = self.__skk.input_mode
- # self.__skk.kakutei()
- # self.commit_text(ibus.Text(u''))
- self.__lookup_table.clean()
- self.__update()
- self.__skk.reset()
- self.__virtual_keyboard.disable()
-
- def reset(self):
- self.__skk.reset()
- self.__skk.activate_input_mode(self.__input_mode)
-
- def property_activate(self, prop_name, state):
- # print "PropertyActivate(%s, %d)" % (prop_name, state)
- if prop_name.startswith('InputMode'):
- if state == ibus.PROP_STATE_CHECKED:
- input_mode = self.__prop_name_input_modes[prop_name]
- self.__skk.activate_input_mode(input_mode)
- self.__update_input_mode()
- elif prop_name == 'virtual-keyboard':
- self.__virtual_keyboard.toggle_visible()
- else:
- if prop_name == 'setup':
- self.__start_setup()
View
90 engine/factory.py
@@ -1,90 +0,0 @@
-# vim:set et sts=4 sw=4:
-# -*- coding: utf-8 -*-
-#
-# ibus-skk - The SKK engine for IBus
-#
-# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-import ibus
-import engine
-import sys, os, os.path
-import skk
-
-from gettext import dgettext
-_ = lambda a : dgettext("ibus-skk", a)
-N_ = lambda a : a
-
-sys.path.insert(0, os.path.join(os.getenv('IBUS_SKK_PKGDATADIR'), 'setup'))
-import config
-
-class EngineFactory(ibus.EngineFactoryBase):
- FACTORY_PATH = "/com/redhat/IBus/engines/SKK/Factory"
- ENGINE_PATH = "/com/redhat/IBus/engines/SKK/Engine"
- NAME = _("SKK")
- LANG = "ja"
- ICON = os.getenv("IBUS_SKK_PKGDATADIR") + "/icons/ibus-skk.svg"
- AUTHORS = "Daiki Ueno <ueno@unixuser.org>"
- CREDITS = "GPLv2"
-
- def __init__(self, bus):
- self.__bus = bus
- super(EngineFactory, self).__init__(bus)
-
- self.__id = 0
- bus_config = self.__bus.get_config()
- bus_config.connect("reloaded", self.__config_reloaded_cb)
- bus_config.connect("value-changed", self.__config_value_changed_cb)
- self.__config_reloaded_cb(bus_config)
-
- def create_engine(self, engine_name):
- if engine_name == "skk":
- self.__id += 1
- return engine.Engine(self.__bus, "%s/%d" % (self.ENGINE_PATH, self.__id))
-
- return super(EngineFactory, self).create_engine(engine_name)
-
- def __load_sysdict(self, _config):
- sysdict_type = _config.get_value('sysdict_type')
- try:
- if sysdict_type == 'file':
- use_mmap = _config.get_value('use_mmap')
- instances = list()
- for path in _config.sysdict_paths:
- instances.append(skk.SysDict(path, use_mmap=use_mmap))
- return skk.MultiSysDict(instances)
- else:
- host = _config.get_value('skkserv_host')
- port = int(_config.get_value('skkserv_port'))
- args = [host, port]
- encoding = _config.get_value('skkserv_encoding')
- if encoding:
- args.append(encoding)
- return skk.SkkServ(*args)
- except:
- return skk.EmptyDict()
-
- def __config_reloaded_cb(self, bus_config):
- engine.Engine.config = config.Config(self.__bus)
- engine.Engine.sysdict = self.__load_sysdict(engine.Engine.config)
-
- def __config_value_changed_cb(self, bus_config, section, name, value):
- if section == 'engine/SKK':
- engine.Engine.config.set_value(name, value)
- if name in ('sysdict_type', 'sysdict_paths', 'use_mmap',
- 'skkserv_host', 'skkserv_port',
- 'skkserv_encoding'):
- engine.Engine.sysdict = self.__load_sysdict(engine.Engine.config)
View
29 engine/ibus-engine-skk.in
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# ibus - The Input Bus
-#
-# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA
-prefix=@prefix@
-datarootdir=@datarootdir@
-exec_prefix=@exec_prefix@
-libexecdir=@libexecdir@
-export IBUS_PREFIX=@prefix@
-export IBUS_SKK_PKGDATADIR=@datarootdir@/@PACKAGE@
-export LIBEXECDIR=$libexecdir
-exec @PYTHON@ @datarootdir@/@PACKAGE@/engine/main.py $@
-
View
690 engine/kzik.py
@@ -1,690 +0,0 @@
-# vim:set et sts=4 sw=4:
-# -*- coding: utf-8 -*-
-KZIK_RULE = {
- u'a': (None, (u'', u'')),
- u'ba': (None, (u'', u'')),
- u'be': (None, (u'', u'')),
- u'bi': (None, (u'', u'')),
- u'bo': (None, (u'', u'')),
- u'bu': (None, (u'', u'')),
- u'bya': (None, (u'ビャ', u'びゃ')),
- u'bye': (None, (u'ビェ', u'びぇ')),
- u'byi': (None, (u'ビィ', u'びぃ')),
- u'byo': (None, (u'ビョ', u'びょ')),
- u'byu': (None, (u'ビュ', u'びゅ')),
- u'cya': (None, (u'チャ', u'ちゃ')),
- u'cye': (None, (u'チェ', u'ちぇ')),
- u'cyi': (None, (u'チィ', u'ちぃ')),
- u'cyo': (None, (u'チョ', u'ちょ')),
- u'cyu': (None, (u'チュ', u'ちゅ')),
- u'da': (None, (u'', u'')),
- u'de': (None, (u'', u'')),
- u'df': (None, (u'', u'')),
- u'di': (None, (u'', u'')),
- u'do': (None, (u'', u'')),
- u'du': (None, (u'', u'')),
- u'e': (None, (u'', u'')),
- u'fa': (None, (u'ファ', u'ふぁ')),
- u'fe': (None, (u'フェ', u'ふぇ')),
- u'fi': (None, (u'フィ', u'ふぃ')),
- u'fo': (None, (u'フォ', u'ふぉ')),
- u'fu': (None, (u'', u'')),
- u'fya': (None, (u'フャ', u'ふゃ')),
- u'fye': (None, (u'フェ', u'ふぇ')),
- u'fyi': (None, (u'フィ', u'ふぃ')),
- u'fyo': (None, (u'フョ', u'ふょ')),
- u'fyu': (None, (u'フュ', u'ふゅ')),
- u'ga': (None, (u'', u'')),
- u'ge': (None, (u'', u'')),
- u'gi': (None, (u'', u'')),
- u'go': (None, (u'', u'')),
- u'gu': (None, (u'', u'')),
- u'gya': (None, (u'ギャ', u'ぎゃ')),
- u'gye': (None, (u'ギェ', u'ぎぇ')),
- u'gyi': (None, (u'ギィ', u'ぎぃ')),
- u'gyo': (None, (u'ギョ', u'ぎょ')),
- u'gyu': (None, (u'ギュ', u'ぎゅ')),
- u'ha': (None, (u'', u'')),
- u'he': (None, (u'', u'')),
- u'hi': (None, (u'', u'')),
- u'ho': (None, (u'', u'')),
- u'hu': (None, (u'', u'')),
- u'hya': (None, (u'ヒャ', u'ひゃ')),
- u'hye': (None, (u'ヒェ', u'ひぇ')),
- u'hyi': (None, (u'ヒィ', u'ひぃ')),
- u'hyo': (None, (u'ヒョ', u'ひょ')),
- u'hyu': (None, (u'ヒュ', u'ひゅ')),
- u'i': (None, (u'', u'')),
- u'ja': (None, (u'ジャ', u'じゃ')),
- u'je': (None, (u'ジェ', u'じぇ')),
- u'ji': (None, (u'', u'')),
- u'jo': (None, (u'ジョ', u'じょ')),
- u'ju': (None, (u'ジュ', u'じゅ')),
- u'jya': (None, (u'ジャ', u'じゃ')),
- u'jye': (None, (u'ジェ', u'じぇ')),
- u'jyi': (None, (u'ジィ', u'じぃ')),
- u'jyo': (None, (u'ジョ', u'じょ')),
- u'jyu': (None, (u'ジュ', u'じゅ')),
- u'ka': (None, (u'', u'')),
- u'ke': (None, (u'', u'')),
- u'ki': (None, (u'', u'')),
- u'kf': (None, (u'', u'')),
- u'ko': (None, (u'', u'')),
- u'ku': (None, (u'', u'')),
- u'kya': (None, (u'キャ', u'きゃ')),
- u'kye': (None, (u'キェ', u'きぇ')),
- u'kyi': (None, (u'キィ', u'きぃ')),
- u'kyo': (None, (u'キョ', u'きょ')),
- u'kyu': (None, (u'キュ', u'きゅ')),
- u'ma': (None, (u'', u'')),
- u'me': (None, (u'', u'')),
- u'mi': (None, (u'', u'')),
- u'mo': (None, (u'', u'')),
- u'mu': (None, (u'', u'')),
- u'mf': (None, (u'', u'')),
- u'mya': (None, (u'ミャ', u'みゃ')),
- u'mye': (None, (u'ミェ', u'みぇ')),
- u'myi': (None, (u'ミィ', u'みぃ')),
- u'myo': (None, (u'ミョ', u'みょ')),
- u'myu': (None, (u'ミュ', u'みゅ')),
- u'n\'': (None, (u'', u'')),
- u'na': (None, (u'', u'')),
- u'ne': (None, (u'', u'')),
- u'ni': (None, (u'', u'')),
- u'nn': (None, (u'', u'')),
- u'no': (None, (u'', u'')),
- u'nu': (None, (u'', u'')),
- u'nf': (None, (u'', u'')),
- u'nya': (None, (u'ニャ', u'にゃ')),
- u'nye': (None, (u'ニェ', u'にぇ')),
- u'nyi': (None, (u'ニィ', u'にぃ')),
- u'nyo': (None, (u'ニョ', u'にょ')),
- u'nyu': (None, (u'ニュ', u'にゅ')),
- u'o': (None, (u'', u'')),
- u'pa': (None, (u'', u'')),
- u'pe': (None, (u'', u'')),
- u'pi': (None, (u'', u'')),
- u'po': (None, (u'', u'')),
- u'pu': (None, (u'', u'')),
- u'pya': (None, (u'ピャ', u'ぴゃ')),
- u'pye': (None, (u'ピェ', u'ぴぇ')),
- u'pyi': (None, (u'ピィ', u'ぴぃ')),
- u'pyo': (None, (u'ピョ', u'ぴょ')),
- u'pyu': (None, (u'ピュ', u'ぴゅ')),
- u'ra': (None, (u'', u'')),
- u're': (None, (u'', u'')),
- u'ri': (None, (u'', u'')),
- u'ro': (None, (u'', u'')),
- u'ru': (None, (u'', u'')),
- u'rya': (None, (u'リャ', u'りゃ')),
- u'rye': (None, (u'リェ', u'りぇ')),
- u'ryi': (None, (u'リィ', u'りぃ')),
- u'ryo': (None, (u'リョ', u'りょ')),
- u'ryu': (None, (u'リュ', u'りゅ')),
- u'sa': (None, (u'', u'')),
- u'se': (None, (u'', u'')),
- u'si': (None, (u'', u'')),
- u'so': (None, (u'', u'')),
- u'su': (None, (u'', u'')),
- u'sya': (None, (u'シャ', u'しゃ')),
- u'sye': (None, (u'シェ', u'しぇ')),
- u'syi': (None, (u'シィ', u'しぃ')),
- u'syo': (None, (u'ショ', u'しょ')),
- u'syu': (None, (u'シュ', u'しゅ')),
- u'ta': (None, (u'', u'')),
- u'te': (None, (u'', u'')),
- u'ti': (None, (u'', u'')),
- u'to': (None, (u'', u'')),
- u'tu': (None, (u'', u'')),
- u'u': (None, (u'', u'')),
- u'va': (None, (u'ヴァ', u'う゛ぁ')),
- u've': (None, (u'ヴェ', u'う゛ぇ')),
- u'vi': (None, (u'ヴィ', u'う゛ぃ')),
- u'vo': (None, (u'ヴォ', u'う゛ぉ')),
- u'vu': (None, (u'', u'う゛')),
- u'wa': (None, (u'', u'')),
- u'we': (None, (u'ウェ', u'うぇ')),
- u'wi': (None, (u'ウィ', u'うぃ')),
- u'wo': (None, (u'', u'')),
- u'wu': (None, (u'', u'')),
- u'xxa': (None, (u'', u'')),
- u'xxe': (None, (u'', u'')),
- u'xxi': (None, (u'', u'')),
- u'xka': (None, (u'', u'')),
- u'xke': (None, (u'', u'')),
- u'xxo': (None, (u'', u'')),
- u'xxu': (None, (u'', u'')),
- u'xxwa': (None, (u'', u'')),
- u'xxwe': (None, (u'', u'')),
- u'xxwi': (None, (u'', u'')),
- u'xya': (None, (u'', u'')),
- u'xyo': (None, (u'', u'')),
- u'xyu': (None, (u'', u'')),
- u'ya': (None, (u'', u'')),
- u'ye': (None, (u'イェ', u'いぇ')),
- u'yo': (None, (u'', u'')),
- u'yu': (None, (u'', u'')),
- u'z,': (None, u''),
- u'z-': (None, u''),
- u'z.': (None, u''),
- u'z/': (None, u''),
- u'z[': (None, u''),
- u'z]': (None, u''),
- u'za': (None, (u'', u'')),
- u'ze': (None, (u'', u'')),
- u'xxh': (None, u''),
- u'zi': (None, (u'', u'')),
- u'xxj': (None, u''),
- u'xxk': (None, u''),
- u'xxl': (None, u''),
- u'zo': (None, (u'', u'')),
- u'zu': (None, (u'', u'')),
- u'ff': (u'f', (u'', u'')),
- u'tt': (u't', (u'', u'')),
- u'-': (None, u''),
- u':': (u'b', (u'', u'')),
- u';': (None, (u'', u'')),
- u'?': (None, u''),
- u'[': (None, u''),
- u']': (None, u''),
- u'bga': (None, (u'ビャ', u'びゃ')),
- u'bgd': (None, (u'ビェン', u'びぇん')),
- u'bge': (None, (u'ビェ', u'びぇ')),
- u'bgo': (None, (u'ビョ', u'びょ')),
- u'bgu': (None, (u'ビュ', u'びゅ')),
- u'dci': (None, (u'ディ', u'でぃ')),
- u'dcu': (None, (u'ドゥ', u'どぅ')),
- u'gga': (None, (u'ギャ', u'ぎゃ')),
- u'ggu': (None, (u'ギュ', u'ぎゅ')),
- u'gge': (None, (u'ギェ', u'ぎぇ')),
- u'ggo': (None, (u'ギョ', u'ぎょ')),
- u'hgo': (None, (u'ヒョ', u'ひょ')),
- u'hga': (None, (u'ヒャ', u'ひゃ')),
- u'hge': (None, (u'ヒェ', u'ひぇ')),
- u'hgu': (None, (u'ヒュ', u'ひゅ')),
- u'bgh': (None, (u'ビュウ', u'びゅう')),
- u'bgj': (None, (u'ビュン', u'びゅん')),
- u'bgl': (None, (u'ビョン', u'びょん')),
- u'bgn': (None, (u'ビャン', u'びゃん')),
- u'bgp': (None, (u'ビョウ', u'びょう')),
- u'bgq': (None, (u'ビャイ', u'びゃい')),
- u'bgw': (None, (u'ビェイ', u'びぇい')),
- u'bgz': (None, (u'ビャン', u'びゃん')),
- u'byd': (None, (u'ビェン', u'びぇん')),
- u'byh': (None, (u'ビュウ', u'びゅう')),
- u'byj': (None, (u'ビュン', u'びゅん')),
- u'byl': (None, (u'ビョン', u'びょん')),
- u'byn': (None, (u'ビャン', u'びゃん')),
- u'byp': (None, (u'ビョウ', u'びょう')),
- u'byq': (None, (u'ビャイ', u'びゃい')),
- u'byw': (None, (u'ビェイ', u'びぇい')),
- u'byz': (None, (u'ビャン', u'びゃん')),
- u'ggz': (None, (u'ギャン', u'ぎゃん')),
- u'ggn': (None, (u'ギャン', u'ぎゃん')),
- u'ggj': (None, (u'ギュン', u'ぎゅん')),
- u'ggd': (None, (u'ギェン', u'ぎぇん')),
- u'ggl': (None, (u'ギョン', u'ぎょん')),
- u'ggq': (None, (u'ギャイ', u'ぎゃい')),
- u'ggh': (None, (u'ギュウ', u'ぎゅう')),
- u'ggw': (None, (u'ギェイ', u'ぎぇい')),
- u'ggp': (None, (u'ギョウ', u'ぎょう')),
- u'gyd': (None, (u'ギェン', u'ぎぇん')),
- u'gyh': (None, (u'ギュウ', u'ぎゅう')),
- u'gyj': (None, (u'ギュン', u'ぎゅん')),
- u'gyl': (None, (u'ギョン', u'ぎょん')),
- u'gyn': (None, (u'ギャン', u'ぎゃん')),
- u'gyp': (None, (u'ギョウ', u'ぎょう')),
- u'gyq': (None, (u'ギャイ', u'ぎゃい')),
- u'gyw': (None, (u'ギェイ', u'ぎぇい')),
- u'gyz': (None, (u'ギャン', u'ぎゃん')),
- u'hgd': (None, (u'ヒェン', u'ひぇん')),
- u'hgh': (None, (u'ヒュウ', u'ひゅう')),
- u'hgj': (None, (u'ヒュン', u'ひゅん')),
- u'hgl': (None, (u'ヒョン', u'ひょん')),
- u'hgn': (None, (u'ヒャン', u'ひゃん')),
- u'hgp': (None, (u'ヒョウ', u'ひょう')),
- u'hgq': (None, (u'ヒャイ', u'ひゃい')),
- u'hgw': (None, (u'ヒェイ', u'ひぇい')),
- u'hgz': (None, (u'ヒャン', u'ひゃん')),
- u'hyd': (None, (u'ヒェン', u'ひぇん')),
- u'hyh': (None, (u'ヒュウ', u'ひゅう')),
- u'hyj': (None, (u'ヒュン', u'ひゅん')),
- u'hyl': (None, (u'ヒョン', u'ひょん')),
- u'hyn': (None, (u'ヒャン', u'ひゃん')),
- u'hyp': (None, (u'ヒョウ', u'ひょう')),
- u'hyq': (None, (u'ヒャイ', u'ひゃい')),
- u'hyw': (None, (u'ヒェイ', u'ひぇい')),
- u'hyz': (None, (u'ヒャン', u'ひゃん')),
- u'kgd': (None, (u'キェン', u'きぇん')),
- u'kgh': (None, (u'キュウ', u'きゅう')),
- u'kgj': (None, (u'キュン', u'きゅん')),
- u'kgl': (None, (u'キョン', u'きょん')),
- u'kgn': (None, (u'キャン', u'きゃん')),
- u'kgp': (None, (u'キョウ', u'きょう')),
- u'kgq': (None, (u'キャイ', u'きゃい')),
- u'kgw': (None, (u'キェイ', u'きぇい')),
- u'kgz': (None, (u'キャン', u'きゃん')),
- u'kyd': (None, (u'キェン', u'きぇん')),
- u'kyh': (None, (u'キュウ', u'きゅう')),
- u'kyj': (None, (u'キュン', u'きゅん')),
- u'kyl': (None, (u'キョン', u'きょん')),
- u'kyn': (None, (u'キャン', u'きゃん')),
- u'kyp': (None, (u'キョウ', u'きょう')),
- u'kyq': (None, (u'キャイ', u'きゃい')),
- u'kyw': (None, (u'キェイ', u'きぇい')),
- u'kyz': (None, (u'キャン', u'きゃん')),
- u'mgd': (None, (u'ミェン', u'みぇん')),
- u'mgh': (None, (u'ミュウ', u'みゅう')),
- u'mgj': (None, (u'ミュン', u'みゅん')),
- u'mgl': (None, (u'ミョン', u'みょん')),
- u'mgn': (None, (u'ミャン', u'みゃん')),
- u'mgp': (None, (u'ミョウ', u'みょう')),
- u'mgq': (None, (u'ミャイ', u'みゃい')),
- u'mgw': (None, (u'ミェイ', u'みぇい')),
- u'mgz': (None, (u'ミャン', u'みゃん')),
- u'myd': (None, (u'ミェン', u'みぇん')),
- u'myh': (None, (u'ミュウ', u'みゅう')),
- u'myj': (None, (u'ミュン', u'みゅん')),
- u'myl': (None, (u'ミョン', u'みょん')),
- u'myn': (None, (u'ミャン', u'みゃん')),
- u'myp': (None, (u'ミョウ', u'みょう')),
- u'myq': (None, (u'ミャイ', u'みゃい')),
- u'myw': (None, (u'ミェイ', u'みぇい')),
- u'myz': (None, (u'ミャン', u'みゃん')),
- u'jya': (None, (u'ジャ', u'じゃ')),
- u'jye': (None, (u'ジェ', u'じぇ')),
- u'jyi': (None, (u'ジィ', u'じぃ')),
- u'jyo': (None, (u'ジョ', u'じょ')),
- u'jyu': (None, (u'ジュ', u'じゅ')),
- u'kga': (None, (u'キャ', u'きゃ')),
- u'kge': (None, (u'キェ', u'きぇ')),
- u'kgo': (None, (u'キョ', u'きょ')),
- u'kgu': (None, (u'キュ', u'きゅ')),
- u'mga': (None, (u'ミャ', u'みゃ')),
- u'mge': (None, (u'ミェ', u'みぇ')),
- u'mgo': (None, (u'ミョ', u'みょ')),
- u'mgu': (None, (u'ミュ', u'みゅ')),
- u'nga': (None, (u'ニャ', u'にゃ')),
- u'nge': (None, (u'ニェ', u'にぇ')),
- u'ngo': (None, (u'ニョ', u'にょ')),
- u'ngu': (None, (u'ニュ', u'にゅ')),
- u'pga': (None, (u'ピャ', u'ぴゃ')),
- u'pge': (None, (u'ピェ', u'ぴぇ')),
- u'pgo': (None, (u'ピョ', u'ぴょ')),
- u'pgu': (None, (u'ピュ', u'ぴゅ')),
- u'rga': (None, (u'リャ', u'りゃ')),
- u'rge': (None, (u'リェ', u'りぇ')),
- u'rgo': (None, (u'リョ', u'りょ')),
- u'rgu': (None, (u'リュ', u'りゅ')),
- u'bd': (None, (u'ベン', u'べん')),
- u'bh': (None, (u'ブウ', u'ぶう')),
- u'bj': (None, (u'ブン', u'ぶん')),
- u'bk': (None, (u'ビン', u'びん')),
- u'bl': (None, (u'ボン', u'ぼん')),
- u'bn': (None, (u'バン', u'ばん')),
- u'bp': (None, (u'ボウ', u'ぼう')),
- u'bq': (None, (u'バイ', u'ばい')),
- u'bt': (None, (u'ビト', u'びと')),
- u'bw': (None, (u'ベイ', u'べい')),
- u'bz': (None, (u'バン', u'ばん')),
- u'ca': (None, (u'チャ', u'ちゃ')),
- u'ce': (None, (u'チェ', u'ちぇ')),
- u'co': (None, (u'チョ', u'ちょ')),
- u'cu': (None, (u'チュ', u'ちゅ')),
- u'dd': (None, (u'デン', u'でん')),
- u'dh': (None, (u'ヅウ', u'づう')),
- u'dj': (None, (u'ヅン', u'づん')),
- u'dk': (None, (u'ヂン', u'ぢん')),
- u'dl': (None, (u'ドン', u'どん')),
- u'dm': (None, (u'デモ', u'でも')),
- u'dn': (None, (u'ダン', u'だん')),
- u'dp': (None, (u'ドウ', u'どう')),
- u'dq': (None, (u'ダイ', u'だい')),
- u'ds': (None, (u'デス', u'です')),
- u'dt': (None, (u'ダチ', u'だち')),
- u'dw': (None, (u'デイ', u'でい')),
- u'dz': (None, (u'ダン', u'だん')),
- u'fh': (None, (u'フウ', u'ふう')),
- u'fj': (None, (u'フン', u'ふん')),
- u'gd': (None, (u'ゲン', u'げん')),
- u'gh': (None, (u'グウ', u'ぐう')),
- u'gj': (None, (u'グン', u'ぐん')),
- u'gk': (None, (u'ギン', u'ぎん')),
- u'gl': (None, (u'ゴン', u'ごん')),
- u'gn': (None, (u'ガン', u'がん')),
- u'gp': (None, (u'ゴウ', u'ごう')),
- u'gq': (None, (u'ガイ', u'がい')),
- u'gr': (None, (u'ガラ', u'がら')),
- u'gt': (None, (u'ゴト', u'ごと')),
- u'gw': (None, (u'ゲイ', u'げい')),
- u'gz': (None, (u'ガン', u'がん')),
- u'hd': (None, (u'ヘン', u'へん')),
- u'hh': (None, (u'フウ', u'ふう')),
- u'hj': (None, (u'フン', u'ふん')),
- u'hk': (None, (u'ヒン', u'ひん')),
- u'hl': (None, (u'ホン', u'ほん')),
- u'hn': (None, (u'ハン', u'はん')),
- u'hp': (None, (u'ホウ', u'ほう')),
- u'hq': (None, (u'ハイ', u'はい')),
- u'ht': (None, (u'ヒト', u'ひと')),
- u'hw': (None, (u'ヘイ', u'へい')),
- u'hz': (None, (u'ハン', u'はん')),
- u'jf': (None, (u'ジュ', u'じゅ')),
- u'jk': (None, (u'ジン', u'じん')),
- u'kd': (None, (u'ケン', u'けん')),
- u'kh': (None, (u'クウ', u'くう')),
- u'kj': (None, (u'クン', u'くん')),
- u'kk': (None, (u'キン', u'きん')),
- u'kl': (None, (u'コン', u'こん')),
- u'km': (None, (u'カモ', u'かも')),
- u'kn': (None, (u'カン', u'かん')),
- u'kp': (None, (u'コウ', u'こう')),
- u'kq': (None, (u'カイ', u'かい')),
- u'kr': (None, (u'カラ', u'から')),
- u'kt': (None, (u'コト', u'こと')),
- u'kw': (None, (u'ケイ', u'けい')),
- u'kz': (None, (u'カン', u'かん')),
- u'md': (None, (u'メン', u'めん')),
- u'mh': (None, (u'ムウ', u'むう')),
- u'mj': (None, (u'ムン', u'むん')),
- u'mk': (None, (u'ミン', u'みん')),
- u'ml': (None, (u'モン', u'もん')),
- u'mn': (None, (u'モノ', u'もの')),
- u'mp': (None, (u'モウ', u'もう')),
- u'mq': (None, (u'マイ', u'まい')),
- u'ms': (None, (u'マス', u'ます')),
- u'mt': (None, (u'マタ', u'また')),
- u'mw': (None, (u'メイ', u'めい')),
- u'mz': (None, (u'マン', u'まん')),
- u'nb': (None, (u'ネバ', u'ねば')),
- u'nd': (None, (u'ネン', u'ねん')),
- u'nh': (None, (u'ヌウ', u'ぬう')),
- u'nj': (None, (u'ヌン', u'ぬん')),
- u'nk': (None, (u'ニン', u'にん')),
- u'nl': (None, (u'ノン', u'のん')),
- u'np': (None, (u'ノウ', u'のう')),
- u'nq': (None, (u'ナイ', u'ない')),
- u'nr': (None, (u'ナル', u'なる')),
- u'nt': (None, (u'ニチ', u'にち')),
- u'nw': (None, (u'ネイ', u'ねい')),
- u'nz': (None, (u'ナン', u'なん')),
- u'pd': (None, (u'ペン', u'ぺん')),
- u'ph': (None, (u'プウ', u'ぷう')),
- u'pj': (None, (u'プン', u'ぷん')),
- u'pk': (None, (u'ピン', u'ぴん')),
- u'pl': (None, (u'ポン', u'ぽん')),
- u'pn': (None, (u'パン', u'ぱん')),
- u'pp': (None, (u'ポウ', u'ぽう')),
- u'pq': (None, (u'パイ', u'ぱい')),
- u'pw': (None, (u'ペイ', u'ぺい')),
- u'pz': (None, (u'パン', u'ぱん')),
- u'rd': (None, (u'レン', u'れん')),
- u'rh': (None, (u'ルウ', u'るう')),
- u'rj': (None, (u'ルン', u'るん')),
- u'rk': (None, (u'リン', u'りん')),
- u'rl': (None, (u'ロン', u'ろん')),
- u'rn': (None, (u'ラン', u'らん')),
- u'rp': (None, (u'ロウ', u'ろう')),
- u'rq': (None, (u'ライ', u'らい')),
- u'rr': (None, (u'ラレ', u'られ')),
- u'rw': (None, (u'レイ', u'れい')),
- u'rz': (None, (u'ラン', u'らん')),
- u'sd': (None, (u'セン', u'せん')),
- u'sf': (None, (u'サイ', u'さい')),
- u'sh': (None, (u'スウ', u'すう')),
- u'sj': (None, (u'スン', u'すん')),
- u'sk': (None, (u'シン', u'しん')),
- u'sl': (None, (u'ソン', u'そん')),
- u'sn': (None, (u'サン', u'さん')),
- u'sp': (None, (u'ソウ', u'そう')),
- u'sq': (None, (u'サイ', u'さい')),
- u'sr': (None, (u'スル', u'する')),
- u'ss': (None, (u'セイ', u'せい')),
- u'st': (None, (u'シタ', u'した')),
- u'sw': (None, (u'セイ', u'せい')),
- u'sz': (None, (u'サン', u'さん')),
- u'tb': (None, (u'タビ', u'たび')),
- u'td': (None, (u'テン', u'てん')),
- u'th': (None, (u'ツウ', u'つう')),
- u'tj': (None, (u'ツン', u'つん')),
- u'tk': (None, (u'チン', u'ちん')),
- u'tl': (None, (u'トン', u'とん')),
- u'tm': (None, (u'タメ', u'ため')),
- u'tn': (None, (u'タン', u'たん')),
- u'tp': (None, (u'トウ', u'とう')),
- u'tq': (None, (u'タイ', u'たい')),
- u'tr': (None, (u'タラ', u'たら')),
- u'tw': (None, (u'テイ', u'てい')),
- u'tz': (None, (u'タン', u'たん')),
- u'wn': (None, (u'ワン', u'わん')),
- u'wq': (None, (u'ワイ', u'わい')),
- u'wr': (None, (u'ワレ', u'われ')),
- u'wt': (None, (u'ワタ', u'わた')),
- u'wz': (None, (u'ワン', u'わん')),
- u'xa': (None, (u'シャ', u'しゃ')),
- u'xe': (None, (u'シェ', u'しぇ')),
- u'xo': (None, (u'ショ', u'しょ')),
- u'xu': (None, (u'シュ', u'しゅ')),
- u'ye': (None, (u'イェ', u'いぇ')),
- u'yh': (None, (u'ユウ', u'ゆう')),
- u'yj': (None, (u'ユン', u'ゆん')),
- u'yl': (None, (u'ヨン', u'よん')),
- u'yn': (None, (u'ヤン', u'やん')),
- u'yp': (None, (u'ヨウ', u'よう')),
- u'yq': (None, (u'ヤイ', u'やい')),
- u'yr': (None, (u'ヨル', u'よる')),
- u'yz': (None, (u'ヤン', u'やん')),
- u'zd': (None, (u'ゼン', u'ぜん')),
- u'zh': (None, (u'ズウ', u'ずう')),
- u'zj': (None, (u'ズン', u'ずん')),
- u'zk': (None, (u'ジン', u'じん')),
- u'zl': (None, (u'ゾン', u'ぞん')),
- u'zn': (None, (u'ザン', u'ざん')),
- u'zp': (None, (u'ゾウ', u'ぞう')),
- u'zq': (None, (u'ザイ', u'ざい')),
- u'zr': (None, (u'ザル', u'ざる')),
- u'zv': (None, (u'ザイ', u'ざい')),
- u'zw': (None, (u'ゼイ', u'ぜい')),
- u'zx': (None, (u'ゼイ', u'ぜい')),
- u'zz': (None, (u'ザン', u'ざん')),
- u'ngd': (None, (u'ニェン', u'にぇん')),
- u'ngh': (None, (u'ニュウ', u'にゅう')),
- u'ngj': (None, (u'ニュン', u'にゅん')),
- u'ngl': (None, (u'ニョン', u'にょん')),
- u'ngn': (None, (u'ニャン', u'にゃん')),
- u'ngp': (None, (u'ニョウ', u'にょう')),
- u'ngq': (None, (u'ニャイ', u'にゃい')),
- u'ngw': (None, (u'ニェイ', u'にぇい')),
- u'ngz': (None, (u'ニャン', u'にゃん')),
- u'nyd': (None, (u'ニェン', u'にぇん')),
- u'nyh': (None, (u'ニュウ', u'にゅう')),
- u'nyj': (None, (u'ニュン', u'にゅん')),
- u'nyl': (None, (u'ニョン', u'にょん')),
- u'nyn': (None, (u'ニャン', u'にゃん')),
- u'nyp': (None, (u'ニョウ', u'にょう')),
- u'nyq': (None, (u'ニャイ', u'にゃい')),
- u'nyw': (None, (u'ニェイ', u'にぇい')),
- u'nyz': (None, (u'ニャン', u'にゃん')),
- u'pgd': (None, (u'ピェン', u'ぴぇん')),
- u'pgh': (None, (u'ピュウ', u'ぴゅう')),
- u'pgj': (None, (u'ピュン', u'ぴゅん')),
- u'pgl': (None, (u'ピョン', u'ぴょん')),
- u'pgn': (None, (u'ピャン', u'ぴゃん')),
- u'pgp': (None, (u'ピョウ', u'ぴょう')),
- u'pgq': (None, (u'ピャイ', u'ぴゃい')),
- u'pgw': (None, (u'ピェイ', u'ぴぇい')),
- u'pgz': (None, (u'ピャン', u'ぴゃん')),
- u'pyd': (None, (u'ピェン', u'ぴぇん')),
- u'pyh': (None, (u'ピュウ', u'ぴゅう')),
- u'pyj': (None, (u'ピュン', u'ぴゅん')),
- u'pyl': (None, (u'ピョン', u'ぴょん')),
- u'pyn': (None, (u'ピャン', u'ぴゃん')),
- u'pyp': (None, (u'ピョウ', u'ぴょう')),
- u'pyq': (None, (u'ピャイ', u'ぴゃい')),
- u'pyw': (None, (u'ピェイ', u'ぴぇい')),
- u'pyz': (None, (u'ピャン', u'ぴゃん')),
- u'rgd': (None, (u'リェン', u'りぇん')),
- u'rgh': (None, (u'リュウ', u'りゅう')),
- u'rgj': (None, (u'リュン', u'りゅん')),
- u'rgl': (None, (u'リョン', u'りょん')),
- u'rgn': (None, (u'リャン', u'りゃん')),
- u'rgp': (None, (u'リョウ', u'りょう')),
- u'rgq': (None, (u'リャイ', u'りゃい')),
- u'rgw': (None, (u'リェイ', u'りぇい')),
- u'rgz': (None, (u'リャン', u'りゃん')),
- u'ryd': (None, (u'リェン', u'りぇん')),
- u'ryh': (None, (u'リュウ', u'りゅう')),
- u'ryj': (None, (u'リュン', u'りゅん')),
- u'ryl': (None, (u'リョン', u'りょん')),
- u'ryn': (None, (u'リャン', u'りゃん')),
- u'ryp': (None, (u'リョウ', u'りょう')),
- u'ryq': (None, (u'リャイ', u'りゃい')),
- u'ryw': (None, (u'リェイ', u'りぇい')),
- u'ryz': (None, (u'リャン', u'りゃん')),
- u'syd': (None, (u'シェン', u'しぇん')),
- u'syh': (None, (u'シュウ', u'しゅう')),
- u'syj': (None, (u'シュン', u'しゅん')),
- u'syl': (None, (u'ション', u'しょん')),
- u'syn': (None, (u'シャン', u'しゃん')),
- u'syp': (None, (u'ショウ', u'しょう')),
- u'syq': (None, (u'シャイ', u'しゃい')),
- u'syw': (None, (u'シェイ', u'しぇい')),
- u'syz': (None, (u'シャン', u'しゃん')),
- u'tgi': (None, (u'ティ', u'てぃ')),
- u'tgu': (None, (u'トゥ', u'とぅ')),
- u'tsa': (None, (u'ツァ', u'つぁ')),
- u'tse': (None, (u'ツェ', u'つぇ')),
- u'tsi': (None, (u'ツィ', u'つぃ')),
- u'tso': (None, (u'ツォ', u'つぉ')),
- u'wso': (None, (u'ウォ', u'うぉ')),
- u'zga': (None, (u'ジャ', u'じゃ')),
- u'zge': (None, (u'ジェ', u'じぇ')),
- u'zgo': (None, (u'ジョ', u'じょ')),
- u'zgu': (None, (u'ジュ', u'じゅ')),
- u'cd': (None, (u'チェン', u'ちぇん')),
- u'ch': (None, (u'チュウ', u'ちゅう')),
- u'cj': (None, (u'チュン', u'ちゅん')),
- u'cl': (None, (u'チョン', u'ちょん')),
- u'cn': (None, (u'チャン', u'ちゃん')),
- u'cp': (None, (u'チョウ', u'ちょう')),
- u'cq': (None, (u'チャイ', u'ちゃい')),
- u'cw': (None, (u'チェイ', u'ちぇい')),
- u'cz': (None, (u'チャン', u'ちゃん')),
- u'fd': (None, (u'フェン', u'ふぇん')),
- u'fk': (None, (u'フィン', u'ふぃん')),
- u'fl': (None, (u'フォン', u'ふぉん')),
- u'fn': (None, (u'ファン', u'ふぁん')),
- u'fp': (None, (u'フォー', u'ふぉー')),
- u'fq': (None, (u'ファイ', u'ふぁい')),
- u'fw': (None, (u'フェイ', u'ふぇい')),
- u'fz': (None, (u'ファン', u'ふぁん')),
- u'jd': (None, (u'ジェン', u'じぇん')),
- u'jh': (None, (u'ジュウ', u'じゅう')),
- u'jj': (None, (u'ジュン', u'じゅん')),
- u'jl': (None, (u'ジョン', u'じょん')),
- u'jn': (None, (u'ジャン', u'じゃん')),
- u'jp': (None, (u'ジョウ', u'じょう')),
- u'jq': (None, (u'ジャイ', u'じゃい')),
- u'jw': (None, (u'ジェイ', u'じぇい')),
- u'jz': (None, (u'ジャン', u'じゃん')),
- u'wd': (None, (u'ウェン', u'うぇん')),
- u'wk': (None, (u'ウィン', u'うぃん')),
- u'wl': (None, (u'ウォン', u'うぉん')),
- u'wp': (None, (u'ウォー', u'うぉー')),
- u'xd': (None, (u'シェン', u'しぇん')),
- u'xh': (None, (u'シュウ', u'しゅう')),
- u'xj': (None, (u'シュン', u'しゅん')),
- u'xl': (None, (u'ション', u'しょん')),
- u'xn': (None, (u'シャン', u'しゃん')),
- u'xp': (None, (u'ショウ', u'しょう')),
- u'xq': (None, (u'シャイ', u'しゃい')),
- u'xw': (None, (u'シェイ', u'しぇい')),
- u'xz': (None, (u'シャン', u'しゃん')),
- u'yw': (None, (u'イェイ', u'いぇい')),
- u'tyd': (None, (u'チェン', u'ちぇん')),
- u'tyh': (None, (u'チュウ', u'ちゅう')),
- u'tyj': (None, (u'チュン', u'ちゅん')),
- u'tyl': (None, (u'チョン', u'ちょん')),
- u'tyn': (None, (u'チャン', u'ちゃん')),
- u'typ': (None, (u'チョウ', u'ちょう')),
- u'tyq': (None, (u'チャイ', u'ちゃい')),
- u'tyw': (None, (u'チェイ', u'ちぇい')),
- u'tyz': (None, (u'チャン', u'ちゃん')),
- u'zgd': (None, (u'ジェン', u'じぇん')),
- u'zgh': (None, (u'ジュウ', u'じゅう')),
- u'zgj': (None, (u'ジュン', u'じゅん')),
- u'zgl': (None, (u'ジョン', u'じょん')),
- u'zgn': (None, (u'ジャン', u'じゃん')),
- u'zgp': (None, (u'ジョウ', u'じょう')),
- u'zgq': (None, (u'ジャイ', u'じゃい')),
- u'zgw': (None, (u'ジェイ', u'じぇい')),
- u'zgz': (None, (u'ジャン', u'じゃん')),
- u'zyd': (None, (u'ジェン', u'じぇん')),
- u'zyh': (None, (u'ジュウ', u'じゅう')),
- u'zyj': (None, (u'ジュン', u'じゅん')),
- u'zyl': (None, (u'ジョン', u'じょん')),
- u'zyn': (None, (u'ジャン', u'じゃん')),
- u'zyp': (None, (u'ジョウ', u'じょう')),
- u'zyq': (None, (u'ジャイ', u'じゃい')),
- u'zyw': (None, (u'ジェイ', u'じぇい')),
- u'zyz': (None, (u'ジャン', u'じゃん')),
- u'x-': (None, u'-'),
- u'x;': (None, u';'),
- u'x:': (None, u':'),
- u'x_': (None, u' '),
- u'x,': (None, u','),
- u'x.': (None, u'.'),
- u'x[': (None, u'['),
- u'x]': (None, u']'),
- u'x~': (None, u'~'),
- u'yf': (None, (u'', u'')),
- u'zc': (None, (u'', u'')),
- u'zf': (None, (u'', u'')),
- u'sg': (None, u''),
- u'sx': (None, u''),
- u'sc': (None, u''),
- u'sv': (None, u''),
- u'sb': (None, u''),
- u'sm': (None, u''),
- u'dr': (None, u''),
- u'dg': (None, u''),
- u'dx': (None, u''),
- u'dv': (None, u''),
- u'db': (None, u''),
- u'fr': (None, u''),
- u'ft': (None, u''),
- u'fs': (None, u''),
- u'fg': (None, u''),
- u'fx': (None, u''),
- u'fc': (None, u''),
- u'fv': (None, u''),
- u'fb': (None, u''),
- u'gs': (None, u''),
- u'gf': (None, u''),
- u'gx': (None, u''),
- u'gc': (None, u''),
- u'gv': (None, u''),
- u'gb': (None, u''),
- u'hr': (None, u''),
- u'hs': (None, u''),
- u'hf': (None, u''),
- u'hx': (None, u''),
- u'hc': (None, u''),
- u'hv': (None, u''),
- u'hb': (None, u''),
- u'jr': (None, u''),
- u'jt': (None, u'使'),
- u'jg': (None, u''),
- u'jx': (None, u''),
- u'jc': (None, u''),
- u'jv': (None, u''),
- u'jb': (None, u''),
- u'kx': (None, u''),
- u'kc': (None, u''),
- u'kv': (None, u''),
- u'kb': (None, u''),
- u'rt': (None, u''),
- u'tf': (None, u''),
- u'vf': (None, u''),
- u'vz': (None, u''),
- }
View
105 engine/main.py
@@ -1,105 +0,0 @@
-# vim:set et sts=4 sw=4:
-# -*- coding: utf-8 -*-
-#
-# ibus-skk - The SKK engine for IBus
-#
-# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-import os
-import sys
-import getopt
-import ibus
-import factory
-import gobject
-import locale
-
-class IMApp:
- def __init__(self, exec_by_ibus):
- self.__component = ibus.Component("org.freedesktop.IBus.SKK",
- "SKK Component",
- "0.0.0",
- "GPL",
- "Daiki Ueno <ueno@unixuser.org>")
- self.__component.add_engine("skk",
- "skk",
- "Japanese SKK",
- "ja",
- "GPL",
- "Daiki Ueno <ueno@unixuser.org>",
- "",
- "en")
- self.__mainloop = gobject.MainLoop()
- self.__bus = ibus.Bus()
- self.__bus.connect("disconnected", self.__bus_disconnected_cb)
- self.__factory = factory.EngineFactory(self.__bus)
- if exec_by_ibus:
- self.__bus.request_name("org.freedesktop.IBus.SKK", 0)
- else:
- self.__bus.register_component(self.__component)
-
- def run(self):
- self.__mainloop.run()
-
- def __bus_disconnected_cb(self, bus):
- self.__mainloop.quit()
-
-
-def launch_engine(exec_by_ibus):
- IMApp(exec_by_ibus).run()
-
-def print_help(out, v = 0):
- print >> out, "-i, --ibus executed by ibus."
- print >> out, "-h, --help show this message."
- print >> out, "-d, --daemonize daemonize ibus"
- sys.exit(v)
-
-def main():
- try:
- locale.setlocale(locale.LC_ALL, "")
- except:
- pass
-
- exec_by_ibus = False
- daemonize = False
-
- shortopt = "ihd"
- longopt = ["ibus", "help", "daemonize"]
-
- try:
- opts, args = getopt.getopt(sys.argv[1:], shortopt, longopt)
- except getopt.GetoptError, err:
- print_help(sys.stderr, 1)
-
- for o, a in opts:
- if o in ("-h", "--help"):
- print_help(sys.stdout)
- elif o in ("-d", "--daemonize"):
- daemonize = True
- elif o in ("-i", "--ibus"):
- exec_by_ibus = True
- else:
- print >> sys.stderr, "Unknown argument: %s" % o
- print_help(sys.stderr, 1)
-
- if daemonize:
- if os.fork():
- sys.exit()
-
- launch_engine(exec_by_ibus)
-
-if __name__ == "__main__":
- main()
View
217 engine/nicola.py
@@ -1,217 +0,0 @@
-# vim:set et sts=4 sw=4:
-# -*- coding: utf-8 -*-
-#
-# ibus-skk - The SKK engine for IBus
-#
-# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-NICOLA_RULE = {
- 'q': [u'', u'', u''],
- 'w': [u'', u'', u''],
- 'e': [u'', u'', u''],
- 'r': [u'', u'', u''],
- 't': [u'', u'', u''],
-
- 'y': [u'', u'', u''],
- 'u': [u'', u'', u''],
- 'i': [u'', u'', u''],
- 'o': [u'', u'', u''],
- 'p': [u'', u'', u''],
- '@': [u'', u'', u''],
- '[': [u'', u'', u''],
-
- 'a': [u'', u'', u''],
- 's': [u'', u'', u''],
- 'd': [u'', u'', u''],
- 'f': [u'', u'', u''],
- 'g': [u'', u'', u''],
-
- 'h': [u'', u'', u''],
- 'j': [u'', u'', u''],
- 'k': [u'', u'', u''],
- 'l': [u'', u'', u''],
- ';': [u'', u'', u''],
-
- 'z': [u'', u'', u''],
- 'x': [u'', u'', u''],
- 'c': [u'', u'', u''],
- 'v': [u'', u'', u''],
- 'b': [u'', u'', u''],
-
- 'n': [u'', u'', u''],
- 'm': [u'', u'', u''],
- ',': [u'', u'', u''],
- '.': [u'', u'', u''],
- '/': [u'', u'', u''],
-
- '1': [u'1', u'', u''],
- '2': [u'2', u'', u''],
- '4': [u'4', u'', u''],
- '5': [u'5', u'', u''],
-
- '6': [u'6', u'', u''],
- '7': [u'7', u'', u''],
- '8': [u'8', u'', u''],
- '9': [u'9', u'', u''],
- '\\': [u'', u'', u''],
-}
-
-class Event(object):
- def __init__(self, key, time):
- self.__key = key
- self.__time = time
-
- key = property(lambda self: self.__key)
- time = property(lambda self: self.__time)
-
-class Result(object):
- def __init__(self, output, wait):
- self.__output = output
- self.__wait = wait
-
- output = property(lambda self: self.__output)
- wait = property(lambda self: self.__wait)
-
-LSHIFT, RSHIFT = range(2)
-
-def is_shift(event):
- return event.key in ('lshift', 'rshift')
-
-def get_shift(event):
- return ('lshift', 'rshift').index(event.key)
-
-def format_double(a, b):
- if is_shift(a) and is_shift(b):
- return u'[LR]'
- elif is_shift(a):
- return a.key + u'+' + b.key
- elif is_shift(b):
- return b.key + u'+' + a.key
- keys = u''.join(sorted((a.key, b.key)))
- return u'[' + keys + u']'
-
-def decompose_double(double):
- if not double.startswith(u'[') or not double.endswith(u']'):
- return list(double)
- return [c for c in double[1:-1] if c.islower()]
-
-class Nicola(object):
- def __init__(self, time_func, timeout=0.1, overlap=0.05, maxwait=10,
- special_doubles=(u'[fj]', u'[gh]', u'[dk]', u'[LR]')):
- self.__time_func = time_func
- assert timeout > overlap
- self.__timeout = timeout
- self.__overlap = overlap
- self.__maxwait = maxwait
- self.__special_doubles = special_doubles
- self.__pending = list()
- self.__rsingle = None
-
- def __make_result(self, output):
- time = self.__time_func()
- self.__pending = [event for event in self.__pending
- if time - event.time <= self.__timeout]
- if len(self.__pending) > 0:
- wait = self.__timeout - (time - self.__pending[-1].time)
- else:
- wait = self.__maxwait
- return Result(output, wait)
-
- def peek(self):
- return self.__rsingle or len(self.__pending) > 0
-
- def queue(self, key):
- time = self.__time_func()
- # press/release a same key
- if key.startswith(u'release+'):
- letter = key[len(u'release+'):]
- if len(self.__pending) > 0 and self.__pending[0].key == letter:
- self.__rsingle = self.__make_result((letter,))
- del self.__pending[0:]
- # ignore key repeat
- elif len(self.__pending) > 0 and self.__pending[0].key == key:
- self.__pending[0] = Event(key, time)
- self.__rsingle = self.__make_result((key,))
- else:
- self.__pending.insert(0, Event(key, time))
-
- def __dispatch_single(self):
- time = self.__time_func()
- a = self.__pending[0]
- if time - a.time > self.__timeout:
- del self.__pending[0:]
- return self.__make_result((a.key,))
- return self.__make_result(tuple())
-
- def dispatch(self):
- if self.__rsingle:
- result = self.__rsingle
- self.__rsingle = None
- return result