OSDN Git Service

ideographic repeat symbols
authorTakuya Nishimoto <nishimotz@gmail.com>
Mon, 7 Apr 2014 05:09:17 +0000 (22:09 -0700)
committerTakuya Nishimoto <nishimotz@gmail.com>
Mon, 7 Apr 2014 05:09:40 +0000 (22:09 -0700)
jptools/harness.py
source/synthDrivers/jtalk/translator2.py

index abdd5a9..73411cb 100644 (file)
@@ -4518,7 +4518,10 @@ tests = [
        #{   'text':'呉々も', 'input':'クレグレモ'},\r
        {   'text':'時々', 'input':'トキドキ'},\r
        {   'text':'代々木', 'input':'ヨヨギ'},\r
-       #{   'text':'複々々線', 'input':'フクフクフクセン'},\r
+       {   'text':'複々線', 'input':'フクフクセン'},\r
+       {   'text':'複々々線', 'input':'フクフクフクセン'},\r
+       {   'text':'複々々々線', 'input':'フクフクフクフクセン'},\r
+       {   'text':'複々々々々線', 'input':'フクフクフクフクフクセン'},\r
        #{   'text':'小々々支川', 'input':'ショーショーショーシセン'},\r
        #{   'text':'結婚式々場', 'input':'ケッコンシキ シキジョー'},\r
 \r
index c8fafe1..4cd86f2 100644 (file)
@@ -828,9 +828,13 @@ def japanese_braille_separate(inbuf, logwrite):
                if mo.hyouki == '〟':\r
                        mo.hinshi1 = '記号'\r
                        mo.hinshi2 = '括弧閉'\r
+               if mo.hyouki == '々々々々':\r
+                       mo.hinshi1 = '記号'\r
+                       mo.hinshi2 = '一般'\r
                if mo.hyouki == '〻':\r
                        # 303b 二の字点(にのじてん)\r
-                       mo.output = 'ニノジテン'\r
+                       mo.hinshi1 = '記号'\r
+                       mo.hinshi2 = '一般'\r
 \r
        for mo in li:\r
                if mo.hinshi2 in ('括弧開', '括弧閉'):\r
@@ -869,13 +873,25 @@ def japanese_braille_separate(inbuf, logwrite):
                        li[pos].output = '⠼'\r
 \r
        # 記号を Unicode 正規化\r
+       # 踊り字の処理\r
        for i in xrange(0, len(li)):\r
                mo = li[i]\r
                if mo.hinshi1 == '記号' and mo.hinshi2 == '一般':\r
-                       if mo.hyouki == 'ゝ' and i > 0:\r
+                       if mo.hyouki == '〻':\r
+                               mo.output = 'ニノジテン'\r
+                       elif mo.hyouki == 'ゝ' and i > 0:\r
                                mo.output = to_no_dakuon_kana(li[i-1].output)\r
                        elif mo.hyouki == 'ゞ' and i > 0:\r
                                mo.output = to_dakuon_kana(li[i-1].output)\r
+                       elif mo.hyouki == '々々々々' and i > 0:\r
+                               mo.output = li[i-1].output * 4\r
+                       elif mo.hyouki == '々々' and i > 0:\r
+                               mo.output = li[i-1].output * 2\r
+                       elif mo.hyouki == '々' and i > 0:\r
+                               if li[i-1].hyouki[0] == '々' and i > 1:\r
+                                       mo.output = li[i-2].output\r
+                               else:\r
+                                       mo.output = li[i-1].output\r
                        else:\r
                                mo.output = mo.nhyouki\r
                if mo.hyouki == '.' and mo.hinshi1 == '名詞' and mo.hinshi2 == '数':\r