OSDN Git Service

work ti33950
authorTakuya Nishimoto <nishimotz@gmail.com>
Sun, 15 Jun 2014 12:49:19 +0000 (21:49 +0900)
committerTakuya Nishimoto <nishimotz@gmail.com>
Sun, 15 Jun 2014 12:49:19 +0000 (21:49 +0900)
jptools/harness.py
source/synthDrivers/jtalk/translator2.py

index d49e643..69479dc 100644 (file)
@@ -590,6 +590,13 @@ tests = [
                'comment': 'braille code (with space) should not be changed.',\r
                },\r
        {\r
+               'text': '⠒⠓⠔⠕⠖⠗⠘⠙あ⠚⠛⠜⠝⠞⠟ ',\r
+               'input': '⠒⠓⠔⠕⠖⠗⠘⠙ア⠚⠛⠜⠝⠞⠟ ',\r
+               'comment': 'braille code (with space) should not be changed.',\r
+               },\r
+\r
+\r
+       {\r
                'text': '⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿',\r
                'input': '⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿',\r
                'output': '⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿',\r
index 273d3db..a72dbf9 100644 (file)
@@ -1019,10 +1019,13 @@ def japanese_braille_separate(inbuf, logwrite, nabcc=False):
                li[i-1].sepflag = should_separate(prev2_mo, prev_mo, li[i], next_mo, nabcc=nabcc)\r
 \r
        # do not translate if string is unicode braille\r
-       for mo in li:\r
-               if all((0x2800 <= ord(c) <= 0x28ff or c == ' ') for c in mo.hyouki):\r
-                       mo.output = mo.hyouki\r
+       for i in xrange(0, len(li)):\r
+               mo = li[i]\r
+               if all((0x2800 <= ord(c) <= 0x28ff or c == '\u3000') for c in mo.hyouki):\r
+                       mo.output = mo.hyouki.replace('\u3000', ' ')\r
                        mo.sepflag = False\r
+                       if i > 0:\r
+                               li[i-1].sepflag = False\r
 \r
        for mo in li:\r
                mo.write(logwrite)\r