OSDN Git Service

ti33527
authorTakuya Nishimoto <nishimotz@gmail.com>
Mon, 31 Mar 2014 04:18:09 +0000 (21:18 -0700)
committerTakuya Nishimoto <nishimotz@gmail.com>
Mon, 31 Mar 2014 04:18:09 +0000 (21:18 -0700)
include/jtalk/custom_dic_maker.py
include/jtalk/make_jdic.py
jptools/harness.py
source/synthDrivers/jtalk/translator2.py

index 11dc4d3..6c001fb 100644 (file)
@@ -292,6 +292,12 @@ jdic = [
         'accent':'1/3',\r
         },\r
 \r
+       {'text':'京丹後',\r
+        'pos':'名詞,固有名詞,地域,一般,*,*',\r
+        'speech':'キョータンゴ',\r
+        'accent':'3/5',\r
+        },\r
+\r
 #      ['きゃ', 'キャ',            "1/1",          15000,          "記号,一般,*,*,*,*"],\r
 #      ['きゅ', 'キュ',            "1/1",          15000,          "記号,一般,*,*,*,*"],\r
 #      ['きょ', 'キョ',            "1/1",          15000,          "記号,一般,*,*,*,*"],\r
index 6c7e702..c6dfecc 100644 (file)
@@ -429,6 +429,9 @@ def filter_jdic(s):
        elif a[0] == '丹後半島' and a[12] == 'タンゴハントー':\r
                a.append('タンゴ ハントー')\r
                s = ",".join(a)\r
+       elif a[0] == 'もうすぐ' and a[12] == 'モースグ':\r
+               a.append('モー スグ')\r
+               s = ",".join(a)\r
        return s\r
 \r
 def convert_jdic_file(src_file, src_enc, dest_file, dest_enc):\r
index e184520..6ea1ca5 100644 (file)
@@ -4448,29 +4448,29 @@ tests = [
        {   'text':'http:/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'input':'http:/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'},\r
        {   'text':'http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'input':'⠠⠦http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa⠠⠴'},\r
 \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
-       #{   '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
+       {   '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
-       #{   'text':'見出しレベル3', 'input':'ミダシ レベル 3'},\r
-       #{   'text':'もうすぐ', 'input':'モー スグ'},\r
+       {   'text':'世界初', 'input':'セカイ ハツ'},\r
+       {   'text':'見出しレベル3', 'input':'ミダシ レベル 3'},\r
+       {   'text':'もうすぐ', 'input':'モー スグ'},\r
        #{   'text':'最上', 'input':'モガミ'},\r
        #{   'text':'間人', 'input':'タイザ'},\r
 \r
index b05a125..0e31438 100644 (file)
@@ -465,8 +465,22 @@ def should_separate(prev2_mo, prev_mo, mo, next_mo):
        if prev_mo.hyouki == '一時' and mo.hyouki == '雨':\r
                return True\r
 \r
+       # 副,知事\r
+       if prev_mo.hyouki == '副' and mo.hinshi1 == '名詞' and mo.hinshi2 == '一般':\r
+               return False\r
+\r
+       # 世界/初\r
+       if prev_mo.hinshi1 == '名詞' and prev_mo.hinshi2 == '一般' and mo.hyouki == '初' :\r
+               return True\r
+\r
+       # 障害,者/協会\r
+       if prev2_mo and prev2_mo.hinshi1 == '名詞' and \\r
+                       prev_mo.hyouki == '者' and \\r
+                       mo.hinshi1 == '名詞':\r
+               return True\r
+\r
        # 数字の前のマスアケ\r
-       if prev_mo.nhyouki in ('零下', '西暦', 'ボーイング', 'ベスト', 'ルイ', '先', '振替', 'No.', '一人当り', '全', '満') \\r
+       if prev_mo.nhyouki in ('零下', '西暦', 'ボーイング', 'ベスト', 'ルイ', '先', '振替', 'No.', '一人当り', '全', '満', 'レベル') \\r
                        and mo.output.isdigit():\r
                return True\r
 \r
@@ -638,7 +652,7 @@ def should_separate(prev2_mo, prev_mo, mo, next_mo):
 \r
        # 人名に続く「さん」「様」「君」「殿」「氏(し)」「氏(うじ)」は区切って書く\r
        # (名詞,固有名詞,人名 -> 名詞,接尾,人名)\r
-       if prev_mo.hinshi2 == '固有名詞' and prev_mo.hinshi3 == '人名' and ((mo.hinshi2 == '接尾' and mo.hinshi3 == '人名') or (mo.hyouki == 'さん')):\r
+       if prev_mo.hinshi2 == '固有名詞' and prev_mo.hinshi3 == '人名' and ((mo.hinshi2 == '接尾' and mo.hinshi3 == '人名') or (mo.hyouki in ('さん', '知事'))):\r
                return True\r
 \r
        if prev_mo.hinshi1 == '名詞' and mo.hinshi1 == '名詞':\r