summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHideaki ABE <abe.sendai@gmail.com>2009-06-03 10:25:06 +0900
committerHideaki ABE <abe.sendai@gmail.com>2009-06-03 10:25:06 +0900
commit0a4f6d6914521e33d27bfe47880bad52698a682d (patch)
treecd15bd6443c959640838062bbc6b75a31b85d6a4
parent0afbf6500ca414ed4a2242fcf7607a1f8d840f97 (diff)
parent24f6a22f403f0dd446cdc3e2e1ba938e60e0cda2 (diff)
downloadibus-anthy-0a4f6d6914521e33d27bfe47880bad52698a682d.tar.gz
Merge branch 'test'
-rw-r--r--engine/engine.py3
-rw-r--r--engine/romaji.py15
-rw-r--r--engine/tables.py2
3 files changed, 15 insertions, 5 deletions
diff --git a/engine/engine.py b/engine/engine.py
index 6ccbabf..ebe5f46 100644
--- a/engine/engine.py
+++ b/engine/engine.py
@@ -967,6 +967,9 @@ class Engine(ibus.EngineBase):
if (keysyms.exclam <= keyval <= keysyms.asciitilde or
keyval == keysyms.yen):
+ if (keyval == keysyms._0 and state == modifier.SHIFT_MASK and
+ self.__typing_mode == jastring.TYPING_MODE_KANA):
+ keyval = keysyms.asciitilde
ret = self.__on_key_common(keyval)
if (unichr(keyval) in u',.' and
self.__prefs.get_value('common', 'behivior_on_period')):
diff --git a/engine/romaji.py b/engine/romaji.py
index 34a1dde..80010cd 100644
--- a/engine/romaji.py
+++ b/engine/romaji.py
@@ -23,6 +23,9 @@ from ibus import unichar_half_to_full
from tables import *
import segment
+def romaji_correction_rule_get(k, d):
+ return (u'ん', k[1:2]) if k[0:1] == u'n' and not k[1:2] in u"aiueony'" else d
+
class RomajiSegment(segment.Segment):
def __init__(self, enchars=u"", jachars=u""):
if not jachars:
@@ -56,7 +59,8 @@ class RomajiSegment(segment.Segment):
self._jachars = jachars
return [RomajiSegment(c)]
- jachars, c = romaji_correction_rule.get(text, (None, None))
+# jachars, c = romaji_correction_rule.get(text, (None, None))
+ jachars, c = romaji_correction_rule_get(text, (None, None))
if jachars:
self._enchars = text[0]
self._jachars = jachars
@@ -81,7 +85,8 @@ class RomajiSegment(segment.Segment):
return [jasegment, RomajiSegment(c)]
return [jasegment]
- jachars, c = romaji_correction_rule.get(enchars, (None, None))
+# jachars, c = romaji_correction_rule.get(enchars, (None, None))
+ jachars, c = romaji_correction_rule_get(enchars, (None, None))
if jachars:
jasegment = RomajiSegment(enchars[:-len(c)], jachars)
self._enchars = text[:i]
@@ -113,7 +118,8 @@ class RomajiSegment(segment.Segment):
self._enchars = c
return [RomajiSegment(text[0], jachars)]
- jachars, c = romaji_correction_rule.get(text, (None, None))
+# jachars, c = romaji_correction_rule.get(text, (None, None))
+ jachars, c = romaji_correction_rule_get(text, (None, None))
if jachars:
self._enchars = c
return [RomajiSegment(text[0], jachars)]
@@ -134,7 +140,8 @@ class RomajiSegment(segment.Segment):
self._enchars = c + text[i:]
return [RomajiSegment(enchars[:-len(c)], jachars)]
- jachars, c = romaji_correction_rule.get(enchars, (None, None))
+# jachars, c = romaji_correction_rule.get(enchars, (None, None))
+ jachars, c = romaji_correction_rule_get(enchars, (None, None))
if jachars:
self._enchars = c + text[i:]
return [RomajiSegment(enchars[:-len(c)], jachars)]
diff --git a/engine/tables.py b/engine/tables.py
index 107a4e9..a59306e 100644
--- a/engine/tables.py
+++ b/engine/tables.py
@@ -225,7 +225,7 @@ romaji_typing_rule = {
u"xwa" : u"ゎ",
u"wa" : u"わ",
u"wo" : u"を",
- # u"n'" : u"ん",
+ u"n'" : u"ん",
u"nn" : u"ん",
u"wyi" : u"ゐ",
u"wye" : u"ゑ",