OSDN Git Service

ti33922 handling tab code
authorTakuya Nishimoto <nishimotz@gmail.com>
Tue, 10 Jun 2014 06:27:36 +0000 (15:27 +0900)
committerTakuya Nishimoto <nishimotz@gmail.com>
Tue, 10 Jun 2014 06:27:36 +0000 (15:27 +0900)
jptools/harness.py
jptools/nabccHarness.py
source/synthDrivers/jtalk/translator2.py

index a305925..6316aa5 100644 (file)
@@ -82,6 +82,11 @@ tests = [
                'inpos':  [0,0,0,0,1,2,3,4,4,5,6,7,8,8,9,10,11,12,12,12,12,13,14,15,16,16,17,18,19,20,20,21,22],\r
                },\r
        {\r
+               'text': 'a\ta',\r
+               'input': 'a⡀a',\r
+               'output': '⠰⠁⡀⠰⠁',\r
+               },\r
+       {\r
                'text': 'ab 123 あab 123 あ',\r
                'input': 'ab 123 ア ab 123 ア',\r
                'output': '⠰⠁⠃ ⠼⠁⠃⠉ ⠁ ⠰⠁⠃ ⠼⠁⠃⠉ ⠁',\r
index 1f763b2..1918b78 100644 (file)
@@ -114,4 +114,10 @@ tests = [
                'input': '2.3',
                'output': '⠆⠨⠒',
                },
+       {
+               'mode':   'NABCC',
+               'text': 'a\ta',
+               'input': 'a⡀a',
+               'output': '⠁⡀⠁',
+               },
        ]
index 6044d09..aece9fa 100644 (file)
@@ -794,6 +794,8 @@ def japanese_braille_separate(inbuf, logwrite, nabcc=False):
        text = text.replace('ヱ゛', 'ヴェ')\r
        text = text.replace('ヲ゛', 'ヴォ')\r
        text = text.replace('ワ゛', 'ヴァ')\r
+       # tab code\r
+       text = text.replace('\t', '⡀')\r
 \r
        # 'ふにゃ~'\r
        text = text.replace('ゃ~', 'ゃー')\r
@@ -807,6 +809,12 @@ def japanese_braille_separate(inbuf, logwrite, nabcc=False):
        mf = None\r
 \r
        for mo in li:\r
+               if mo.nhyouki == '⡀':\r
+                       mo.hinshi1 = '記号'\r
+                       mo.hinshi2 = '空白'\r
+                       mo.kana = mo.yomi = mo.output = '⡀'\r
+\r
+       for mo in li:\r
                if mo.hinshi1 == '空白':\r
                        mo.output = ' '\r
                elif mo.hinshi2 == '数' and mo.nhyouki.isdigit():\r