From 2bd29c12b7badc8fb787ddd2bb711ec07750dc71 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Thu, 17 Sep 2009 10:02:20 +0000 Subject: [PATCH] Fix bug 523642 - ibus-anthy convert_to_char_type_{for,back}ward() --- .cvsignore | 2 +- ibus-anthy-HEAD.patch | 215 +----------------------------------------- ibus-anthy.spec | 12 ++- sources | 2 +- 4 files changed, 11 insertions(+), 220 deletions(-) diff --git a/.cvsignore b/.cvsignore index 80a358e..0066ce4 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -ibus-anthy-1.2.0.20090907.tar.gz +ibus-anthy-1.2.0.20090917.tar.gz diff --git a/ibus-anthy-HEAD.patch b/ibus-anthy-HEAD.patch index 242cd57..8b13789 100644 --- a/ibus-anthy-HEAD.patch +++ b/ibus-anthy-HEAD.patch @@ -1,214 +1 @@ -diff -urNp ibus-anthy-1.2.0.20090907-old/ChangeLog ibus-anthy-1.2.0.20090907/ChangeLog ---- ibus-anthy-1.2.0.20090907-old/ChangeLog 2009-09-07 11:41:22.000000000 +0900 -+++ ibus-anthy-1.2.0.20090907/ChangeLog 2009-09-07 23:24:51.000000000 +0900 -@@ -1,3 +1,11 @@ -+commit 4a9511c2691b83fc7f7e02e693e44ff9c80f9c34 -+Author: fujiwarat -+Date: 2009-09-07 23:19:54 +0900 -+ -+ Fix 507 No module named thumb -+ -+M engine/Makefile.am -+ - commit 627a6346eeebea547adb547e6254983cea6bc429 - Author: fujiwarat - Date: 2009-09-07 11:37:46 +0900 -diff -urNp ibus-anthy-1.2.0.20090907-old/engine/Makefile.am ibus-anthy-1.2.0.20090907/engine/Makefile.am ---- ibus-anthy-1.2.0.20090907-old/engine/Makefile.am 2009-09-07 11:40:46.000000000 +0900 -+++ ibus-anthy-1.2.0.20090907/engine/Makefile.am 2009-09-07 23:23:58.000000000 +0900 -@@ -21,12 +21,13 @@ - engine_anthy_PYTHON = \ - engine.py \ - factory.py \ -- main.py \ -- tables.py \ - jastring.py \ -- segment.py \ -- romaji.py \ - kana.py \ -+ main.py \ -+ romaji.py \ -+ segment.py \ -+ tables.py \ -+ thumb.py \ - $(NULL) - engine_anthydir = $(pkgdatadir)/engine - -diff -urNp ibus-anthy-1.2.0.20090907-old/engine/Makefile.in ibus-anthy-1.2.0.20090907/engine/Makefile.in ---- ibus-anthy-1.2.0.20090907-old/engine/Makefile.in 2009-09-07 11:41:04.000000000 +0900 -+++ ibus-anthy-1.2.0.20090907/engine/Makefile.in 2009-09-07 23:24:34.000000000 +0900 -@@ -273,12 +273,13 @@ top_srcdir = @top_srcdir@ - engine_anthy_PYTHON = \ - engine.py \ - factory.py \ -- main.py \ -- tables.py \ - jastring.py \ -- segment.py \ -- romaji.py \ - kana.py \ -+ main.py \ -+ romaji.py \ -+ segment.py \ -+ tables.py \ -+ thumb.py \ - $(NULL) - - engine_anthydir = $(pkgdatadir)/engine -diff -urNp ibus-anthy-1.2.0.20090907-old/engine/thumb.py ibus-anthy-1.2.0.20090907/engine/thumb.py ---- ibus-anthy-1.2.0.20090907-old/engine/thumb.py 1970-01-01 09:00:00.000000000 +0900 -+++ ibus-anthy-1.2.0.20090907/engine/thumb.py 2009-09-07 23:23:58.000000000 +0900 -@@ -0,0 +1,153 @@ -+# -*- coding: utf-8 -*- -+ -+import gtk -+import gobject -+import time -+ -+import segment -+ -+ -+_table = { -+ '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''], -+} -+ -+_shift_table = { -+ 'H': u'ぱ', -+ 'X': u'ぴ', -+ 'V': u'ぷ', -+ 'B': u'ぺ', -+ '>': u'ぽ', -+} -+ -+table = {} -+shift_table = {} -+r_table = {} -+ -+for k in _table.keys(): -+ table[ord(k)] = _table[k] -+ for c in _table[k]: -+ r_table[c] = k -+ -+for k in _shift_table.keys(): -+ shift_table[ord(k)] = _shift_table[k] -+ r_table[_shift_table[k]] = k -+ -+kana_voiced_consonant_rule = { -+ u"か゛" : u"が", -+ u"き゛" : u"ぎ", -+ u"く゛" : u"ぐ", -+ u"け゛" : u"げ", -+ u"こ゛" : u"ご", -+ u"さ゛" : u"ざ", -+ u"し゛" : u"じ", -+ u"す゛" : u"ず", -+ u"せ゛" : u"ぜ", -+ u"そ゛" : u"ぞ", -+ u"た゛" : u"だ", -+ u"ち゛" : u"ぢ", -+ u"つ゛" : u"づ", -+ u"て゛" : u"で", -+ u"と゛" : u"ど", -+ u"は゛" : u"ば", -+ u"ひ゛" : u"び", -+ u"ふ゛" : u"ぶ", -+ u"へ゛" : u"べ", -+ u"ほ゛" : u"ぼ", -+ u"は゜" : u"ぱ", -+ u"ひ゜" : u"ぴ", -+ u"ふ゜" : u"ぷ", -+ u"へ゜" : u"ぺ", -+ u"ほ゜" : u"ぽ", -+} -+ -+_UNFINISHED_HIRAGANA = set(u"かきくけこさしすせそたちつてとはひふへほ") -+ -+class ThumbShiftSegment(segment.Segment): -+ -+ def __init__(self, enchars=u"", jachars=u""): -+ if not jachars: -+ if u'!' <= enchars <= u'~': -+ jachars = segment.unichar_half_to_full(enchars) -+ else: -+ jachars = enchars -+ enchars = r_table.get(jachars, u'') -+ super(ThumbShiftSegment, self).__init__(enchars, jachars) -+ -+ def is_finished(self): -+ return not (self._jachars in _UNFINISHED_HIRAGANA) -+ -+ def append(self, enchar): -+ if enchar == u"\0" or enchar == u"": -+ return [] -+ text = self._jachars + enchar -+ jachars = kana_voiced_consonant_rule.get(text, None) -+ if jachars: -+ self._enchars = self._enchars + r_table.get(enchar, u'') -+ self._jachars = jachars -+ return [] -+ return [ThumbShiftSegment(enchar)] -+ -+ def prepend(self, enchar): -+ if enchar == u"\0" or enchar == u"": -+ return [] -+ if self._jachars == u"": -+ if 0x21 <= enchars <= 0x7e: -+ self._enchars = enchar -+ self._jachars = segment.unichar_half_to_full(enchars) -+ else: -+ self._enchars = r_table.get(enchar, u'') -+ self._jachars = enchar -+ return [] -+ return [ThumbShiftSegment(enchar)] -+ -+ def pop(self, index=-1): -+ self._enchars = u'' -+ self._jachars = u'' -+ return -+ + diff --git a/ibus-anthy.spec b/ibus-anthy.spec index 79b41c4..0ef6710 100644 --- a/ibus-anthy.spec +++ b/ibus-anthy.spec @@ -1,14 +1,14 @@ %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %define require_ibus_version 1.2.0.20090904 Name: ibus-anthy -Version: 1.2.0.20090907 -Release: 2%{?dist} +Version: 1.2.0.20090917 +Release: 1%{?dist} Summary: The Anthy engine for IBus input platform License: GPLv2+ Group: System Environment/Libraries URL: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz -Patch0: ibus-anthy-HEAD.patch +# Patch0: ibus-anthy-HEAD.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -29,7 +29,7 @@ libanthy. %prep %setup -q -%patch0 -p1 +# %patch0 -p1 %build %configure --disable-static @@ -57,6 +57,10 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/ibus/component/* %changelog +* Thu Sep 17 2009 Takao Fujiwara - 1.2.0.20090917-1 +- Update to 1.2.0.20090917 +- Fix bug 523642 - ibus-anthy convert_to_char_type_{for,back}ward() + * Mon Sep 07 2009 Takao Fujiwara - 1.2.0.20090907-2 - Fix a build issue diff --git a/sources b/sources index 764582c..81f4ba1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -29a02d3148f5683981f250807a9c78c6 ibus-anthy-1.2.0.20090907.tar.gz +b6f1d830346e447908d670bc267391a9 ibus-anthy-1.2.0.20090917.tar.gz