OSDN Git Service

work regarding ti31543
authorTakuya Nishimoto <nishimotz@gmail.com>
Mon, 3 Mar 2014 06:50:15 +0000 (15:50 +0900)
committerTakuya Nishimoto <nishimotz@gmail.com>
Mon, 3 Mar 2014 06:50:15 +0000 (15:50 +0900)
include/jtalk/custom_dic_maker.py
include/jtalk/make_jdic.py
jptools/harness.py
jptools/jtusr.csv
source/synthDrivers/jtalk/text2mecab.py
source/synthDrivers/jtalk/translator1.py
source/synthDrivers/jtalk/translator2.py

index fb3b380..11dc4d3 100644 (file)
@@ -58,7 +58,6 @@ jdic = [
        ['障がい',           'ショーガイ',                      "0/4"],\r
        ['蓮舫',              'レンホー',                 "1/4"],\r
        ['既読',              'キドク',                            "0/3"],\r
-       ['新家',              'シンケ',                            "1/3"],\r
        ['大嘘',              'オーウソ',                 "0/4"],\r
        ['1人',              'ヒトリ',                            "2/3"],\r
        ['一人ひとり', 'ヒトリヒトリ',               "0/6"],\r
@@ -280,6 +279,19 @@ jdic = [
 \r
        {'text':'テンカイ', 'braille':'テンカイ'},\r
 \r
+       {'text':'足手纏い',\r
+        'pos':'名詞,形容動詞語幹,*,*,*,*',\r
+        'speech':'アシデマトイ',\r
+        'accent':'4/6',\r
+        'braille':'アシデ マトイ',\r
+        },\r
+\r
+       {'text':'新家',\r
+        'pos':'名詞,固有名詞,人名,姓,*,*',\r
+        'speech':'シンケ',\r
+        'accent':'1/3',\r
+        },\r
+\r
 #      ['きゃ', 'キャ',            "1/1",          15000,          "記号,一般,*,*,*,*"],\r
 #      ['きゅ', 'キュ',            "1/1",          15000,          "記号,一般,*,*,*,*"],\r
 #      ['きょ', 'キョ',            "1/1",          15000,          "記号,一般,*,*,*,*"],\r
index c83f578..a725dea 100644 (file)
@@ -412,6 +412,12 @@ def filter_jdic(s):
                s = ""\r
        elif a[0] == '梅木' and a[12] in ('ウメノキ', 'ウメギ'):\r
                s = ""\r
+       elif a[0] == '御園' and a[12] == 'ミソ':\r
+               s = ""\r
+       elif a[0] == '新家' and a[11] in ('シンヤ', 'ニイノミ'):\r
+               s = ""\r
+       elif a[0] == '新家' and a[6] != '人名' and a[11] == 'シンケ':\r
+               s = ""\r
        return s\r
 \r
 def convert_jdic_file(src_file, src_enc, dest_file, dest_enc):\r
index f63a7ce..f13c889 100644 (file)
@@ -3996,6 +3996,8 @@ tests = [
                'comment': '点訳のてびき第3版 第3章 その3 3.',\r
                'text': '一郎くん', 'input': 'イチロー クン'\r
                },\r
+       {   'text':'久代さん', 'input':'ヒサヨ サン'},\r
+       {   'text':'新家さん', 'input':'シンケ サン'},\r
        {\r
                'comment': '点訳のてびき第3版 第3章 その3 3. 備考1',\r
                'text': '魚屋さん', 'input': 'サカナヤサン'\r
@@ -4446,12 +4448,11 @@ 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
@@ -4466,7 +4467,7 @@ tests = [
        #{   '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
index 4db1739..d6b23e5 100644 (file)
@@ -1 +1 @@
-足手纏い,,,,名詞,形容動詞語幹,*,*,*,*,足手纏い,アシデマトイ,アシデマトイ,4/6,C1,アシデ マトイ
+次世代型点字ピンディスプレイ,,,,名詞,一般,*,*,*,*,次世代型点字ピンディスプレイ,ジセダイガタテンジピンディスプレイ,ジセダイガタテンジピンディスプレイ,12/16,C0,ジセダイガタ テンジピンディスプレイ
\ No newline at end of file
index 7ad8b8b..4673993 100644 (file)
@@ -12,6 +12,8 @@ def text2mecab_setup():
        global predic
        if predic is None:
                predic = [
+                       [re.compile(u"\r"), ''],
+                       [re.compile(u"\n"), ''],
                        [re.compile(u" "), u" "],
                        [re.compile(u"!"), u"!"],
                        [re.compile(u"\""), u"”"],
index 33592d4..8b2f29c 100644 (file)
@@ -517,7 +517,7 @@ def translateWithInPos(text):
                        pos += 1\r
        # rstrip with inPos\r
        outbuf = retval\r
-       if text[-1] != ' ':\r
+       if text and text[-1] != ' ':\r
                while outbuf[-1:] == ' ':\r
                        outbuf = outbuf[:-1]\r
                        inPos.pop()\r
index 0f103ba..60625ca 100644 (file)
@@ -635,6 +635,11 @@ def should_separate(prev2_mo, prev_mo, mo, next_mo):
        if prev_mo.hyouki == 'わが' and mo.hyouki == 'まま':\r
                return False\r
 \r
+       # 人名に続く「さん」「様」「君」「殿」「氏(し)」「氏(うじ)」は区切って書く\r
+       # (名詞,固有名詞,人名 -> 名詞,接尾,人名)\r
+       if prev_mo.hinshi2 == '固有名詞' and prev_mo.hinshi3 == '人名' and ((mo.hinshi2 == '接尾' and mo.hinshi3 == '人名') or (mo.hyouki == 'さん')):\r
+               return True\r
+\r
        if prev_mo.hinshi1 == '名詞' and mo.hinshi1 == '名詞':\r
                if mo.hinshi2 == '数': return False\r
                # 人名\r