修訂 | 064a8496f65af211373f10e00045abde15607bfb (tree) |
---|---|
時間 | 2013-10-29 18:46:39 |
作者 | ![]() |
Commiter | Takuya Nishimoto |
moved core sources of JTalk and braille translator from nvdajp repository to nvdajp-miscdep, to make their tests and developments easier.
@@ -0,0 +1,4309 @@ | ||
1 | +# -*- coding: utf-8 -*- | |
2 | +#jptools/harness.py | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#This file is covered by the GNU General Public License. | |
5 | +#See the file COPYING for more details. | |
6 | +#Copyright (C) 2013 Masataka.Shinke, Takuya Nishimoto, NVDA Japanese Team | |
7 | +# | |
8 | +# For output field, blank should be 0x20 (not 0x2800). | |
9 | +# output の空白は 0x2800 ではなく 0x20 を使います | |
10 | + | |
11 | +from __future__ import unicode_literals | |
12 | + | |
13 | +tests = [ | |
14 | + { 'note': '+ 基本テスト +' }, | |
15 | + { | |
16 | + 'input': 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨン', | |
17 | + 'output': '⠁⠃⠉⠋⠊⠡⠣⠩⠫⠪⠱⠳⠹⠻⠺⠕⠗⠝⠟⠞⠅⠇⠍⠏⠎⠥⠧⠭⠯⠮⠵⠷⠽⠿⠾⠌⠬⠜⠴', | |
18 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38], | |
19 | + 'cursorPos': 0, | |
20 | + 'brlCursorPos': 0, | |
21 | + 'mode': '', | |
22 | + 'comment': '', | |
23 | + }, | |
24 | + { | |
25 | + 'input': 'ガギグゲゴザジズゼゾダジズデドパピプペポキャキュキョチャチュチョヒャヒュヒョジャジュジョピャピュピョ', | |
26 | + 'output': '⠐⠡⠐⠣⠐⠩⠐⠫⠐⠪⠐⠱⠐⠳⠐⠹⠐⠻⠐⠺⠐⠕⠐⠳⠐⠹⠐⠟⠐⠞⠠⠥⠠⠧⠠⠭⠠⠯⠠⠮⠈⠡⠈⠩⠈⠪⠈⠕⠈⠝⠈⠞⠈⠥⠈⠭⠈⠮⠘⠱⠘⠹⠘⠺⠨⠥⠨⠭⠨⠮', | |
27 | + }, | |
28 | + { | |
29 | + 'text': '1234567890', | |
30 | + 'input': '1234567890', | |
31 | + 'output': '⠼⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚', | |
32 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9], | |
33 | + 'inpos1': [0,0,1,2,3,4,5,6,7,8,9], | |
34 | + 'inpos': [0,0,1,2,3,4,5,6,7,8,9], | |
35 | + }, | |
36 | + { | |
37 | + 'text': '1234567890', | |
38 | + 'input': '1234567890', | |
39 | + 'output': '⠼⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚', | |
40 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9], | |
41 | + 'inpos1': [0,0,1,2,3,4,5,6,7,8,9], | |
42 | + 'inpos': [0,0,1,2,3,4,5,6,7,8,9], | |
43 | + }, | |
44 | + { | |
45 | + 'text': 'abcdefghijklmnopqrstuvwxyz', | |
46 | + 'input': 'abcdefghijklmnopqrstuvwxyz', | |
47 | + 'output': '⠰⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞⠥⠧⠺⠭⠽⠵', | |
48 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
49 | + 'inpos1': [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
50 | + 'inpos': [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
51 | + }, | |
52 | + { | |
53 | + 'text': 'abcdefghijklmnopqrstuvwxyz', | |
54 | + 'input': 'abcdefghijklmnopqrstuvwxyz', | |
55 | + 'output': '⠰⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞⠥⠧⠺⠭⠽⠵', | |
56 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
57 | + 'inpos1': [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
58 | + 'inpos': [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
59 | + }, | |
60 | + { | |
61 | + 'text': 'abc defghijklmnopqrstuvwxyz', | |
62 | + 'input': 'abc defghijklmnopqrstuvwxyz', | |
63 | + 'output': '⠰⠁⠃⠉ ⠰⠙⠑⠋⠛⠓⠊⠚⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞⠥⠧⠺⠭⠽⠵', | |
64 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26], | |
65 | + 'inpos1': [0,0,1,2,3,4,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26], | |
66 | + 'inpos': [0,0,1,2,3,4,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26], | |
67 | + }, | |
68 | + { | |
69 | + 'text': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', | |
70 | + 'input': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', | |
71 | + 'output': '⠰⠠⠠⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞⠥⠧⠺⠭⠽⠵', | |
72 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
73 | + 'inpos1': [0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
74 | + 'inpos': [0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], | |
75 | + }, | |
76 | + { | |
77 | + 'text': 'ABC abc 123 ABC abc 123', | |
78 | + 'input': 'ABC abc 123 ABC abc 123', | |
79 | + 'output': '⠰⠠⠠⠁⠃⠉ ⠰⠁⠃⠉ ⠼⠁⠃⠉ ⠰⠠⠠⠁⠃⠉ ⠰⠁⠃⠉ ⠼⠁⠃⠉', | |
80 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22], | |
81 | + 'inpos1': [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], | |
82 | + '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], | |
83 | + }, | |
84 | + { | |
85 | + 'text': 'ab 123 あab 123 あ', | |
86 | + 'input': 'ab 123 ア ab 123 ア', | |
87 | + 'output': '⠰⠁⠃ ⠼⠁⠃⠉ ⠁ ⠰⠁⠃ ⠼⠁⠃⠉ ⠁', | |
88 | + 'inpos2': [0,1,2,3,4,5,6,7,7,8,9,10,11,12,13,14,15], | |
89 | + 'inpos1': [0,0,1,2,3,3,4,5,6,7,8,9,9,10,11,12,12,13,14,15,16], | |
90 | + 'inpos': [0,0,1,2,3,3,4,5,6,7,7,8,8,9,10,11,11,12,13,14,15], | |
91 | + }, | |
92 | + { | |
93 | + 'text': 'ヒロイノ カン カンスージノ ニ', | |
94 | + 'input': 'ヒロイノ カン カンスージノ ニ', | |
95 | + 'output': '⠧⠚⠃⠎ ⠡⠴ ⠡⠴⠹⠒⠐⠳⠎ ⠇', | |
96 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], | |
97 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,15,16], | |
98 | + 'inpos': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,15,16], | |
99 | + }, | |
100 | + { | |
101 | + 'text': 'トーヨーカンジノ カン モジノ ジ 候補2', | |
102 | + 'input': 'トーヨーカンジノ カン モジノ ジ コーホ2', | |
103 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,19,20,21], | |
104 | + 'inpos1': [0,1,2,3,4,5,6,6,7,8,9,10,11,12,13,14,14,15,16,17,17,18,19,20,21,22,22], | |
105 | + 'inpos': [0,1,2,3,4,5,6,6,7,8,9,10,11,12,13,14,14,15,16,17,17,18,19,19,20,21,21], | |
106 | + 'output': '⠞⠒⠜⠒⠡⠴⠐⠳⠎ ⠡⠴ ⠾⠐⠳⠎ ⠐⠳ ⠪⠒⠮⠼⠃', | |
107 | + }, | |
108 | + { | |
109 | + 'text': 'カンジルノ カン ヒラガナ じ 候補3', | |
110 | + 'input': 'カンジルノ カン ヒラガナ ジ コーホ3', | |
111 | + 'inpos1': [0,1,2,2,3,4,5,6,7,8,9,10,11,12,12,13,14,15,15,16,17,18,19,20,20], | |
112 | + 'output': '⠡⠴⠐⠳⠙⠎ ⠡⠴ ⠧⠑⠐⠡⠅ ⠐⠳ ⠪⠒⠮⠼⠉', | |
113 | + }, | |
114 | + { | |
115 | + 'text': 'カンムリノ カン シカイシャノ シ 候補4', | |
116 | + 'input': 'カンムリノ カン シカイシャノ シ コーホ4', | |
117 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,13,15,16,17,18,19,20,21,22,22], | |
118 | + 'output': '⠡⠴⠽⠓⠎ ⠡⠴ ⠳⠡⠃⠈⠱⠎ ⠳ ⠪⠒⠮⠼⠙', | |
119 | + }, | |
120 | + { | |
121 | + 'text': 'ミキノ カン コト ジケンノ ジ 候補5', | |
122 | + 'input': 'ミキノ カン コト ジケンノ ジ コーホ5', | |
123 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,11,12,13,14,15,16,16,17,18,19,20,21,21], | |
124 | + 'output': '⠷⠣⠎ ⠡⠴ ⠪⠞ ⠐⠳⠫⠴⠎ ⠐⠳ ⠪⠒⠮⠼⠑', | |
125 | + }, | |
126 | + { | |
127 | + 'text': 'ヒラガナ かんじ 候補6', | |
128 | + 'input': 'ヒラガナ カンジ コーホ6', | |
129 | + 'inpos1': [0,1,2,2,3,4,5,6,7,7,8,9,10,11,12,12], | |
130 | + 'output': '⠧⠑⠐⠡⠅ ⠡⠴⠐⠳ ⠪⠒⠮⠼⠋', | |
131 | + }, | |
132 | + { | |
133 | + 'text': 'ヒロイノ カン オサメルノ ジ 候補7', | |
134 | + 'input': 'ヒロイノ カン オサメルノ ジ コーホ7', | |
135 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,16,17,18,19,20,20], | |
136 | + 'output': '⠧⠚⠃⠎ ⠡⠴ ⠊⠱⠿⠙⠎ ⠐⠳ ⠪⠒⠮⠼⠛', | |
137 | + }, | |
138 | + { | |
139 | + 'text': 'クサカンムリニ カンノ カン カンジノ ジ 候補8', | |
140 | + 'input': 'クサカンムリニ カンノ カン カンジノ ジ コーホ8', | |
141 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,19,20,21,21,22,23,24,25,26,26], | |
142 | + 'output': '⠩⠱⠡⠴⠽⠓⠇ ⠡⠴⠎ ⠡⠴ ⠡⠴⠐⠳⠎ ⠐⠳ ⠪⠒⠮⠼⠓', | |
143 | + }, | |
144 | + { | |
145 | + 'text': '(U)', | |
146 | + 'input': '(U)', | |
147 | + 'output': '⠶⠰⠠⠥⠶', | |
148 | + 'inpos2': [0,1,2], | |
149 | + 'inpos1': [0,1,1,1,2], | |
150 | + 'inpos': [0,1,1,1,2], | |
151 | + 'comment': 'nvdajp ticket 28226 (comment 2012-05-16)', | |
152 | + }, | |
153 | + { | |
154 | + 'text': '(U)', | |
155 | + 'input': '(U)', | |
156 | + 'output': '⠶⠰⠠⠥⠶', | |
157 | + 'inpos2': [0,1,2], | |
158 | + 'inpos1': [0,1,1,1,2], | |
159 | + 'inpos': [0,1,1,1,2], | |
160 | + 'comment': '記号はUnicode正規化', | |
161 | + }, | |
162 | + { | |
163 | + 'text': '[ア]', | |
164 | + 'input': '[ア]', | |
165 | + 'output': '⠐⠶⠁⠶⠂', | |
166 | + 'inpos2': [0,1,2], | |
167 | + 'inpos1': [0,0,1,2,2], | |
168 | + 'inpos': [0,0,1,2,2], | |
169 | + 'comment': '', | |
170 | + }, | |
171 | + { | |
172 | + 'text': '[ア]', | |
173 | + 'input': '[ア]', | |
174 | + 'output': '⠐⠶⠁⠶⠂', | |
175 | + 'inpos2': [0,1,2], | |
176 | + 'inpos1': [0,0,1,2,2], | |
177 | + 'inpos': [0,0,1,2,2], | |
178 | + 'comment': '記号はUnicode正規化', | |
179 | + }, | |
180 | + { | |
181 | + 'text': '“ア”', | |
182 | + 'input': '“ア”', | |
183 | + 'output': '⠐⠶⠁⠶⠂', | |
184 | + 'inpos2': [0,1,2], | |
185 | + 'inpos1': [0,0,1,2,2], | |
186 | + 'inpos': [0,0,1,2,2], | |
187 | + 'comment': '', | |
188 | + }, | |
189 | + { | |
190 | + 'text': '{ア}', | |
191 | + 'input': '{ア}', | |
192 | + 'output': '⠐⠶⠁⠶⠂', | |
193 | + 'inpos2': [0,1,2], | |
194 | + 'inpos1': [0,0,1,2,2], | |
195 | + 'inpos': [0,0,1,2,2], | |
196 | + 'comment': '', | |
197 | + }, | |
198 | + { | |
199 | + 'text': '‘ア’', | |
200 | + 'input': '‘ア’', | |
201 | + 'output': '⠐⠶⠁⠶⠂', | |
202 | + 'inpos2': [0,1,2], | |
203 | + 'inpos1': [0,0,1,2,2], | |
204 | + 'inpos': [0,0,1,2,2], | |
205 | + 'comment': '', | |
206 | + }, | |
207 | + { | |
208 | + 'text': '〔ア〕', | |
209 | + 'input': '〔ア〕', | |
210 | + 'output': '⠐⠶⠁⠶⠂', | |
211 | + 'inpos2': [0,1,2], | |
212 | + 'inpos1': [0,0,1,2,2], | |
213 | + 'inpos': [0,0,1,2,2], | |
214 | + 'comment': '', | |
215 | + }, | |
216 | + { | |
217 | + 'text': '{ア}', | |
218 | + 'input': '{ア}', | |
219 | + 'output': '⠐⠶⠁⠶⠂', | |
220 | + 'inpos2': [0,1,2], | |
221 | + 'inpos1': [0,0,1,2,2], | |
222 | + 'inpos': [0,0,1,2,2], | |
223 | + 'comment': '記号はUnicode正規化', | |
224 | + }, | |
225 | + { | |
226 | + 'text': '〈ア〉', | |
227 | + 'input': '〈ア〉', | |
228 | + 'output': '⠐⠶⠁⠶⠂', | |
229 | + 'inpos2': [0,1,2], | |
230 | + 'inpos1': [0,0,1,2,2], | |
231 | + 'inpos': [0,0,1,2,2], | |
232 | + 'comment': '', | |
233 | + }, | |
234 | + { | |
235 | + 'text': '《ア》', | |
236 | + 'input': '《ア》', | |
237 | + 'output': '⠐⠶⠁⠶⠂', | |
238 | + 'inpos2': [0,1,2], | |
239 | + 'inpos1': [0,0,1,2,2], | |
240 | + 'inpos': [0,0,1,2,2], | |
241 | + 'comment': '', | |
242 | + }, | |
243 | + { | |
244 | + 'text': '【ア】', | |
245 | + 'input': '【ア】', | |
246 | + 'output': '⠐⠶⠁⠶⠂', | |
247 | + 'inpos2': [0,1,2], | |
248 | + 'inpos1': [0,0,1,2,2], | |
249 | + 'inpos': [0,0,1,2,2], | |
250 | + 'comment': '', | |
251 | + }, | |
252 | + { | |
253 | + 'text': '〝ア〟', | |
254 | + 'input': '〝ア〟', | |
255 | + 'output': '⠐⠶⠁⠶⠂', | |
256 | + 'inpos2': [0,1,2], | |
257 | + 'inpos1': [0,0,1,2,2], | |
258 | + 'inpos': [0,0,1,2,2], | |
259 | + 'comment': '', | |
260 | + }, | |
261 | + { | |
262 | + 'text': '「ア」', | |
263 | + 'input': '「ア」', | |
264 | + 'output': '⠤⠁⠤', | |
265 | + 'inpos2': [0,1,2], | |
266 | + 'inpos1': [0,1,2], | |
267 | + 'inpos': [0,1,2], | |
268 | + 'comment': '', | |
269 | + }, | |
270 | + { | |
271 | + 'text': '『ア』', | |
272 | + 'input': '『ア』', | |
273 | + 'output': '⠰⠤⠁⠤⠆', | |
274 | + 'inpos2': [0,1,2], | |
275 | + 'inpos1': [0,0,1,2,2], | |
276 | + 'inpos': [0,0,1,2,2], | |
277 | + 'comment': '', | |
278 | + }, | |
279 | + { | |
280 | + 'text': '「ア」', | |
281 | + 'input': '「ア」', | |
282 | + 'output': '⠤⠁⠤', | |
283 | + 'inpos2': [0,1,2], | |
284 | + 'inpos1': [0,1,2], | |
285 | + 'inpos': [0,1,2], | |
286 | + 'comment': '記号はUnicode正規化', | |
287 | + }, | |
288 | + { | |
289 | + 'text': 'Ctrl-Z', | |
290 | + 'input': 'Ctrl-Z', | |
291 | + 'output': '⠰⠠⠉⠞⠗⠇⠤⠰⠠⠵', | |
292 | + 'inpos2': [0,1,2,3,4,5], | |
293 | + 'inpos1': [0,0,0,1,2,3,4,5,5,5], | |
294 | + 'inpos': [0,0,0,1,2,3,4,5,5,5], | |
295 | + 'comment': 'Latinの 0x002D HYPHEN-MINUS は 0x2212 MUNUS SIGN に正規化しない', | |
296 | + }, | |
297 | + { | |
298 | + 'input': 'Aア', | |
299 | + 'output': '⠰⠠⠁⠤⠁', | |
300 | + 'inpos1': [0,0,0,0,1], | |
301 | + }, | |
302 | + { | |
303 | + 'input': 'aアットb', | |
304 | + 'output': '⠰⠁⠤⠁⠂⠞⠰⠃', | |
305 | + 'inpos1': [0,0,0,1,2,3,4,4], | |
306 | + }, | |
307 | + { | |
308 | + 'text': 'a@b', | |
309 | + 'input': '⠠⠦a@b⠠⠴', | |
310 | + 'output': '⠠⠦⠁⠪⠃⠠⠴', | |
311 | + 'inpos2': [0,0,0,1,2,2,2], | |
312 | + 'inpos1': [0,1,2,3,4,5,6], | |
313 | + 'comment': '情報処理点字を使う。@は246で。', | |
314 | + }, | |
315 | + { | |
316 | + 'text': '<a@b>', | |
317 | + 'input': '⠠⠦<a@b>⠠⠴', | |
318 | + 'output': '⠠⠦⠔⠔⠁⠪⠃⠢⠢⠠⠴', | |
319 | + 'inpos2': [0,0,0,1,2,3,4,4,4], | |
320 | + 'inpos1': [0,1,2,2,3,4,5,6,6,7,8], | |
321 | + 'inpos': [0,0,0,0,1,2,3,4,4,4,4], | |
322 | + 'comment': 'メールアドレス前後の山かっこ', | |
323 | + }, | |
324 | + { | |
325 | + 'input': 'Cプラスプラス', | |
326 | + 'output': '⠰⠠⠉⠤⠠⠭⠑⠹⠠⠭⠑⠹', | |
327 | + 'inpos1': [0,0,0,0,1,1,2,3,4,4,5,6], | |
328 | + }, | |
329 | + { | |
330 | + 'text': 'notepad++', | |
331 | + 'input': 'notepad++', | |
332 | + 'output': '⠰⠝⠕⠞⠑⠏⠁⠙⠢⠢', | |
333 | + 'inpos2': [0,1,2,3,4,5,6,7,8], | |
334 | + 'inpos1': [0,0,1,2,3,4,5,6,7,8], | |
335 | + 'comment': 'プラスは情報処理点字 356 だが 26 のまま。', | |
336 | + }, | |
337 | + { | |
338 | + 'text': '+@/#$%&*;', | |
339 | + 'input': '⠠⠦+@/#$%&*;⠠⠴', | |
340 | + 'output': '⠠⠦⠬⠪⠌⠩⠹⠻⠯⠡⠆⠠⠴', | |
341 | + 'inpos2': [0,0,0,1,2,3,4,5,6,7,8,8,8], | |
342 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12], | |
343 | + 'inpos': [0,0,0,1,2,3,4,5,6,7,8,8,8], | |
344 | + 'comment': '情報処理点字', | |
345 | + }, | |
346 | + { | |
347 | + 'text': ',.:;!?@#\\$%&*|+-/=<>^_~', | |
348 | + 'input': '⠠⠦,.:;!?@#\\$%&*|+-/=<>^_~⠠⠴', | |
349 | + 'output': '⠠⠦⠂⠲⠐⠂⠆⠖⠐⠦⠪⠩⠫⠹⠻⠯⠡⠳⠬⠤⠌⠒⠒⠔⠔⠢⠢⠘⠐⠤⠐⠉⠠⠴', | |
350 | + 'inpos2': [0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,22,22], | |
351 | + 'inpos1': [0,1,2,3,4,4,5,6,7,7,8,9,10,11,12,13,14,15,16,17,18,19,19,20,20,21,21,22,23,23,24,24,25,26], | |
352 | + 'inpos': [0,0,0,1,2,2,3,4,5,5,6,7,8,9,10,11,12,13,14,15,16,17,17,18,18,19,19,20,21,21,22,22,22,22], | |
353 | + 'comment': '情報処理点字 バックスラッシュではなく円記号', | |
354 | + }, | |
355 | + { | |
356 | + 'text': '"\'`', | |
357 | + 'input': '”’‘', | |
358 | + #'output': '⠶⠄⠐⠑', | |
359 | + 'inpos2': [0,1,2], | |
360 | + 'comment': '「”’‘」は正規化', | |
361 | + }, | |
362 | + { | |
363 | + 'text': '@{}[]', # () | |
364 | + 'input': '⠠⠦@{}[]⠠⠴', # () | |
365 | + 'output': '⠠⠦⠪⠣⠜⠷⠾⠠⠴', # ⠦⠴ | |
366 | + 'inpos2': [0,0,0,1,2,3,4,4,4], | |
367 | + 'inpos1': [0,1,2,3,4,5,6,7,8], | |
368 | + 'inpos': [0,0,0,1,2,3,4,4,4], | |
369 | + }, | |
370 | + { | |
371 | + 'text': 'アドレスはnvda@nvda.jpです。', | |
372 | + 'input': 'アドレスワ ⠠⠦nvda@nvda.jp⠠⠴ デス。', | |
373 | + 'output': '⠁⠐⠞⠛⠹⠄ ⠠⠦⠝⠧⠙⠁⠪⠝⠧⠙⠁⠲⠚⠏⠠⠴ ⠐⠟⠹⠲', | |
374 | + 'inpos2': [0,1,2,3,4,4,5,5,5,6,7,8,9,10,11,12,13,14,15,16,16,16,16,17,18,19], | |
375 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25], | |
376 | + 'inpos': [0,1,1,2,3,4,4,5,5,5,6,7,8,9,10,11,12,13,14,15,16,16,16,16,17,17,18,19], | |
377 | + 'comment': '情報処理点字', | |
378 | + }, | |
379 | + { | |
380 | + 'text': 'アドレスはabc@123.jpです。', | |
381 | + 'input': 'アドレスワ ⠠⠦abc@123.jp⠠⠴ デス。', | |
382 | + 'output': '⠁⠐⠞⠛⠹⠄ ⠠⠦⠁⠃⠉⠪⠼⠁⠃⠉⠲⠰⠚⠏⠠⠴ ⠐⠟⠹⠲', | |
383 | + 'inpos2': [0,1,2,3,4,4,5,5,5,6,7,8,9,10,11,12,13,14,14,14,14,15,16,17], | |
384 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,12,12,13,14,15,16,16,17,18,19,20,21,21,22,23], | |
385 | + 'inpos': [0,1,1,2,3,4,4,5,5,5,6,7,8,9,9,10,11,12,13,13,14,14,14,14,15,15,16,17], | |
386 | + 'comment': '情報処理点字。数字、ピリオドのあとにa~jが続くときは小文字フラグ(56)が必要。', | |
387 | + }, | |
388 | + { | |
389 | + 'text': 'アドレスはa-b_c@123.jpです。', | |
390 | + 'input': 'アドレスワ ⠠⠦a-b_c@123.jp⠠⠴ デス。', | |
391 | + 'output': '⠁⠐⠞⠛⠹⠄ ⠠⠦⠁⠤⠃⠐⠤⠉⠪⠼⠁⠃⠉⠲⠰⠚⠏⠠⠴ ⠐⠟⠹⠲', | |
392 | + 'inpos2': [0,1,2,3,4,4,5,5,5,6,7,8,9,10,11,12,13,14,15,16,16,16,16,17,18,19], | |
393 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,11,12,13,14,14,15,16,17,18,18,19,20,21,22,23,23,24,25], | |
394 | + 'inpos': [0,1,1,2,3,4,4,5,5,5,6,7,8,8,9,10,11,11,12,13,14,15,15,16,16,16,16,17,17,18,19], | |
395 | + 'comment': '情報処理点字。jの前に小文字フラグ。', | |
396 | + }, | |
397 | + { | |
398 | + 'text': 'アドレスはhttp://abc.123.jp/~a/?a&b#a+b-c%56です。', | |
399 | + 'input': 'アドレスワ ⠠⠦http://abc.123.jp/~a/?a&b#a+b-c%56⠠⠴ デス。', | |
400 | + 'output': '⠁⠐⠞⠛⠹⠄ ⠠⠦⠓⠞⠞⠏⠐⠂⠌⠌⠁⠃⠉⠲⠼⠁⠃⠉⠲⠰⠚⠏⠌⠐⠉⠁⠌⠐⠦⠁⠯⠃⠩⠁⠬⠃⠤⠉⠻⠼⠑⠋⠠⠴ ⠐⠟⠹⠲', | |
401 | + 'inpos2': [0,1,2,3,4,4,5,5,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,38,38,38,39,40,41], | |
402 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,12,12,13,14,15,16,17,18,19,19,20,21,22,23,23,24,25,26,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,40,41,42,43,44,45,45,46,47], | |
403 | + 'inpos': [0,1,1,2,3,4,4,5,5,5,6,7,8,9,9,10,11,12,13,14,15,16,16,17,18,19,20,20,21,22,23,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,37,38,38,38,38,39,39,40,41], | |
404 | + 'comment': '情報処理点字。jの前に小文字フラグ。', | |
405 | + }, | |
406 | + { | |
407 | + 'text': 'アドレスはabc.123.jpです。', | |
408 | + 'input': 'アドレスワ ⠦abc.123.jp⠴ デス。', | |
409 | + 'output': '⠁⠐⠞⠛⠹⠄ ⠦⠁⠃⠉⠲⠼⠁⠃⠉⠲⠚⠏⠴ ⠐⠟⠹⠲', | |
410 | + 'inpos2': [0,1,2,3,4,4,5,5,6,7,8,9,10,11,12,13,14,14,14,15,16,17], | |
411 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,11,12,13,14,15,16,17,18,19,19,20,21], | |
412 | + 'inpos': [0,1,1,2,3,4,4,5,5,6,7,8,9,9,10,11,12,13,14,14,14,15,15,16,17], | |
413 | + 'comment': '外国語引用符。数字の後ろのドットは小数点ではない。', | |
414 | + }, | |
415 | + { | |
416 | + 'text': 'C:\\Program Files', | |
417 | + 'input': '⠠⠦C:\\Program Files⠠⠴', | |
418 | + 'output': '⠠⠦⠠⠉⠐⠂⠫⠠⠏⠗⠕⠛⠗⠁⠍ ⠠⠋⠊⠇⠑⠎⠠⠴', | |
419 | + 'inpos1': [0,1,2,2,3,3,4,5,5,6,7,8,9,10,11,12,13,13,14,15,16,17,18,19], | |
420 | + 'comment': '情報処理点字', | |
421 | + }, | |
422 | + { | |
423 | + 'text': 'C:\\Users\\ユーザー', | |
424 | + 'input': '⠠⠦C:\\Users\\⠠⠴ ユーザー', | |
425 | + 'output': '⠠⠦⠠⠉⠐⠂⠫⠠⠥⠎⠑⠗⠎⠫⠠⠴ ⠬⠒⠐⠱⠒', | |
426 | + 'inpos1': [0,1,2,2,3,3,4,5,5,6,7,8,9,10,11,12,13,14,15,16,16,17], | |
427 | + 'comment': '情報処理点字を前半のみに使う', | |
428 | + }, | |
429 | + { | |
430 | + 'text': 'v1.4', | |
431 | + 'input': '⠦v1.4⠴', | |
432 | + 'output': '⠦⠧⠼⠁⠂⠙⠴', | |
433 | + 'inpos2': [0,0,1,2,3,3], | |
434 | + 'inpos1': [0,1,2,2,3,4,5], | |
435 | + 'inpos': [0,0,1,1,2,3,3], | |
436 | + 'comment': 'nvdajp ticket 28226 (comment 2012-05-16)', | |
437 | + }, | |
438 | + { | |
439 | + 'text': 'c:\\', | |
440 | + 'input': '⠠⠦c:\\⠠⠴', | |
441 | + 'output': '⠠⠦⠉⠐⠂⠫⠠⠴', | |
442 | + 'inpos1': [0,1,2,3,3,4,5,6], | |
443 | + 'comment': '円記号', | |
444 | + }, | |
445 | + { | |
446 | + 'text': 'c:\\work\\nvda\\jpmain>', | |
447 | + 'input': '⠠⠦c:\\work\\nvda\\jpmain>⠠⠴', | |
448 | + 'output': '⠠⠦⠉⠐⠂⠫⠺⠕⠗⠅⠫⠝⠧⠙⠁⠫⠚⠏⠍⠁⠊⠝⠢⠢⠠⠴', | |
449 | + 'inpos1': [0,1,2,3,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,21,22,23], | |
450 | + 'comment': '円記号 jpとmainが既知語であるがマスアケしない', | |
451 | + }, | |
452 | + { | |
453 | + 'text': '<=>', | |
454 | + 'input': '<=>', | |
455 | + 'output': '⠔⠔⠒⠒⠢⠢', | |
456 | + 'inpos2': [0,1,2], | |
457 | + 'inpos1': [0,0,1,1,2,2], | |
458 | + 'inpos': [0,0,1,1,2,2], | |
459 | + }, | |
460 | + { | |
461 | + 'input': 'アー', | |
462 | + 'output': '⠁⠒', | |
463 | + 'inpos1': [0,1], | |
464 | + }, | |
465 | + { | |
466 | + 'text': 'きゃりーぱみゅぱみゅ', | |
467 | + 'input': 'キャリーパミュパミュ', | |
468 | + 'output': '⠈⠡⠓⠒⠠⠥⠈⠽⠠⠥⠈⠽', | |
469 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9], | |
470 | + 'inpos1': [0,0,2,3,4,4,5,5,7,7,8,8], | |
471 | + 'inpos': [0,0,2,3,4,4,5,5,7,7,8,8], | |
472 | + }, | |
473 | + { | |
474 | + 'comment': '点訳のてびき 第4章 その1 句読符', | |
475 | + 'input': 'ア、イ。', | |
476 | + 'output': '⠁⠰ ⠃⠲', | |
477 | + 'inpos1': [0,1,1,2,3], | |
478 | + }, | |
479 | + { | |
480 | + 'comment': '点訳のてびき 第4章 その1 句読符', | |
481 | + 'input': 'ア?ア?', | |
482 | + 'output': '⠁⠢ ⠁⠢', | |
483 | + 'inpos1': [0,1,1,2,3], | |
484 | + }, | |
485 | + { | |
486 | + 'comment': '点訳のてびき 第4章 その1 句読符', | |
487 | + 'input': 'ア!ア!', | |
488 | + 'output': '⠁⠖ ⠁⠖', | |
489 | + 'inpos1': [0,1,1,2,3], | |
490 | + }, | |
491 | + { | |
492 | + 'comment': '点訳のてびき 第4章 その1 句読符', | |
493 | + 'text': 'いいえ。はい、そうです。', | |
494 | + 'input': 'イイエ。ハイ、ソーデス。', | |
495 | + 'output': '⠃⠃⠋⠲ ⠥⠃⠰ ⠺⠒⠐⠟⠹⠲', | |
496 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11], | |
497 | + 'inpos1': [0,1,2,3,3,3,4,5,6,6,7,8,9,9,10,11], | |
498 | + 'inpos': [0,1,2,3,3,3,4,5,6,6,7,8,9,9,10,11], | |
499 | + }, | |
500 | + { | |
501 | + 'comment': '点訳のてびき 第4章 その1 句読符 4.中点', | |
502 | + 'input': 'ア・イ', | |
503 | + 'output': '⠁⠐ ⠃', | |
504 | + 'inpos1': [0,1,1,2], | |
505 | + }, | |
506 | + { | |
507 | + 'input': '123アイウ', | |
508 | + 'output': '⠼⠁⠃⠉⠤⠁⠃⠉', | |
509 | + 'inpos1': [0,0,1,2,2,3,4,5], | |
510 | + 'comment': 'numbers and kana characters should be separated by 36 symbol.', | |
511 | + }, | |
512 | + { | |
513 | + 'input': '0ア1イ2ウ3エ4オ5ラ6リ7ル8レ9ロ', | |
514 | + 'output': '⠼⠚⠤⠁⠼⠁⠤⠃⠼⠃⠤⠉⠼⠉⠤⠋⠼⠙⠤⠊⠼⠑⠤⠑⠼⠋⠤⠓⠼⠛⠤⠙⠼⠓⠤⠛⠼⠊⠤⠚', | |
515 | + 'comment': 'numbers and some kana characters should be separated by 36 symbol.', | |
516 | + }, | |
517 | + { | |
518 | + 'input': '123キャ', | |
519 | + 'output': '⠼⠁⠃⠉⠈⠡', | |
520 | + 'comment': 'should not be separated by 36 symbol.', | |
521 | + }, | |
522 | + { | |
523 | + 'input': '0カ1キ2ク3ケ4コ5サ6シ7ス8セ9ソ0タ1チ2ツ3テ4ト5ナ6ニ7ヌ8ネ9ノ', | |
524 | + 'output': '⠼⠚⠡⠼⠁⠣⠼⠃⠩⠼⠉⠫⠼⠙⠪⠼⠑⠱⠼⠋⠳⠼⠛⠹⠼⠓⠻⠼⠊⠺⠼⠚⠕⠼⠁⠗⠼⠃⠝⠼⠉⠟⠼⠙⠞⠼⠑⠅⠼⠋⠇⠼⠛⠍⠼⠓⠏⠼⠊⠎', | |
525 | + 'comment': 'should not be separated by 36 symbol.', | |
526 | + }, | |
527 | + { | |
528 | + 'input': '1ア1キャ1ア', | |
529 | + 'output': '⠼⠁⠤⠁⠼⠁⠈⠡⠼⠁⠤⠁', | |
530 | + 'comment': 'numbers and some kana characters should be separated by 36 symbol.', | |
531 | + }, | |
532 | + { | |
533 | + 'input': '123a', | |
534 | + 'output': '⠼⠁⠃⠉⠰⠁', | |
535 | + }, | |
536 | + { | |
537 | + 'input': '123A', | |
538 | + 'output': '⠼⠁⠃⠉⠰⠠⠁', | |
539 | + }, | |
540 | + { | |
541 | + 'input': '1アa1aキャA1Aア', | |
542 | + 'output': '⠼⠁⠤⠁⠰⠁⠼⠁⠰⠁⠤⠈⠡⠰⠠⠁⠼⠁⠰⠠⠁⠤⠁', | |
543 | + }, | |
544 | + { | |
545 | + 'input': '⠀ア', | |
546 | + 'output': ' ⠁', | |
547 | + 'inpos1': [0,1], | |
548 | + 'comment': 'braille space should be changed to 0x20.', | |
549 | + }, | |
550 | + { | |
551 | + 'input': '⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟', | |
552 | + 'output': '⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟', | |
553 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30], | |
554 | + 'comment': 'braille code should not be changed.', | |
555 | + }, | |
556 | + { | |
557 | + 'input': '⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿', | |
558 | + 'output': '⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿', | |
559 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31], | |
560 | + 'comment': 'braille code should not be changed.', | |
561 | + }, | |
562 | + { | |
563 | + 'text': '《本章のねらい》', | |
564 | + 'input': '《ホンショーノ ネライ》', | |
565 | + 'output': '⠐⠶⠮⠴⠈⠺⠒⠎ ⠏⠑⠃⠶⠂', | |
566 | + }, | |
567 | + { | |
568 | + 'text': '二十五', | |
569 | + 'input': '25', | |
570 | + 'output': '⠼⠃⠑', | |
571 | + 'inpos1': [0,0,1], | |
572 | + }, | |
573 | + { | |
574 | + 'text': 'ピクチャ3の12', | |
575 | + 'input': 'ピクチャ3ノ 12', | |
576 | + 'output': '⠠⠧⠩⠈⠕⠼⠉⠎ ⠼⠁⠃', | |
577 | + }, | |
578 | + { | |
579 | + 'text': ' 雨。 晴れ。', | |
580 | + 'input': ' アメ。 ハレ。', | |
581 | + 'output': ' ⠁⠿⠲ ⠥⠛⠲', | |
582 | + 'comment': '先頭のスペースを除去しない' | |
583 | + }, | |
584 | + { | |
585 | + 'text': '大文字', | |
586 | + 'input': 'オーモジ', | |
587 | + }, | |
588 | + { | |
589 | + 'text': 'システムキャレット', | |
590 | + 'input': 'システム キャレット', | |
591 | + }, | |
592 | + { | |
593 | + 'text': 'フィードバック', | |
594 | + 'input': 'フィード バック', | |
595 | + }, | |
596 | + { | |
597 | + 'text': 'インターフェース', | |
598 | + 'input': 'インター フェース', | |
599 | + }, | |
600 | + { | |
601 | + 'text': 'オペレーティングシステム', | |
602 | + 'input': 'オペレーティング システム', | |
603 | + }, | |
604 | + #{ | |
605 | + # 'text': 'トーキングインストーラー', | |
606 | + # 'input': 'トーキング インストーラー', | |
607 | + # }, | |
608 | + { | |
609 | + 'text': 'アイスクリーム', | |
610 | + 'input': 'アイス クリーム', | |
611 | + }, | |
612 | + { | |
613 | + 'text': '日本点字図書館', | |
614 | + 'input': 'ニッポン テンジ トショカン' | |
615 | + }, | |
616 | + { | |
617 | + 'text': '通り', | |
618 | + 'input': 'トオリ', | |
619 | + }, | |
620 | + { | |
621 | + 'text': 'ねえ', | |
622 | + 'input': 'ネエ', | |
623 | + }, | |
624 | + { | |
625 | + 'text': '通り', 'input': 'トオリ' | |
626 | + }, | |
627 | + { | |
628 | + 'text': '狼', 'input': 'オオカミ' | |
629 | + }, | |
630 | + { | |
631 | + 'text': '通る', 'input': 'トオル' | |
632 | + }, | |
633 | + { | |
634 | + 'text': '多い', 'input': 'オオイ' | |
635 | + }, | |
636 | + { | |
637 | + 'text': '多く', 'input': 'オオク' | |
638 | + }, | |
639 | + { | |
640 | + 'text': '大晦日', 'input': 'オオミソカ' | |
641 | + }, | |
642 | + { | |
643 | + 'text': '手作り', 'input': 'テヅクリ' | |
644 | + }, | |
645 | + { | |
646 | + 'text': '南半球', 'input': 'ミナミ ハンキュー' | |
647 | + }, | |
648 | + { | |
649 | + 'text': 'アメリカ合衆国', 'input': 'アメリカ ガッシューコク' | |
650 | + }, | |
651 | + { | |
652 | + 'text': '第一人者', 'input': 'ダイ1ニンシャ' | |
653 | + }, | |
654 | + { | |
655 | + 'text': '一流', 'input': '1リュー' | |
656 | + }, | |
657 | + { | |
658 | + 'text': '一月', 'input': '1ガツ' | |
659 | + }, | |
660 | + { | |
661 | + 'text': '二月', 'input': '2ガツ' | |
662 | + }, | |
663 | + { | |
664 | + 'text': '四方', 'input': '4ホー' | |
665 | + }, | |
666 | + { | |
667 | + 'text': '六法全書', 'input': '6ポー ゼンショ' | |
668 | + }, | |
669 | + { | |
670 | + 'text': '百人一首', 'input': '100ニン 1シュ' | |
671 | + }, | |
672 | + { | |
673 | + 'text': 'ヱビスビール', 'input': 'エビス ビール' | |
674 | + }, | |
675 | + { | |
676 | + 'text': '日本コロムビア', 'input': 'ニッポン コロムビア' | |
677 | + }, | |
678 | + { | |
679 | + 'text': 'ビタミンE', 'input': 'ビタミン E' | |
680 | + }, | |
681 | + { | |
682 | + 'text': '劇団四季', 'input': 'ゲキダン 4キ' | |
683 | + }, | |
684 | + { | |
685 | + 'text': '四季', 'input': '4キ' | |
686 | + }, | |
687 | + { | |
688 | + 'text': '四半期', 'input': '4ハンキ' | |
689 | + }, | |
690 | + { | |
691 | + 'text': '四角形', 'input': '4カクケイ' | |
692 | + }, | |
693 | + { | |
694 | + 'text': '四条', 'input': '4ジョー' | |
695 | + }, | |
696 | + { | |
697 | + 'text': '二男', 'input': '2ナン' | |
698 | + }, | |
699 | + { | |
700 | + 'text': '十数', 'input': '10スー' | |
701 | + }, | |
702 | + { | |
703 | + 'text': '一輪車', 'input': '1リンシャ' | |
704 | + }, | |
705 | + { | |
706 | + 'text': '三塁打', 'input': '3ルイダ' | |
707 | + }, | |
708 | + { | |
709 | + 'text': '一汁一菜', 'input': '1ジュー 1サイ' | |
710 | + }, | |
711 | + { | |
712 | + 'text': '五臓六腑', 'input': '5ゾー 6プ' | |
713 | + }, | |
714 | + { | |
715 | + 'text': '一段', 'input': '1ダン' | |
716 | + }, | |
717 | + { | |
718 | + 'text': '七転び八起き', 'input': 'ナナコロビ ヤオキ' | |
719 | + }, | |
720 | + { | |
721 | + 'text': '十重二十重', 'input': 'トエ ハタエ' | |
722 | + }, | |
723 | + { | |
724 | + 'text': '3ラン', 'input': '3ラン' | |
725 | + }, | |
726 | + { | |
727 | + 'text': 'さんりんしゃ', 'input': '3リンシャ' | |
728 | + }, | |
729 | + { | |
730 | + 'text': 'いちばん', 'input': '1バン' | |
731 | + }, | |
732 | + { | |
733 | + 'text': 'X線', 'input': 'Xセン' | |
734 | + }, | |
735 | + | |
736 | + {'text':'触読', 'input':'ショクドク'}, | |
737 | + {'text':'触読式時計', 'input':'ショクドクシキ トケイ'}, | |
738 | + {'text':'触手話', 'input':'ショクシュワ'}, | |
739 | + {'text':'触読手話', 'input':'ショクドク シュワ'}, | |
740 | + | |
741 | + {'text':'泉質', 'input':'センシツ'}, | |
742 | + {'text':'硫酸塩', 'input':'リューサンエン'}, | |
743 | + {'text':'硫酸塩泉', 'input':'リューサンエンセン'}, | |
744 | + {'text':'塩化物泉', 'input':'エンカブッセン'}, | |
745 | + {'text':'泉温', 'input':'センオン'}, | |
746 | + {'text':'冷鉱泉', 'input':'レイコーセン'}, | |
747 | + {'text':'微温泉', 'input':'ビオンセン'}, | |
748 | + {'text':'療養泉', 'input':'リョーヨーセン'}, | |
749 | + {'text':'低張性', 'input':'テイチョーセイ'}, | |
750 | + {'text':'等張性', 'input':'トーチョーセイ'}, | |
751 | + {'text':'高張性', 'input':'コーチョーセイ'}, | |
752 | + {'text':'酸性泉', 'input':'サンセイセン'}, | |
753 | + {'text':'放射能泉', 'input':'ホーシャノーセン'}, | |
754 | + | |
755 | + {'text':'晴れ所により一時雨', 'input':'ハレ トコロニ ヨリ イチジ アメ'}, | |
756 | + | |
757 | + { 'note': '+ NVDA点字表示の誤りへの対応 +' }, | |
758 | + { | |
759 | + 'comment': 'NVDA点字表示の誤り No.1', | |
760 | + 'text': '誤判定', | |
761 | + 'input': 'ゴハンテイ', | |
762 | + 'output': '⠐⠪⠥⠴⠟⠃', | |
763 | + }, | |
764 | + { | |
765 | + 'text': '判定', | |
766 | + 'input': 'ハンテイ', | |
767 | + 'output': '⠥⠴⠟⠃', | |
768 | + 'inpos1': [0,1,2,3], | |
769 | + }, | |
770 | + { | |
771 | + 'comment': 'NVDA点字表示の誤り No.2', | |
772 | + 'text': '50音順', | |
773 | + 'input': '50オンジュン', | |
774 | + 'output': '⠼⠑⠚⠤⠊⠴⠘⠹⠴', | |
775 | + }, | |
776 | + { | |
777 | + 'comment': 'NVDA点字表示の誤り No.3', | |
778 | + 'text': '下矢印', | |
779 | + 'input': 'シタヤジルシ', | |
780 | + 'output': '⠳⠕⠌⠐⠳⠙⠳', | |
781 | + }, | |
782 | + { | |
783 | + 'comment': 'NVDA点字表示の誤り No.4', | |
784 | + 'text': '上矢印', | |
785 | + 'input': 'ウエヤジルシ', | |
786 | + 'output': '⠉⠋⠌⠐⠳⠙⠳', | |
787 | + }, | |
788 | + { | |
789 | + 'comment': 'NVDA点字表示の誤り No.5', | |
790 | + 'text': '大見出し', | |
791 | + 'input': 'オオミダシ', | |
792 | + 'output': '⠊⠊⠷⠐⠕⠳', | |
793 | + }, | |
794 | + { | |
795 | + 'comment': 'NVDA点字表示の誤り No.6', | |
796 | + 'text': '前景色', | |
797 | + 'input': 'ゼンケイショク', | |
798 | + 'output': '⠐⠻⠴⠫⠃⠈⠺⠩', | |
799 | + }, | |
800 | + { | |
801 | + 'comment': 'NVDA点字表示の誤り No.7', | |
802 | + 'text': '表計算', | |
803 | + 'input': 'ヒョーケイサン', | |
804 | + 'output': '⠈⠮⠒⠫⠃⠱⠴', | |
805 | + }, | |
806 | + { | |
807 | + 'comment': 'NVDA点字表示の誤り No.8', | |
808 | + 'text': '材販', | |
809 | + 'input': 'ザイハン', | |
810 | + 'output': '⠐⠱⠃⠥⠴', | |
811 | + }, | |
812 | + { | |
813 | + 'comment': 'NVDA点字表示の誤り No.9', | |
814 | + 'text': '孫正義', | |
815 | + 'input': 'ソン マサヨシ', | |
816 | + 'output': '⠺⠴ ⠵⠱⠜⠳', | |
817 | + 'inpos1': [0,1,2,3,4,5,6], | |
818 | + }, | |
819 | + { | |
820 | + 'comment': 'NVDA点字表示の誤り No.10', | |
821 | + 'text': '昔々', | |
822 | + 'input': 'ムカシ ムカシ', | |
823 | + 'output': '⠽⠡⠳ ⠽⠡⠳', | |
824 | + 'inpos1': [0,1,2,3,4,5,6], | |
825 | + }, | |
826 | + { | |
827 | + 'comment': 'NVDA点字表示の誤り No.11', | |
828 | + 'text': '梅雨前線', | |
829 | + 'input': 'バイウ ゼンセン', | |
830 | + 'output': '⠐⠥⠃⠉ ⠐⠻⠴⠻⠴', | |
831 | + }, | |
832 | + { | |
833 | + 'comment': 'NVDA点字表示の誤り No.12', | |
834 | + 'text': '八ッ場ダム', | |
835 | + 'input': 'ヤンバダム', | |
836 | + 'output': '⠌⠴⠐⠥⠐⠕⠽', | |
837 | + }, | |
838 | + { | |
839 | + 'comment': 'NVDA点字表示の誤り No.13', | |
840 | + 'text': '1都5県', | |
841 | + 'input': 'イットゴケン', | |
842 | + 'output': '⠃⠂⠞⠐⠪⠫⠴', | |
843 | + }, | |
844 | + { | |
845 | + 'comment': 'NVDA点字表示の誤り No.14', | |
846 | + 'text': 'お姉さん', | |
847 | + 'input': 'オネエサン', | |
848 | + 'output': '⠊⠏⠋⠱⠴', | |
849 | + 'inpos1': [0,1,2,3,4], | |
850 | + }, | |
851 | + { | |
852 | + 'comment': 'NVDA点字表示の誤り No.15', | |
853 | + 'text': 'お兄さん', | |
854 | + 'input': 'オニイサン', | |
855 | + 'output': '⠊⠇⠃⠱⠴', | |
856 | + 'inpos1': [0,1,2,3,4], | |
857 | + }, | |
858 | + { | |
859 | + 'comment': 'NVDA点字表示の誤り No.16', | |
860 | + 'text': 'お婆さん', | |
861 | + 'input': 'オバアサン', | |
862 | + 'output': '⠊⠐⠥⠁⠱⠴', | |
863 | + }, | |
864 | + { | |
865 | + 'comment': 'NVDA点字表示の誤り No.17', | |
866 | + 'text': 'お爺さん', | |
867 | + 'input': 'オジイサン', | |
868 | + 'output': '⠊⠐⠳⠃⠱⠴', | |
869 | + }, | |
870 | + { | |
871 | + 'comment': 'NVDA点字表示の誤り No.18', | |
872 | + 'text': '1月', | |
873 | + 'input': '1ガツ', | |
874 | + 'output': '⠼⠁⠐⠡⠝', | |
875 | + }, | |
876 | + { | |
877 | + 'comment': 'NVDA点字表示の誤り No.19', | |
878 | + 'text': '盲ろう者', | |
879 | + 'input': 'モーローシャ', | |
880 | + 'output': '⠾⠒⠚⠒⠈⠱', | |
881 | + }, | |
882 | + { | |
883 | + 'comment': 'NVDA点字表示の誤り No.20', | |
884 | + 'text': 'のように', | |
885 | + 'input': 'ノヨーニ', | |
886 | + 'output': '⠎⠜⠒⠇', | |
887 | + 'inpos1': [0,1,2,3], | |
888 | + }, | |
889 | + { | |
890 | + 'comment': 'NVDA点字表示の誤り No.21', | |
891 | + 'text': '1回', | |
892 | + 'input': '1カイ', | |
893 | + 'output': '⠼⠁⠡⠃', | |
894 | + }, | |
895 | + { | |
896 | + 'comment': 'NVDA点字表示の誤り No.22', | |
897 | + 'text': 'いいんですけど', | |
898 | + 'input': 'イインデスケド', | |
899 | + 'output': '⠃⠃⠴⠐⠟⠹⠫⠐⠞', | |
900 | + }, | |
901 | + { 'note': '+ 点訳のてびき第3版 +' }, | |
902 | + { 'note': '== 第2章 語の書き表し方 ==' }, | |
903 | + { 'note': '=== その1 仮名遣い ===' }, | |
904 | + { 'note': '==== 1 基本的な仮名遣い ====' }, | |
905 | + { 'note': '1、直音(清音・濁音・半濁音)は、現代仮名遣いに準じて書く。' }, | |
906 | + { | |
907 | + 'comment': '点訳のてびき第3版 第2章 その1 1 1 No.1', | |
908 | + 'text': '未曾有', | |
909 | + 'input': 'ミゾウ', | |
910 | + 'output': '⠷⠐⠺⠉', | |
911 | + }, | |
912 | + { 'note': '【備考1】助詞の「を」は、発音に関わりなく「ヲ」と書くが、助詞の「は」「へ」は、発音するとおりに「ワ」「エ」と書く。' }, | |
913 | + { | |
914 | + 'comment': '点訳のてびき第3版 第2章 その1 1 1 No.17', | |
915 | + 'text': '駅へは', | |
916 | + 'input': 'エキエワ', | |
917 | + 'output': '⠋⠣⠋⠄', | |
918 | + 'inpos1': [0,1,2,3], | |
919 | + }, | |
920 | + { | |
921 | + 'comment': '点訳のてびき第3版 第2章 その1 1 1 No.22', | |
922 | + 'text': 'えきへは', | |
923 | + 'input': 'エキエワ', | |
924 | + 'output': '⠋⠣⠋⠄', | |
925 | + 'inpos1': [0,1,2,3], | |
926 | + }, | |
927 | + { | |
928 | + 'comment': '点訳のてびき第3版 第2章 その1 1 1 No.23', | |
929 | + 'text': 'ははへの', | |
930 | + 'input': 'ハハエノ', | |
931 | + 'output': '⠥⠥⠋⠎', | |
932 | + 'inpos1': [0,1,2,3], | |
933 | + }, | |
934 | + { 'note': '【備考2】「言う」の語幹は、「ユ」と発音しても常に「イ」と書く。' }, | |
935 | + { | |
936 | + 'comment': '点訳のてびき第3版 第2章 その1 1 1 No.25', | |
937 | + 'text': '言うて', | |
938 | + 'input': 'イウテ', | |
939 | + 'output': '⠃⠉⠟', | |
940 | + 'inpos1': [0,1,2], | |
941 | + }, | |
942 | + { 'note': '2、拗音(拗濁音・拗半濁音を含む)は、拗音点字を用いて書く。' }, | |
943 | + { | |
944 | + 'comment': '点訳のてびき第3版 第2章 その1 1 2 No.1', | |
945 | + 'text': '距離', | |
946 | + 'input': 'キョリ', | |
947 | + 'output': '⠈⠪⠓', | |
948 | + }, | |
949 | + | |
950 | + { 'note': '3、撥音(ん)は、撥音符を用いて書く。' }, | |
951 | + { | |
952 | + 'comment': '点訳のてびき第3版 第2章 その1 1 3 No.4', | |
953 | + 'text': '何百', | |
954 | + 'input': 'ナンビャク', | |
955 | + 'output': '⠅⠴⠘⠥⠩', | |
956 | + }, | |
957 | + { 'note': '4、促音(っ)は、促音符を用いて書く。' }, | |
958 | + { | |
959 | + 'comment': '点訳のてびき第3版 第2章 その1 1 4 No.11', | |
960 | + 'text': '夫', | |
961 | + 'input': 'オット', | |
962 | + 'output': '⠊⠂⠞', | |
963 | + }, | |
964 | + { 'note': '〈処理〉「き」「く」「つ」が促音化しているかどうかは、辞書で確認するが、辞書によって表記が異なるなど判断が難しい場合は、促音符を用いず、その部分を「キ」「ク」「ツ」と書く。' }, | |
965 | + { | |
966 | + 'comment': '点訳のてびき第3版 第2章 その1 1 4 No.10', | |
967 | + 'text': '万国旗', | |
968 | + 'input': 'バンコクキ', | |
969 | + 'output': '⠐⠥⠴⠪⠩⠣', | |
970 | + }, | |
971 | + { | |
972 | + 'comment': '点訳のてびき第3版 第2章 その1 1 4 No.11', | |
973 | + 'text': '多角形', | |
974 | + 'input': 'タカクケイ', | |
975 | + 'output': '⠕⠡⠩⠫⠃', | |
976 | + }, | |
977 | + { | |
978 | + 'comment': '点訳のてびき第3版 第2章 その1 1 4 No.14', | |
979 | + 'text': '高脂血症', | |
980 | + 'input': 'コーシケツショー', | |
981 | + 'output': '⠪⠒⠳⠫⠝⠈⠺⠒', | |
982 | + }, | |
983 | + { 'note': '5、長音の書き表し方' }, | |
984 | + { 'note': '(1)ア列の長音はア列の仮名に「ア」を添え、イ列とエ列の長音はイ列・エ列の仮名に「イ」を添えて書く。' }, | |
985 | + { | |
986 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.1', | |
987 | + 'text': 'ああ', | |
988 | + 'input': 'アア', | |
989 | + 'output': '⠁⠁', | |
990 | + 'inpos1': [0,1], | |
991 | + }, | |
992 | + { | |
993 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.2', | |
994 | + 'text': 'お母さん', | |
995 | + 'input': 'オカアサン', | |
996 | + 'output': '⠊⠡⠁⠱⠴', | |
997 | + 'inpos1': [0,1,2,3,4], | |
998 | + }, | |
999 | + { | |
1000 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.3', | |
1001 | + 'text': 'いいえ', | |
1002 | + 'input': 'イイエ', | |
1003 | + 'output': '⠃⠃⠋', | |
1004 | + 'inpos2': [0,1,2], | |
1005 | + 'inpos1': [0,1,2], | |
1006 | + 'inpos': [0,1,2], | |
1007 | + }, | |
1008 | + { | |
1009 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.4', | |
1010 | + 'text': 'お兄さん', | |
1011 | + 'input': 'オニイサン', | |
1012 | + 'output': '⠊⠇⠃⠱⠴', | |
1013 | + 'inpos1': [0,1,2,3,4], | |
1014 | + }, | |
1015 | + { | |
1016 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.5', | |
1017 | + 'text': '先生', | |
1018 | + 'input': 'センセイ', | |
1019 | + 'output': '⠻⠴⠻⠃', | |
1020 | + 'inpos1': [0,1,2,3], | |
1021 | + }, | |
1022 | + { 'note': '【備考】エ列の長音のうち和語は「エ」を添えて書く。' }, | |
1023 | + { | |
1024 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.13', | |
1025 | + 'text': 'お姉さん', | |
1026 | + 'input': 'オネエサン', | |
1027 | + 'output': '⠊⠏⠋⠱⠴', | |
1028 | + 'inpos1': [0,1,2,3,4], | |
1029 | + }, | |
1030 | + { | |
1031 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.14', | |
1032 | + 'text': 'へえ', | |
1033 | + 'input': 'ヘエ', | |
1034 | + 'output': '⠯⠋', | |
1035 | + 'inpos2': [0,1], | |
1036 | + 'inpos1': [0,1], | |
1037 | + 'inpos': [0,1], | |
1038 | + }, | |
1039 | + { | |
1040 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.15', | |
1041 | + 'text': 'べらんめえ', | |
1042 | + 'input': 'ベランメエ', | |
1043 | + 'output': '⠐⠯⠑⠴⠿⠋', | |
1044 | + 'inpos2': [0,1,2,3,4], | |
1045 | + 'inpos1': [0,0,1,2,3,4], | |
1046 | + 'inpos': [0,0,1,2,3,4], | |
1047 | + }, | |
1048 | + { 'note': '〈処理1〉原文で小文字の仮名が長音を表しているときは、原文に使われている仮名を添えて書く。' }, | |
1049 | + { | |
1050 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.16', | |
1051 | + 'text': 'やったぁ', | |
1052 | + 'input': 'ヤッタア', | |
1053 | + 'output': '⠌⠂⠕⠁', | |
1054 | + 'inpos2': [0,1,2,3], | |
1055 | + 'inpos1': [0,1,2,3], | |
1056 | + 'inpos': [0,1,2,3], | |
1057 | + }, | |
1058 | + { | |
1059 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.17', | |
1060 | + 'text': '君ィ', | |
1061 | + 'input': 'キミイ', | |
1062 | + 'output': '⠣⠷⠃', | |
1063 | + 'inpos1': [0,1,2], | |
1064 | + }, | |
1065 | + { 'note': '〈処理2〉原文に長音符号(-)が使われているときは、それにしたがって長音符を用いて書く。' }, | |
1066 | + { | |
1067 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.18', | |
1068 | + 'text': 'はんたーい', | |
1069 | + 'input': 'ハンターイ', | |
1070 | + 'output': '⠥⠴⠕⠒⠃', | |
1071 | + 'inpos2': [0,1,2,3,4], | |
1072 | + 'inpos1': [0,1,2,3,4], | |
1073 | + 'inpos': [0,1,2,3,4], | |
1074 | + }, | |
1075 | + { 'note': '(2)ウ列とオ列の長音は、ウ列・オ列の仮名に長音符を添えて書く。' }, | |
1076 | + { | |
1077 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.22', | |
1078 | + 'text': '宇宙', | |
1079 | + 'input': 'ウチュー', | |
1080 | + 'output': '⠉⠈⠝⠒', | |
1081 | + }, | |
1082 | + { | |
1083 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.30', | |
1084 | + 'text': 'お父さん', | |
1085 | + 'input': 'オトーサン', | |
1086 | + 'output': '⠊⠞⠒⠱⠴', | |
1087 | + 'inpos1': [0,1,2,3,4], | |
1088 | + }, | |
1089 | + { | |
1090 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.34', | |
1091 | + 'text': '八日', | |
1092 | + 'input': 'ヨーカ', | |
1093 | + 'output': '⠜⠒⠡', | |
1094 | + 'inpos1': [0,1,2], | |
1095 | + }, | |
1096 | + { | |
1097 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.35', | |
1098 | + 'text': '絵を見よう', | |
1099 | + 'input': 'エヲ ミヨー', | |
1100 | + 'output': '⠋⠔ ⠷⠜⠒', | |
1101 | + 'inpos1': [0,1,2,3,4,5], | |
1102 | + }, | |
1103 | + { | |
1104 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.36', | |
1105 | + 'text': '運動しよう', | |
1106 | + 'input': 'ウンドー シヨー', | |
1107 | + 'output': '⠉⠴⠐⠞⠒ ⠳⠜⠒', | |
1108 | + 'inpos1': [0,1,2,2,3,4,5,6,7], | |
1109 | + }, | |
1110 | + { | |
1111 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.37', | |
1112 | + 'text': 'そのような', | |
1113 | + 'input': 'ソノヨーナ', | |
1114 | + 'output': '⠺⠎⠜⠒⠅', | |
1115 | + 'inpos1': [0,1,2,3,4], | |
1116 | + }, | |
1117 | + { | |
1118 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.38', | |
1119 | + 'text': 'そうだろう', | |
1120 | + 'input': 'ソーダロー', | |
1121 | + 'output': '⠺⠒⠐⠕⠚⠒', | |
1122 | + 'inpos2': [0,1,2,3,4], | |
1123 | + 'inpos1': [0,1,2,2,3,4], | |
1124 | + 'inpos': [0,1,2,2,3,4], | |
1125 | + }, | |
1126 | + { | |
1127 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.39', | |
1128 | + 'text': '何と言おうか', | |
1129 | + 'input': 'ナント イオーカ', | |
1130 | + 'output': '⠅⠴⠞ ⠃⠊⠒⠡', | |
1131 | + 'inpos1': [0,1,2,3,4,5,6,7], | |
1132 | + }, | |
1133 | + { | |
1134 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.40', | |
1135 | + 'text': '見まごうばかり', | |
1136 | + 'input': 'ミマゴーバカリ', | |
1137 | + 'output': '⠷⠵⠐⠪⠒⠐⠥⠡⠓', | |
1138 | + 'inpos2': [0,1,2,3,4,5,6], | |
1139 | + 'inpos1': [0,1,2,2,3,4,4,5,6], | |
1140 | + 'inpos': [0,1,2,2,3,4,4,5,6], | |
1141 | + }, | |
1142 | + { 'note': '【備考1】動詞の語尾の「う」は、「ウ」と書く。' }, | |
1143 | + { | |
1144 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.42', | |
1145 | + 'text': '縫う', | |
1146 | + 'input': 'ヌウ', | |
1147 | + 'output': '⠍⠉', | |
1148 | + 'inpos1': [0,1], | |
1149 | + }, | |
1150 | + { 'note': '【備考2】ウ音便はウ列・オ列の長音の表記との関連で、長音符を用いて書く。' }, | |
1151 | + { | |
1152 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.50', | |
1153 | + 'text': 'ゆうて', | |
1154 | + 'input': 'ユーテ', | |
1155 | + 'output': '⠬⠒⠟', | |
1156 | + 'inpos2': [0,1,2], | |
1157 | + 'inpos1': [0,1,2], | |
1158 | + 'inpos': [0,1,2], | |
1159 | + }, | |
1160 | + { | |
1161 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.51', | |
1162 | + 'text': '思うて', | |
1163 | + 'input': 'オモーテ', | |
1164 | + 'output': '⠊⠾⠒⠟', | |
1165 | + 'inpos1': [0,1,2,3], | |
1166 | + }, | |
1167 | + { | |
1168 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.52', | |
1169 | + 'text': '吸うたり', | |
1170 | + 'input': 'スータリ', | |
1171 | + 'output': '⠹⠒⠕⠓', | |
1172 | + 'inpos2': [0,1,2,3], | |
1173 | + 'inpos1': [0,1,2,3], | |
1174 | + 'inpos': [0,1,2,3], | |
1175 | + }, | |
1176 | + { | |
1177 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.53', | |
1178 | + 'text': '繕うたり', | |
1179 | + 'input': 'ツクロータリ', | |
1180 | + 'output': '⠝⠩⠚⠒⠕⠓', | |
1181 | + 'inpos1': [0,1,2,3,4,5], | |
1182 | + }, | |
1183 | + { | |
1184 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.54', | |
1185 | + 'text': '縫うた', | |
1186 | + 'input': 'ヌータ', | |
1187 | + 'output': '⠍⠒⠕', | |
1188 | + 'inpos2': [0,1,2], | |
1189 | + 'inpos1': [0,1,2], | |
1190 | + 'inpos': [0,1,2], | |
1191 | + }, | |
1192 | + { | |
1193 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.55', | |
1194 | + 'text': '買うた', | |
1195 | + 'input': 'コータ', | |
1196 | + 'output': '⠪⠒⠕', | |
1197 | + 'inpos2': [0,1,2], | |
1198 | + 'inpos1': [0,1,2], | |
1199 | + 'inpos': [0,1,2], | |
1200 | + }, | |
1201 | + { | |
1202 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.56', | |
1203 | + 'text': 'うれしゅう', | |
1204 | + 'input': 'ウレシュー', | |
1205 | + 'output': '⠉⠛⠈⠹⠒', | |
1206 | + 'inpos2': [0,1,2,3,4], | |
1207 | + 'inpos1': [0,1,2,2,4], | |
1208 | + 'inpos': [0,1,2,2,4], | |
1209 | + }, | |
1210 | + { | |
1211 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.57', | |
1212 | + 'text': '面白うて', | |
1213 | + 'input': 'オモシローテ', | |
1214 | + 'output': '⠊⠾⠳⠚⠒⠟', | |
1215 | + 'inpos1': [0,1,2,3,4,5], | |
1216 | + }, | |
1217 | + { 'note': '【備考3】オ列の長音のうち、次の一覧表に掲げた和語とその派生語や複合語は「オ」を添えて書く。' }, | |
1218 | + { | |
1219 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.58', | |
1220 | + 'text': '多い', | |
1221 | + 'input': 'オオイ', | |
1222 | + 'output': '⠊⠊⠃', | |
1223 | + 'inpos1': [0,1,2], | |
1224 | + }, | |
1225 | + { | |
1226 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.59', | |
1227 | + 'text': '覆う', | |
1228 | + 'input': 'オオウ', | |
1229 | + 'output': '⠊⠊⠉', | |
1230 | + 'inpos1': [0,1,2], | |
1231 | + }, | |
1232 | + { | |
1233 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.60', | |
1234 | + 'text': '狼', | |
1235 | + 'input': 'オオカミ', | |
1236 | + 'output': '⠊⠊⠡⠷', | |
1237 | + 'inpos2': [0,0,0,0], | |
1238 | + 'inpos1': [0,1,2,3], | |
1239 | + 'inpos': [0,0,0,0], | |
1240 | + }, | |
1241 | + { | |
1242 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.61', | |
1243 | + 'text': '大きい', | |
1244 | + 'input': 'オオキイ', | |
1245 | + 'output': '⠊⠊⠣⠃', | |
1246 | + 'inpos1': [0,1,2,3], | |
1247 | + }, | |
1248 | + { | |
1249 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.62', | |
1250 | + 'text': '仰せ', | |
1251 | + 'input': 'オオセ', | |
1252 | + 'output': '⠊⠊⠻', | |
1253 | + 'inpos1': [0,1,2], | |
1254 | + }, | |
1255 | + { | |
1256 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.63', | |
1257 | + 'text': '為おおせる', | |
1258 | + 'input': 'シオオセル', | |
1259 | + 'output': '⠳⠊⠊⠻⠙', | |
1260 | + 'inpos2': [0,1,2,3,4], | |
1261 | + 'inpos1': [0,1,2,3,4], | |
1262 | + 'inpos': [0,1,2,3,4], | |
1263 | + }, | |
1264 | + { | |
1265 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.64', | |
1266 | + 'text': '車前草', | |
1267 | + 'input': 'オオバコ', | |
1268 | + 'output': '⠊⠊⠐⠥⠪', | |
1269 | + 'inpos1': [0,1,2,2,3], | |
1270 | + }, | |
1271 | + { | |
1272 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.65', | |
1273 | + 'text': '概ね', | |
1274 | + 'input': 'オオムネ', | |
1275 | + 'output': '⠊⠊⠽⠏', | |
1276 | + 'inpos1': [0,1,2,3], | |
1277 | + }, | |
1278 | + { | |
1279 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.66', | |
1280 | + 'text': '公', | |
1281 | + 'input': 'オオヤケ', | |
1282 | + 'output': '⠊⠊⠌⠫', | |
1283 | + 'inpos2': [0,0,0,0], | |
1284 | + 'inpos1': [0,1,2,3], | |
1285 | + 'inpos': [0,0,0,0], | |
1286 | + }, | |
1287 | + { | |
1288 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.67', | |
1289 | + 'text': '凡そ', | |
1290 | + 'input': 'オオヨソ', | |
1291 | + 'output': '⠊⠊⠜⠺', | |
1292 | + 'inpos1': [0,1,2,3], | |
1293 | + }, | |
1294 | + { | |
1295 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.68', | |
1296 | + 'text': '氷', | |
1297 | + 'input': 'コオリ', | |
1298 | + 'output': '⠪⠊⠓', | |
1299 | + 'inpos2': [0,0,0], | |
1300 | + 'inpos1': [0,1,2], | |
1301 | + 'inpos': [0,0,0], | |
1302 | + }, | |
1303 | + { | |
1304 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.69', | |
1305 | + # 'text': '郡', | |
1306 | + 'input': 'コオリ', | |
1307 | + 'output': '⠪⠊⠓', | |
1308 | + 'inpos1': [0,1,2], | |
1309 | + 'comment': '郡: 文脈がないと読みを確定できない', | |
1310 | + }, | |
1311 | + { | |
1312 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.70', | |
1313 | + 'text': '凍る', | |
1314 | + 'input': 'コオル', | |
1315 | + 'output': '⠪⠊⠙', | |
1316 | + 'inpos1': [0,1,2], | |
1317 | + }, | |
1318 | + { | |
1319 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.71', | |
1320 | + 'text': '滞る', | |
1321 | + 'input': 'トドコオル', | |
1322 | + 'output': '⠞⠐⠞⠪⠊⠙', | |
1323 | + }, | |
1324 | + { | |
1325 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.72', | |
1326 | + 'text': '蟋蟀', | |
1327 | + 'input': 'コオロギ', | |
1328 | + 'output': '⠪⠊⠚⠐⠣', | |
1329 | + }, | |
1330 | + { | |
1331 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.73', | |
1332 | + 'text': '装う', | |
1333 | + 'input': 'ヨソオウ', | |
1334 | + 'output': '⠜⠺⠊⠉', | |
1335 | + 'inpos1': [0,1,2,3], | |
1336 | + }, | |
1337 | + { | |
1338 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.74', | |
1339 | + # 'text': '十', | |
1340 | + 'input': 'トオ', | |
1341 | + 'output': '⠞⠊', | |
1342 | + 'inpos1': [0,1], | |
1343 | + 'comment': '十: 文脈がないと読みを確定できない', | |
1344 | + }, | |
1345 | + { | |
1346 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.75', | |
1347 | + 'text': '遠い', | |
1348 | + 'input': 'トオイ', | |
1349 | + 'output': '⠞⠊⠃', | |
1350 | + 'inpos1': [0,1,2], | |
1351 | + }, | |
1352 | + { | |
1353 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.76', | |
1354 | + 'text': '通る', | |
1355 | + 'input': 'トオル', | |
1356 | + 'output': '⠞⠊⠙', | |
1357 | + 'inpos1': [0,1,2], | |
1358 | + }, | |
1359 | + { | |
1360 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.77', | |
1361 | + 'text': '憤る', | |
1362 | + 'input': 'イキドオル', | |
1363 | + 'output': '⠃⠣⠐⠞⠊⠙', | |
1364 | + }, | |
1365 | + { | |
1366 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.78', | |
1367 | + 'text': 'いとおしい', | |
1368 | + 'input': 'イトオシイ', | |
1369 | + 'output': '⠃⠞⠊⠳⠃', | |
1370 | + 'inpos1': [0,1,2,3,4], | |
1371 | + }, | |
1372 | + { | |
1373 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.79', | |
1374 | + 'text': '炎', | |
1375 | + 'input': 'ホノオ', | |
1376 | + 'output': '⠮⠎⠊', | |
1377 | + 'inpos1': [0,1,2], | |
1378 | + }, | |
1379 | + { | |
1380 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.80', | |
1381 | + 'text': '頬', | |
1382 | + 'input': 'ホオ', | |
1383 | + 'output': '⠮⠊', | |
1384 | + 'inpos1': [0,1], | |
1385 | + }, | |
1386 | + { | |
1387 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.81', | |
1388 | + 'text': '朴', | |
1389 | + 'input': 'ホオ', | |
1390 | + 'output': '⠮⠊', | |
1391 | + 'inpos1': [0,1], | |
1392 | + }, | |
1393 | + { | |
1394 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.82', | |
1395 | + 'text': '酸漿', | |
1396 | + 'input': 'ホオズキ', | |
1397 | + 'output': '⠮⠊⠐⠹⠣', | |
1398 | + }, | |
1399 | + { | |
1400 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.83', | |
1401 | + 'text': '催す', | |
1402 | + 'input': 'モヨオス', | |
1403 | + 'output': '⠾⠜⠊⠹', | |
1404 | + 'inpos1': [0,1,2,3], | |
1405 | + }, | |
1406 | + { | |
1407 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.84', | |
1408 | + 'text': '大目', | |
1409 | + 'input': 'オオメ', | |
1410 | + 'output': '⠊⠊⠿', | |
1411 | + 'inpos1': [0,1,2], | |
1412 | + }, | |
1413 | + { | |
1414 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.85', | |
1415 | + 'text': '大通り', | |
1416 | + 'input': 'オオドオリ', | |
1417 | + 'output': '⠊⠊⠐⠞⠊⠓', | |
1418 | + }, | |
1419 | + { | |
1420 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.86', | |
1421 | + 'text': '凍り付く', | |
1422 | + 'input': 'コオリツク', | |
1423 | + 'output': '⠪⠊⠓⠝⠩', | |
1424 | + 'inpos1': [0,1,2,3,4], | |
1425 | + }, | |
1426 | + { | |
1427 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.87', | |
1428 | + 'text': '透徹る', | |
1429 | + 'input': 'スキトオル', | |
1430 | + 'output': '⠹⠣⠞⠊⠙', | |
1431 | + 'inpos1': [0,1,2,3,4], | |
1432 | + }, | |
1433 | + { | |
1434 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.88', | |
1435 | + 'text': '十日', | |
1436 | + 'input': 'トオカ', | |
1437 | + 'output': '⠞⠊⠡', | |
1438 | + 'inpos1': [0,1,2], | |
1439 | + }, | |
1440 | + { | |
1441 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.89', | |
1442 | + 'text': '遠ざかる', | |
1443 | + 'input': 'トオザカル', | |
1444 | + 'output': '⠞⠊⠐⠱⠡⠙', | |
1445 | + }, | |
1446 | + { | |
1447 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.90', | |
1448 | + 'text': '通す', | |
1449 | + 'input': 'トオス', | |
1450 | + 'output': '⠞⠊⠹', | |
1451 | + 'inpos1': [0,1,2], | |
1452 | + }, | |
1453 | + { | |
1454 | + 'comment': '点訳のてびき第3版 第2章 その1 1 5 No.91', | |
1455 | + 'text': '頬張る', | |
1456 | + 'input': 'ホオバル', | |
1457 | + 'output': '⠮⠊⠐⠥⠙', | |
1458 | + }, | |
1459 | + { 'note': '6、「ジ ズ ジャ ジュ ジョ」と「ヂ ヅ ヂャ ヂョ」の使い分け' }, | |
1460 | + { 'note': '(1)サ行を用いることを原則とする。' }, | |
1461 | + { | |
1462 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.1', | |
1463 | + 'text': '根治', | |
1464 | + 'input': 'コンジ', | |
1465 | + 'output': '⠪⠴⠐⠳', | |
1466 | + }, | |
1467 | + { | |
1468 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.2', | |
1469 | + 'text': '砂地', | |
1470 | + 'input': 'スナジ', | |
1471 | + 'output': '⠹⠅⠐⠳', | |
1472 | + }, | |
1473 | + { | |
1474 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.3', | |
1475 | + 'text': '無花果', | |
1476 | + 'input': 'イチジク', | |
1477 | + 'output': '⠃⠗⠐⠳⠩', | |
1478 | + }, | |
1479 | + { | |
1480 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.10', | |
1481 | + 'text': '砂利道', | |
1482 | + 'input': 'ジャリミチ', | |
1483 | + 'output': '⠘⠱⠓⠷⠗', | |
1484 | + }, | |
1485 | + { | |
1486 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.20', | |
1487 | + 'text': '少しずつ', | |
1488 | + 'input': 'スコシズツ', | |
1489 | + 'output': '⠹⠪⠳⠐⠹⠝', | |
1490 | + }, | |
1491 | + { 'note': '(2)タ行同音の連呼によって後ろの音節が濁る場合は、「ヂ」「ヅ」を用いて書く。' }, | |
1492 | + { | |
1493 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.25', | |
1494 | + 'text': '縮む', | |
1495 | + 'input': 'チヂム', | |
1496 | + 'output': '⠗⠐⠗⠽', | |
1497 | + }, | |
1498 | + { | |
1499 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.26', | |
1500 | + 'text': '縮れ', | |
1501 | + 'input': 'チヂレ', | |
1502 | + 'output': '⠗⠐⠗⠛', | |
1503 | + }, | |
1504 | + { | |
1505 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.27', | |
1506 | + 'text': '続く', | |
1507 | + 'input': 'ツヅク', | |
1508 | + 'output': '⠝⠐⠝⠩', | |
1509 | + }, | |
1510 | + { | |
1511 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.28', | |
1512 | + 'text': '手続き', | |
1513 | + 'input': 'テツヅキ', | |
1514 | + 'output': '⠟⠝⠐⠝⠣', | |
1515 | + }, | |
1516 | + { | |
1517 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.29', | |
1518 | + 'text': '綴る', | |
1519 | + 'input': 'ツヅル', | |
1520 | + 'output': '⠝⠐⠝⠙', | |
1521 | + }, | |
1522 | + { | |
1523 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.30', | |
1524 | + 'text': '綴り方', | |
1525 | + 'input': 'ツヅリカタ', | |
1526 | + 'output': '⠝⠐⠝⠓⠡⠕', | |
1527 | + }, | |
1528 | + { | |
1529 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.31', | |
1530 | + 'text': '約やか', | |
1531 | + 'input': 'ツヅマヤカ', | |
1532 | + 'output': '⠝⠐⠝⠵⠌⠡', | |
1533 | + }, | |
1534 | + { | |
1535 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.32', | |
1536 | + 'text': '鼓', | |
1537 | + 'input': 'ツヅミ', | |
1538 | + 'output': '⠝⠐⠝⠷', | |
1539 | + }, | |
1540 | + { | |
1541 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.33', | |
1542 | + 'text': '葛籠', | |
1543 | + 'input': 'ツヅラ', | |
1544 | + 'output': '⠝⠐⠝⠑', | |
1545 | + }, | |
1546 | + { 'note': '(3)2語の複合によってタ行の後半の語頭が濁音に変わる連濁の場合は、「ヂ」「ヅ」「ヂャ」「ヂュ」「ヂョ」を用いて書く。' }, | |
1547 | + { | |
1548 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.34', | |
1549 | + 'text': '鼻血', | |
1550 | + 'input': 'ハナヂ', | |
1551 | + 'output': '⠥⠅⠐⠗', | |
1552 | + }, | |
1553 | + { | |
1554 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.35', | |
1555 | + 'text': '身近', | |
1556 | + 'input': 'ミヂカ', | |
1557 | + 'output': '⠷⠐⠗⠡', | |
1558 | + }, | |
1559 | + { | |
1560 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.36', | |
1561 | + 'text': '底力', | |
1562 | + 'input': 'ソコヂカラ', | |
1563 | + 'output': '⠺⠪⠐⠗⠡⠑', | |
1564 | + }, | |
1565 | + { | |
1566 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.37', | |
1567 | + 'text': '湯呑茶碗', | |
1568 | + 'input': 'ユノミヂャワン', | |
1569 | + 'output': '⠬⠎⠷⠘⠕⠄⠴', | |
1570 | + }, | |
1571 | + { | |
1572 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.38', | |
1573 | + 'text': '一本調子', | |
1574 | + 'input': 'イッポンヂョーシ', | |
1575 | + 'output': '⠃⠂⠠⠮⠴⠘⠞⠒⠳', | |
1576 | + }, | |
1577 | + { | |
1578 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.39', | |
1579 | + 'text': '紅提灯', | |
1580 | + 'input': 'ベニヂョーチン', | |
1581 | + 'output': '⠐⠯⠇⠘⠞⠒⠗⠴', | |
1582 | + }, | |
1583 | + { | |
1584 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.40', | |
1585 | + 'text': '三日月', | |
1586 | + 'input': 'ミカヅキ', | |
1587 | + 'output': '⠷⠡⠐⠝⠣', | |
1588 | + }, | |
1589 | + { | |
1590 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.41', | |
1591 | + 'text': '気付く', | |
1592 | + 'input': 'キヅク', | |
1593 | + 'output': '⠣⠐⠝⠩', | |
1594 | + }, | |
1595 | + { | |
1596 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.42', | |
1597 | + 'text': '小突く', | |
1598 | + 'input': 'コヅク', | |
1599 | + 'output': '⠪⠐⠝⠩', | |
1600 | + }, | |
1601 | + { | |
1602 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.43', | |
1603 | + 'text': '近づく', | |
1604 | + 'input': 'チカヅク', | |
1605 | + 'output': '⠗⠡⠐⠝⠩', | |
1606 | + }, | |
1607 | + { | |
1608 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.44', | |
1609 | + 'text': 'つくづく', | |
1610 | + 'input': 'ツクヅク', | |
1611 | + 'output': '⠝⠩⠐⠝⠩', | |
1612 | + }, | |
1613 | + { | |
1614 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.45', | |
1615 | + 'text': '基づく', | |
1616 | + 'input': 'モトヅク', | |
1617 | + 'output': '⠾⠞⠐⠝⠩', | |
1618 | + }, | |
1619 | + { | |
1620 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.46', | |
1621 | + 'text': '心尽くし', | |
1622 | + 'input': 'ココロヅクシ', | |
1623 | + 'output': '⠪⠪⠚⠐⠝⠩⠳', | |
1624 | + }, | |
1625 | + { | |
1626 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.47', | |
1627 | + 'text': '小包', | |
1628 | + 'input': 'コヅツミ', | |
1629 | + 'output': '⠪⠐⠝⠝⠷', | |
1630 | + }, | |
1631 | + { | |
1632 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.48', | |
1633 | + 'text': '手綱', | |
1634 | + 'input': 'タヅナ', | |
1635 | + 'output': '⠕⠐⠝⠅', | |
1636 | + }, | |
1637 | + { | |
1638 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.49', | |
1639 | + 'text': '常々', | |
1640 | + 'input': 'ツネヅネ', | |
1641 | + 'output': '⠝⠏⠐⠝⠏', | |
1642 | + }, | |
1643 | + { | |
1644 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.50', | |
1645 | + 'text': '働き詰め', | |
1646 | + 'input': 'ハタラキヅメ', | |
1647 | + 'output': '⠥⠕⠑⠣⠐⠝⠿', | |
1648 | + }, | |
1649 | + { | |
1650 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.51', | |
1651 | + 'text': '理詰め', | |
1652 | + 'input': 'リヅメ', | |
1653 | + 'output': '⠓⠐⠝⠿', | |
1654 | + }, | |
1655 | + { | |
1656 | + 'comment': '点訳のてびき第3版 第2章 その1 1 6 No.52', | |
1657 | + 'text': '我慢強い', | |
1658 | + 'input': 'ガマンヅヨイ', | |
1659 | + 'output': '⠐⠡⠵⠴⠐⠝⠜⠃', | |
1660 | + }, | |
1661 | + | |
1662 | + { 'note': '7、現代仮名遣いで書かれた文章の中に歴史的仮名遣いが混じっているときは、現代仮名遣いに直して書く。' }, | |
1663 | + { | |
1664 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.1', | |
1665 | + 'text': 'まづ', | |
1666 | + 'input': 'マズ', | |
1667 | + 'output': '⠵⠐⠹', | |
1668 | + }, | |
1669 | + { | |
1670 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.2', | |
1671 | + 'text': '一つづつ', | |
1672 | + 'input': 'ヒトツズツ', | |
1673 | + 'output': '⠧⠞⠝⠐⠹⠝', | |
1674 | + }, | |
1675 | + { | |
1676 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.3', | |
1677 | + # 'text': 'なほ', | |
1678 | + 'input': 'ナオ', | |
1679 | + 'output': '⠅⠊', | |
1680 | + 'inpos1': [0,1], | |
1681 | + 'comment': '人名「なほ」と区別がつかない', | |
1682 | + }, | |
1683 | + { | |
1684 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.4', | |
1685 | + 'text': '思ふ', | |
1686 | + 'input': 'オモウ', | |
1687 | + 'output': '⠊⠾⠉', | |
1688 | + 'inpos1': [0,1,2], | |
1689 | + }, | |
1690 | + { | |
1691 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.5', | |
1692 | + 'text': '大きう', | |
1693 | + 'input': 'オオキュー', | |
1694 | + 'output': '⠊⠊⠈⠩⠒', | |
1695 | + }, | |
1696 | + { | |
1697 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.6', | |
1698 | + 'text': 'うれしう', | |
1699 | + 'input': 'ウレシュー', | |
1700 | + 'output': '⠉⠛⠈⠹⠒', | |
1701 | + }, | |
1702 | + { | |
1703 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.7', | |
1704 | + 'text': 'もみぢ', | |
1705 | + 'input': 'モミジ', | |
1706 | + 'output': '⠾⠷⠐⠳', | |
1707 | + 'inpos2': [0,1,2], | |
1708 | + 'inpos1': [0,1,2,2], | |
1709 | + 'inpos': [0,1,2,2], | |
1710 | + }, | |
1711 | + { | |
1712 | + 'comment': '点訳のてびき第3版 第2章 その1 1 7 No.8', | |
1713 | + 'text': 'みづうみ', | |
1714 | + 'input': 'ミズウミ', | |
1715 | + 'output': '⠷⠐⠹⠉⠷', | |
1716 | + 'inpos2': [0,1,2,3], | |
1717 | + 'inpos1': [0,1,1,2,3], | |
1718 | + 'inpos': [0,1,1,2,3], | |
1719 | + }, | |
1720 | + # 第2章 語の書き表し方 | |
1721 | + # その1 仮名遣い | |
1722 | + { 'note': '==== 2 その他の仮名遣い ====' }, | |
1723 | + { 'note': '1.外来語や外国語は原文の表記に従って書くことを原則とする。'}, | |
1724 | + { | |
1725 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.1', | |
1726 | + 'text': 'フィルム', | |
1727 | + 'input': 'フィルム', | |
1728 | + 'output': '⠢⠧⠙⠽', | |
1729 | + 'inpos2': [0,1,2,3], | |
1730 | + 'inpos1': [0,0,2,3], | |
1731 | + 'inpos': [0,0,2,3], | |
1732 | + }, | |
1733 | + { | |
1734 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.2', | |
1735 | + 'text': 'フイルム', | |
1736 | + 'input': 'フイルム', | |
1737 | + 'output': '⠭⠃⠙⠽', | |
1738 | + 'inpos2': [0,1,2,3], | |
1739 | + 'inpos1': [0,1,2,3], | |
1740 | + 'inpos': [0,1,2,3], | |
1741 | + }, | |
1742 | + { | |
1743 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.3', | |
1744 | + 'text': 'バイオリン', | |
1745 | + 'input': 'バイオリン', | |
1746 | + 'output': '⠐⠥⠃⠊⠓⠴', | |
1747 | + 'inpos2': [0,1,2,3,4], | |
1748 | + 'inpos1': [0,0,1,2,3,4], | |
1749 | + 'inpos': [0,0,1,2,3,4], | |
1750 | + }, | |
1751 | + { | |
1752 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.4', | |
1753 | + 'text': 'ヴァイオリン', | |
1754 | + 'input': 'ヴァイオリン', | |
1755 | + 'output': '⠲⠥⠃⠊⠓⠴', | |
1756 | + }, | |
1757 | + { | |
1758 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.5', | |
1759 | + 'text': 'ビタミン', | |
1760 | + 'input': 'ビタミン', | |
1761 | + 'output': '⠐⠧⠕⠷⠴', | |
1762 | + }, | |
1763 | + { | |
1764 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.6', | |
1765 | + 'text': 'ヴィタミン', | |
1766 | + 'input': 'ヴィタミン', | |
1767 | + 'output': '⠲⠧⠕⠷⠴', | |
1768 | + }, | |
1769 | + { | |
1770 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.7', | |
1771 | + 'text': 'カルシウム', | |
1772 | + 'input': 'カルシウム', | |
1773 | + 'output': '⠡⠙⠳⠉⠽', | |
1774 | + 'inpos1': [0,1,2,3,4], | |
1775 | + }, | |
1776 | + { | |
1777 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.8', | |
1778 | + 'text': 'カルシューム', | |
1779 | + 'input': 'カルシューム', | |
1780 | + 'output': '⠡⠙⠈⠹⠒⠽', | |
1781 | + }, | |
1782 | + { | |
1783 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.9', | |
1784 | + 'text': 'パーティー', | |
1785 | + 'input': 'パーティー', | |
1786 | + 'output': '⠠⠥⠒⠈⠗⠒', | |
1787 | + }, | |
1788 | + { | |
1789 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.10', | |
1790 | + 'text': 'パーティ', | |
1791 | + 'input': 'パーティ', | |
1792 | + 'output': '⠠⠥⠒⠈⠗', | |
1793 | + }, | |
1794 | + { 'note': '<処理1>外来語外国語に使われている「ヂ」「ヅ」「ヂャ」「ヂュ」「ヂョ」は、「ジ」「ズ」「ジャ」「ジュ」「ジョ」を用いて書いてよい。なお、特に必要があれば原文のかなづかいで書くことができる。' }, | |
1795 | + { | |
1796 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.22', | |
1797 | + 'text': 'ラヂオ', | |
1798 | + 'input': 'ラジオ', | |
1799 | + 'output': '⠑⠐⠳⠊', | |
1800 | + }, | |
1801 | + { | |
1802 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.23', | |
1803 | + 'text': 'ヂャケット', | |
1804 | + 'input': 'ジャケット', | |
1805 | + 'output': '⠘⠱⠫⠂⠞', | |
1806 | + }, | |
1807 | + { | |
1808 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.24', | |
1809 | + 'text': '映画「ラヂオの時間」', | |
1810 | + 'input': 'エイガ 「ラジオノ ジカン」', | |
1811 | + 'output': '⠋⠃⠐⠡ ⠤⠑⠐⠳⠊⠎ ⠐⠳⠡⠴⠤', # 「」に 36 を使う | |
1812 | + }, | |
1813 | + { 'note': '<処理2>外来語や外国語に使われている「ヰ」「ヱ」「ヲ」は、「イ」「エ」「オ」あるいは「ウィ」「ウェ」「ウォ」を用いて書いてよい。' }, | |
1814 | + { | |
1815 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.25', | |
1816 | + 'text': 'ウヰスキー', | |
1817 | + 'input': 'ウイスキー', | |
1818 | + 'output': '⠉⠃⠹⠣⠒', | |
1819 | + 'inpos1': [0,1,2,3,4], | |
1820 | + }, | |
1821 | + { | |
1822 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.26', | |
1823 | + 'text': 'スヰフト', | |
1824 | + 'input': 'スイフト', #スウィフト | |
1825 | + 'output': '⠹⠃⠭⠞', | |
1826 | + 'inpos1': [0,1,2,3], | |
1827 | + }, | |
1828 | + { | |
1829 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.27', | |
1830 | + 'text': 'ヱルテル', | |
1831 | + 'input': 'ウェルテル', | |
1832 | + 'output': '⠢⠋⠙⠟⠙', | |
1833 | + }, | |
1834 | + { | |
1835 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.28', | |
1836 | + 'text': 'ヲルポール', | |
1837 | + 'input': 'ウォルポール', | |
1838 | + 'output': '⠢⠊⠙⠠⠮⠒⠙', | |
1839 | + }, | |
1840 | + { 'note': '<処理3>児童書などで、全文ひらがな書きのため長音符を使わずに書かれている外来語や外国語は、発音を考慮して適宜長音符に書き換えてよい。' }, | |
1841 | + { | |
1842 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.29', | |
1843 | + 'text': 'ヘリコプタア', | |
1844 | + 'input': 'ヘリコプター', | |
1845 | + 'output': '⠯⠓⠪⠠⠭⠕⠒', | |
1846 | + }, | |
1847 | + { | |
1848 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.30', | |
1849 | + 'text': 'ちゅうりっぷ', | |
1850 | + 'input': 'チューリップ', | |
1851 | + 'output': '⠈⠝⠒⠓⠂⠠⠭', | |
1852 | + }, | |
1853 | + { 'note': '<処理4>漢字で書かれた外来語や外国語を原文で書く場合は、ルビや辞書などで示される仮名の表記に従って書いてよい。' }, | |
1854 | + { | |
1855 | + 'comment': '点訳のてびき第3版 第2章 その1 2 1 No.31', | |
1856 | + # 'text': '老酒', | |
1857 | + 'input': 'ラオチュウ', | |
1858 | + 'output': '⠑⠊⠈⠝⠉', | |
1859 | + 'comment': '老酒: ルビがないと読みを確定できない', | |
1860 | + }, | |
1861 | + { 'note': '2.擬声語・擬態語・嘆声などは「基本的な仮名遣い」に準じて書くが、原文に長音記号や特殊音が使われているときは、それに従って長音符や特殊音点字を用いて書く。' }, | |
1862 | + { | |
1863 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.3', | |
1864 | + 'text': 'シーンと', | |
1865 | + 'input': 'シーント', | |
1866 | + 'output': '⠳⠒⠴⠞', | |
1867 | + 'inpos2': [0,1,2,3], | |
1868 | + 'inpos1': [0,1,2,3], | |
1869 | + 'inpos': [0,1,2,3], | |
1870 | + }, | |
1871 | + { | |
1872 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.4', | |
1873 | + 'text': 'しいんと', | |
1874 | + 'input': 'シイント', | |
1875 | + 'output': '⠳⠃⠴⠞', | |
1876 | + 'inpos2': [0,1,2,3], | |
1877 | + 'inpos1': [0,1,2,3], | |
1878 | + 'inpos': [0,1,2,3], | |
1879 | + }, | |
1880 | + { | |
1881 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.5', | |
1882 | + #'text': 'ちゅうちゅう', | |
1883 | + 'input': 'チューチュー', | |
1884 | + }, | |
1885 | + { | |
1886 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.6', | |
1887 | + #'text': 'ぐうぐう', | |
1888 | + 'input': 'グーグー', | |
1889 | + }, | |
1890 | + { | |
1891 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.10', | |
1892 | + #'text': 'めえめえ', | |
1893 | + 'input': 'メエメエ', | |
1894 | + }, | |
1895 | + { | |
1896 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.12', | |
1897 | + #'text': 'ごおごお', | |
1898 | + 'input': 'ゴオゴオ', | |
1899 | + }, | |
1900 | + { | |
1901 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.13', | |
1902 | + #'text': 'ぎゃおーっ', | |
1903 | + 'input': 'ギャオーッ', | |
1904 | + }, | |
1905 | + { | |
1906 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.14', | |
1907 | + #'text': 'があーん', | |
1908 | + 'input': 'ガアーン', | |
1909 | + }, | |
1910 | + { | |
1911 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.17', | |
1912 | + #'text': 'がおううううう', | |
1913 | + 'input': 'ガオウウウウー', | |
1914 | + }, | |
1915 | + { 'note': '<処理>原文で長音記号に代えて波線や棒線などが使われているときも、長音符を用いて書く。' }, | |
1916 | + { | |
1917 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.18', | |
1918 | + 'text': 'ふにゃ~', | |
1919 | + 'input': 'フニャー', | |
1920 | + 'output': '⠭⠈⠅⠒', | |
1921 | + 'inpos2': [0,1,2,3], | |
1922 | + 'inpos1': [0,1,1,3], | |
1923 | + 'inpos': [0,1,1,3], | |
1924 | + }, | |
1925 | + { | |
1926 | + 'comment': '点訳のてびき第3版 第2章 その1 2 2 No.19', | |
1927 | + #'text': 'まぁ――っ', | |
1928 | + 'input': 'マアーッ', | |
1929 | + }, | |
1930 | + { 'note': '3.方言は原文の表記に従って書くことを原則とするが、長音は「基本的な仮名遣い」に準じて書いてよい。なお、原文に長音符号が使われているときは、それに従って長音符を用いて書く。' }, | |
1931 | + { | |
1932 | + 'comment': '点訳のてびき第3版 第2章 その1 2 3 No.2', | |
1933 | + 'text': 'しぇんしぇい', | |
1934 | + 'input': 'シェンシェイ', | |
1935 | + }, | |
1936 | + { | |
1937 | + 'comment': '点訳のてびき第3版 第2章 その1 2 3 No.4', | |
1938 | + 'text': 'おおきに', | |
1939 | + 'input': 'オオキニ', | |
1940 | + }, | |
1941 | + { 'note': '<処理>原文の表記に従うと不自然な音になる場合は、その発音に使いと思われる点字を用いて書いてよい。' }, | |
1942 | + { | |
1943 | + 'comment': '点訳のてびき第3版 第2章 その1 2 3 No.6', | |
1944 | + 'text': 'おみやぁさん', | |
1945 | + 'input': 'オミャアサン', | |
1946 | + }, | |
1947 | + { | |
1948 | + 'comment': '点訳のてびき第3版 第2章 その1 2 3 No.7', | |
1949 | + 'text': '先生ぇさまぁ', | |
1950 | + 'input': 'センセエサマア', | |
1951 | + }, | |
1952 | + { 'note': '4.原文に特殊音点字を用いても書き表せない文字が使われているときは、なるべくその発音に近い点字を用いて書く。' }, | |
1953 | + { | |
1954 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.1', | |
1955 | + 'text': 'おとゥ、おかァ', | |
1956 | + 'input': 'オトー、オカア', | |
1957 | + }, | |
1958 | + { | |
1959 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.2', | |
1960 | + 'text': 'ヱ゛ルレエヌ', | |
1961 | + 'input': 'ヴェルレエヌ', | |
1962 | + }, | |
1963 | + { | |
1964 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.3', | |
1965 | + 'text': 'ヲ゛ルガ', | |
1966 | + 'input': 'ヴォルガ', | |
1967 | + }, | |
1968 | + { | |
1969 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.4', | |
1970 | + 'text': 'ガリワ゛ー', | |
1971 | + 'input': 'ガリヴァー', | |
1972 | + }, | |
1973 | + { | |
1974 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.5', | |
1975 | + 'text': 'クヮルテット', | |
1976 | + 'input': 'クァルテット', | |
1977 | + }, | |
1978 | + { | |
1979 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.6', | |
1980 | + 'text': 'ヂェスチャー', | |
1981 | + 'input': 'ジェスチャー', | |
1982 | + }, | |
1983 | + { | |
1984 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.7', | |
1985 | + 'text': 'スェーター', | |
1986 | + 'input': 'スエーター', | |
1987 | + }, | |
1988 | + { | |
1989 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.8', | |
1990 | + 'text': 'ヒァーッたまげた', | |
1991 | + 'input': 'ヒャーッ タマゲタ', | |
1992 | + }, | |
1993 | + { | |
1994 | + 'comment': '点訳のてびき第3版 第2章 その1 2 4 No.9', | |
1995 | + 'text': 'あ゛ー', | |
1996 | + 'input': 'アー', | |
1997 | + }, | |
1998 | + { 'note': '5.固有名詞の仮名遣い' }, | |
1999 | + { 'note': '(1) 漢字で書かれた固有名詞は「基本的な仮名遣い」に準じて書く。' }, | |
2000 | + { | |
2001 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.1', | |
2002 | + 'text': '大阪', | |
2003 | + 'input': 'オオサカ', | |
2004 | + }, | |
2005 | + { | |
2006 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.2', | |
2007 | + 'text': '遠野', | |
2008 | + 'input': 'トオノ', | |
2009 | + }, | |
2010 | + { | |
2011 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.3', | |
2012 | + 'text': '東井', | |
2013 | + 'input': 'トーイ', | |
2014 | + }, | |
2015 | + { | |
2016 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.10', | |
2017 | + 'text': '青梅', | |
2018 | + 'input': 'オーメ', | |
2019 | + }, | |
2020 | + { | |
2021 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.11', | |
2022 | + 'text': '透', | |
2023 | + 'input': 'トオル', | |
2024 | + }, | |
2025 | + | |
2026 | + { 'note': '(2)仮名で書かれた固有名詞は原本の仮名遣いに従って書くが、長音は「基本的な仮名遣い」に準じて書く。' }, | |
2027 | + { | |
2028 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.13', | |
2029 | + 'text': 'みさを', | |
2030 | + 'input': 'ミサヲ', | |
2031 | + }, | |
2032 | + { | |
2033 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.14', | |
2034 | + 'text': 'かほる', | |
2035 | + 'input': 'カホル', | |
2036 | + }, | |
2037 | + { | |
2038 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.19', | |
2039 | + #'text': 'さをり織り', | |
2040 | + 'input': 'サヲリオリ', | |
2041 | + }, | |
2042 | + { 'note': '<処理1>ワ行の「ヱ」は、感嘆符と形が同じなので、ア行の「エ」に変えることを原則とする。' }, | |
2043 | + { | |
2044 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.22', | |
2045 | + 'text': 'ヱビスビール', | |
2046 | + 'input': 'エビス ビール', | |
2047 | + }, | |
2048 | + { 'note': '<処理2>原文で長音符号が使われているときは、長音符を用いて書く。' }, | |
2049 | + { | |
2050 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.23', | |
2051 | + #'text': 'オーヤマ書店', | |
2052 | + 'input': 'オーヤマ ショテン', | |
2053 | + }, | |
2054 | + { 'note': '<処理3>主となる固有名詞部分以外の語に使われている歴史的仮名遣いは、現代仮名遣いに直して書く。' }, | |
2055 | + { | |
2056 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.24', | |
2057 | + 'text': 'みやこをどり', | |
2058 | + 'input': 'ミヤコ オドリ', | |
2059 | + }, | |
2060 | + { | |
2061 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.25', | |
2062 | + 'text': '青木をりがみ教室', | |
2063 | + 'input': 'アオキ オリガミ キョーシツ', | |
2064 | + }, | |
2065 | + { 'note': '<処理4>外来語や疑似外来語などを使って仮名で表記されている法人名や商品名などは、その仮名遣いに従って書いてよい。' }, | |
2066 | + { | |
2067 | + 'comment': '点訳のてびき第3版 第2章 その1 2 5 No.26', | |
2068 | + 'text': '日本コロムビア', | |
2069 | + 'input': 'ニッポン コロムビア', | |
2070 | + }, | |
2071 | + { 'note': '6.歴史的仮名遣いで書かれた文や語句が現代文の中に挿入されているときは、次の4種類の方法の中から原文に応じて最もふさわしい方法を選んで点訳する。なお、特に差し支えがない場合は(ア)の方法を用いる。' }, | |
2072 | + { 'note': '(ア)現代文の仮名遣いで書く。' }, | |
2073 | + { | |
2074 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.3', | |
2075 | + #'text': '問ふ', | |
2076 | + 'input': 'トウ', | |
2077 | + }, | |
2078 | + { 'note': '(イ)現代文の仮名遣いで書いたあとに、古文の仮名遣いをカッコ類で囲んで書く。' }, | |
2079 | + { 'note': '(ウ)古文の仮名遣いで書いたあとに、現代文の仮名遣いをカッコ類で囲んで書く。' }, | |
2080 | + { 'note': '(エ)古文の仮名遣いで書く。' }, | |
2081 | + { | |
2082 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.10', | |
2083 | + #'text': 'あはれ', | |
2084 | + 'input': 'アハレ', | |
2085 | + }, | |
2086 | + { | |
2087 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.11', | |
2088 | + # 'text': '弥生', | |
2089 | + 'input': 'ヤヨヒ', | |
2090 | + 'output': '⠌⠜⠧', | |
2091 | + }, | |
2092 | + { | |
2093 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.12', | |
2094 | + # 'text': '問ふ', | |
2095 | + 'input': 'トフ', | |
2096 | + 'output': '⠞⠭', | |
2097 | + }, | |
2098 | + { | |
2099 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.13', | |
2100 | + # 'text': '末', | |
2101 | + 'input': 'スヱ', | |
2102 | + 'output': '⠹⠖', | |
2103 | + }, | |
2104 | + { | |
2105 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.14', | |
2106 | + # 'text': '居り', | |
2107 | + 'input': 'ヲリ', | |
2108 | + 'output': '⠔⠓', | |
2109 | + }, | |
2110 | + { | |
2111 | + 'comment': '点訳のてびき第3版 第2章 その1 2 6 No.15', | |
2112 | + # 'text': '静けさ', | |
2113 | + 'input': 'シヅケサ', | |
2114 | + 'output': '⠳⠐⠝⠫⠱', | |
2115 | + }, | |
2116 | + | |
2117 | + { 'note': '=== その2 数字 ===' }, | |
2118 | + { 'note': '==== 1 数の書き方 ====' }, | |
2119 | + { 'note': '1.数字は数符(⠼)を前置し、4桁までは一続きに書く。' }, | |
2120 | + { | |
2121 | + 'text': '1', | |
2122 | + 'input': '1', | |
2123 | + 'output': '⠼⠁', | |
2124 | + 'inpos2': [0], | |
2125 | + 'inpos1': [0,0], | |
2126 | + 'inpos': [0,0], | |
2127 | + }, | |
2128 | + { | |
2129 | + 'text': '二十三', | |
2130 | + 'input': '23', | |
2131 | + }, | |
2132 | + { | |
2133 | + 'text': '五百', | |
2134 | + 'input': '500', | |
2135 | + }, | |
2136 | + { | |
2137 | + 'text': '二千三百', | |
2138 | + 'input': '2300', | |
2139 | + }, | |
2140 | + { | |
2141 | + 'text': '2001', | |
2142 | + 'input': '2001', | |
2143 | + 'output': '⠼⠃⠚⠚⠁', | |
2144 | + 'inpos2': [0,1,2,3], | |
2145 | + 'inpos1': [0,0,1,2,3], | |
2146 | + 'inpos': [0,0,1,2,3], | |
2147 | + }, | |
2148 | + { | |
2149 | + 'text': '5000', | |
2150 | + 'input': '5000', | |
2151 | + 'output': '⠼⠑⠚⠚⠚', | |
2152 | + 'inpos2': [0,1,2,3], | |
2153 | + 'inpos1': [0,0,1,2,3], | |
2154 | + 'inpos': [0,0,1,2,3], | |
2155 | + }, | |
2156 | + { | |
2157 | + #'text': '一千万', | |
2158 | + 'input': '1センマン', | |
2159 | + }, | |
2160 | + { | |
2161 | + #'text': '三千億', | |
2162 | + 'input': '3ゼンオク', | |
2163 | + }, | |
2164 | + { 'note': '2.万・億・兆などはその発音を仮名で書き、4桁ごとに区切る。' }, | |
2165 | + { | |
2166 | + #'text': '54309', | |
2167 | + 'input': '5マン 4309', | |
2168 | + }, | |
2169 | + { | |
2170 | + #'text': '10500', | |
2171 | + 'input': '1マン 500', | |
2172 | + }, | |
2173 | + { | |
2174 | + 'text': '三兆二千四百万', | |
2175 | + 'input': '3チョー 2400マン', | |
2176 | + }, | |
2177 | + { 'note': '3.小数は小数点(⠂)を用いて書く。' }, | |
2178 | + { | |
2179 | + 'text': '3.14', | |
2180 | + 'input': '3.14', | |
2181 | + 'output': '⠼⠉⠂⠁⠙', | |
2182 | + 'inpos2': [0,1,2,3], | |
2183 | + 'inpos1': [0,0,1,2,3], | |
2184 | + 'inpos': [0,0,1,2,3], | |
2185 | + }, | |
2186 | + { | |
2187 | + 'text': '0.01', | |
2188 | + 'input': '0.01', | |
2189 | + 'output': '⠼⠚⠂⠚⠁', | |
2190 | + 'inpos2': [0,1,2,3], | |
2191 | + 'inpos1': [0,0,1,2,3], | |
2192 | + 'inpos': [0,0,1,2,3], | |
2193 | + }, | |
2194 | + { 'note': '4.分数' }, | |
2195 | + { 'note': '5.「千」「百」「十」が位を表している場合には、それぞれの仮名を用いて書く。' }, | |
2196 | + { | |
2197 | + 'text': '数千', | |
2198 | + 'input': 'スーセン', | |
2199 | + }, | |
2200 | + { | |
2201 | + 'text': '数百', | |
2202 | + 'input': 'スーヒャク', | |
2203 | + }, | |
2204 | + { | |
2205 | + 'text': '何百', | |
2206 | + 'input': 'ナンビャク', | |
2207 | + }, | |
2208 | + { | |
2209 | + 'text': '何十', | |
2210 | + 'input': 'ナンジュー', # ナン10 | |
2211 | + }, | |
2212 | + { 'note': '6.およその数で数が重なる場合は、読点などを用いず、それぞれに数符を前置して続けて書く。' }, | |
2213 | + { | |
2214 | + 'text': '二、三', | |
2215 | + 'input': '2⠼3', | |
2216 | + 'output': '⠼⠃⠼⠉', | |
2217 | + }, | |
2218 | + { | |
2219 | + #'text': '二百五、六十', | |
2220 | + 'input': '2ヒャク 5⠼60', | |
2221 | + 'output': '⠼⠃⠈⠥⠩ ⠼⠑⠼⠋⠚', | |
2222 | + }, | |
2223 | + { 'note': '7.特に必要があればそのまま数字を並べて書くことができる。その場合は3桁ごとに位取り点(⠄)を用いて書いてよい。' }, | |
2224 | + { | |
2225 | + 'text': '53,000', | |
2226 | + 'input': '53,000', | |
2227 | + 'output': '⠼⠑⠉⠄⠚⠚⠚', | |
2228 | + 'inpos2': [0,1,2,3,4,5], | |
2229 | + 'inpos1': [0,0,1,2,3,4,5], | |
2230 | + 'inpos': [0,0,1,2,3,4,5], | |
2231 | + }, | |
2232 | + { 'note': '8.年号の略記に使われているアポストロフィは、数符の直後にアポストロフィ(3)を用いて書く。' }, | |
2233 | + { | |
2234 | + 'text': "'02", | |
2235 | + 'input': "'02", # text2mecab で全角に変換されるが元に戻す | |
2236 | + 'output': '⠼⠄⠚⠃', | |
2237 | + 'inpos2': [0,1,2], | |
2238 | + 'inpos1': [0,0,1,2], | |
2239 | + 'inpos': [0,0,1,2], | |
2240 | + }, | |
2241 | + { 'note': '==== 2 数を含む言葉の書き方 ====' }, | |
2242 | + { 'note': '1.数字を漢字音で発音する場合' }, | |
2243 | + { 'note': '(1) 数を含む言葉は数字で表すことを原則とし、数字に続く言葉(助数詞など)は続けて書く。また、数に続く言葉はア行・ラ行のいずれかで始まる場合は、数字と形が同じなので、第一つなぎ符(36)をはさんで続けて書く。' }, | |
2244 | + { | |
2245 | + 'text': '1枚', | |
2246 | + 'input': '1マイ', | |
2247 | + }, | |
2248 | + { | |
2249 | + 'text': '三十センチメートル', | |
2250 | + 'input': '30センチメートル', | |
2251 | + }, | |
2252 | + { | |
2253 | + 'text': '五割', | |
2254 | + 'input': '5ワリ', | |
2255 | + }, | |
2256 | + { | |
2257 | + 'text': '六百人', | |
2258 | + 'input': '600ニン', | |
2259 | + }, | |
2260 | + { | |
2261 | + 'text': '一流品', | |
2262 | + 'input': '1リューヒン', | |
2263 | + }, | |
2264 | + { | |
2265 | + 'text': '第2章', | |
2266 | + 'input': 'ダイ2ショー', | |
2267 | + }, | |
2268 | + { | |
2269 | + 'text': '中2階', | |
2270 | + 'input': 'チュー2カイ', | |
2271 | + }, | |
2272 | + { | |
2273 | + #'text': 'お三方', | |
2274 | + 'input': 'オ3カタ', | |
2275 | + }, | |
2276 | + { | |
2277 | + #'text': '3三振', | |
2278 | + 'input': '3⠼3シン', | |
2279 | + 'output': '⠼⠉⠼⠉⠳⠴', | |
2280 | + }, | |
2281 | + { | |
2282 | + 'text': '四季', | |
2283 | + 'input': '4キ', | |
2284 | + }, | |
2285 | + { | |
2286 | + 'text': '四半期', | |
2287 | + 'input': '4ハンキ', | |
2288 | + }, | |
2289 | + { | |
2290 | + 'text': '四角形', | |
2291 | + 'input': '4カクケイ', | |
2292 | + }, | |
2293 | + { | |
2294 | + #'text': '二男一女', | |
2295 | + 'input': '2ナン 1ジョ', | |
2296 | + }, | |
2297 | + { | |
2298 | + 'text': '十数人', | |
2299 | + 'input': '10スーニン', | |
2300 | + }, | |
2301 | + { | |
2302 | + #'text': '五千円札', | |
2303 | + 'input': '5センエンサツ', | |
2304 | + }, | |
2305 | + { | |
2306 | + #'text': '1000万光年', | |
2307 | + 'input': '1センマンコーネン', | |
2308 | + }, | |
2309 | + { | |
2310 | + 'text': '西暦2000年', | |
2311 | + 'input': 'セイレキ 2000ネン', | |
2312 | + }, | |
2313 | + { | |
2314 | + 'text': '零時十五分', | |
2315 | + 'input': '0ジ 15フン', | |
2316 | + }, | |
2317 | + { | |
2318 | + 'text': '一列', | |
2319 | + 'input': '1レツ', | |
2320 | + 'output': '⠼⠁⠤⠛⠝', | |
2321 | + }, | |
2322 | + { | |
2323 | + 'text': '一輪車', | |
2324 | + 'input': '1リンシャ', | |
2325 | + 'output': '⠼⠁⠤⠓⠴⠈⠱', | |
2326 | + }, | |
2327 | + { | |
2328 | + 'text': '二億年', | |
2329 | + 'input': '2オクネン', | |
2330 | + 'output': '⠼⠃⠤⠊⠩⠏⠴', | |
2331 | + }, | |
2332 | + { | |
2333 | + 'text': '三塁打', | |
2334 | + 'input': '3ルイダ', | |
2335 | + 'output': '⠼⠉⠤⠙⠃⠐⠕', | |
2336 | + }, | |
2337 | + { | |
2338 | + 'text': '五十円', | |
2339 | + 'input': '50エン', | |
2340 | + 'output': '⠼⠑⠚⠤⠋⠴', | |
2341 | + }, | |
2342 | + { 'note': '【備考】数字の後ろに助詞・助動詞が続く場合も続けて書く。その場合、ア行・ラ行で始まる助詞・助動詞との間は、第一つなぎ符をはさんで続けて書く。' }, | |
2343 | + { | |
2344 | + 'text': '101の', | |
2345 | + 'input': '101ノ', | |
2346 | + 'output': '⠼⠁⠚⠁⠎', | |
2347 | + 'inpos2': [0,1,2,3], | |
2348 | + 'inpos1': [0,0,1,2,3], | |
2349 | + 'inpos': [0,0,1,2,3], | |
2350 | + }, | |
2351 | + { | |
2352 | + 'text': '3です', | |
2353 | + 'input': '3デス', | |
2354 | + 'output': '⠼⠉⠐⠟⠹', | |
2355 | + 'inpos2': [0,1,2], | |
2356 | + 'inpos1': [0,0,1,1,2], | |
2357 | + 'inpos': [0,0,1,1,2], | |
2358 | + }, | |
2359 | + { | |
2360 | + 'text': '4120へ', | |
2361 | + 'input': '4120エ', | |
2362 | + 'output': '⠼⠙⠁⠃⠚⠤⠋', | |
2363 | + 'inpos2': [0,1,2,3,4], | |
2364 | + 'inpos1': [0,0,1,2,3,3,4], | |
2365 | + 'inpos': [0,0,1,2,3,3,4], | |
2366 | + }, | |
2367 | + { | |
2368 | + 'text': '18らしい', | |
2369 | + 'input': '18ラシイ', | |
2370 | + 'output': '⠼⠁⠓⠤⠑⠳⠃', | |
2371 | + 'inpos2': [0,1,2,3,4], | |
2372 | + 'inpos1': [0,0,1,1,2,3,4], | |
2373 | + 'inpos': [0,0,1,1,2,3,4], | |
2374 | + }, | |
2375 | + { 'note': '<処理>数字に続く言葉との関係で数字の読みが促音化しても、促音符は用いず、数字の後ろに仮名を続けて書く。' }, | |
2376 | + { | |
2377 | + 'text': '1足', | |
2378 | + 'input': '1ソク', | |
2379 | + }, | |
2380 | + { | |
2381 | + #'text': '10本', | |
2382 | + 'input': '10ポン', | |
2383 | + }, | |
2384 | + { | |
2385 | + 'text': '一汁一菜', | |
2386 | + 'input': '1ジュー 1サイ', | |
2387 | + }, | |
2388 | + { | |
2389 | + 'text': '一丁目一番地', | |
2390 | + 'input': '1チョーメ 1バンチ', | |
2391 | + }, | |
2392 | + { | |
2393 | + 'text': '五臓六腑', | |
2394 | + 'input': '5ゾー 6プ', | |
2395 | + }, | |
2396 | + { 'note': '(2) 一語中で、月と日を省略して書いてあるときや、数字が並んでいるときは、中点などを省略して続けて書く。' }, | |
2397 | + { | |
2398 | + 'text': '二・二六事件', | |
2399 | + 'input': '2⠼26 ジケン', | |
2400 | + 'output': '⠼⠃⠼⠃⠋ ⠐⠳⠫⠴', | |
2401 | + 'inpos1': [0,0,1,2,3,4,5,5,6,7], | |
2402 | + }, | |
2403 | + { | |
2404 | + 'text': '七・五・三', | |
2405 | + 'input': '7⠼5⠼3', | |
2406 | + 'output': '⠼⠛⠼⠑⠼⠉', | |
2407 | + 'inpos1': [0,0,1,2,3,4], | |
2408 | + }, | |
2409 | + { | |
2410 | + 'text': '六・三・三制', | |
2411 | + 'input': '6⠼3⠼3セイ', | |
2412 | + 'output': '⠼⠋⠼⠉⠼⠉⠻⠃', | |
2413 | + 'inpos1': [0,0,1,2,3,4,5,6], | |
2414 | + }, | |
2415 | + { 'note': '(3) 数量や順序の意味が薄れた言葉や、漢数字の形を表している場合などは仮名で書く。' }, | |
2416 | + { | |
2417 | + 'text': '青二才', | |
2418 | + 'input': 'アオニサイ', | |
2419 | + }, | |
2420 | + { | |
2421 | + 'text': '一足飛び', | |
2422 | + 'input': 'イッソクトビ', | |
2423 | + }, | |
2424 | + { | |
2425 | + 'text': '一般的', | |
2426 | + 'input': 'イッパンテキ', | |
2427 | + }, | |
2428 | + { | |
2429 | + 'text': '一生', | |
2430 | + 'input': 'イッショー', | |
2431 | + }, | |
2432 | + { | |
2433 | + 'text': '無二', | |
2434 | + 'input': 'ムニ', | |
2435 | + }, | |
2436 | + { | |
2437 | + 'text': '一辺倒', | |
2438 | + 'input': 'イッペントー', | |
2439 | + }, | |
2440 | + { | |
2441 | + 'text': '四角い', | |
2442 | + 'input': 'シカクイ', | |
2443 | + }, | |
2444 | + { | |
2445 | + 'text': '七面鳥', | |
2446 | + 'input': 'シチメンチョー', | |
2447 | + }, | |
2448 | + { | |
2449 | + 'text': '零下30度', | |
2450 | + 'input': 'レイカ 30ド', | |
2451 | + }, | |
2452 | + { | |
2453 | + 'text': '真一文字', | |
2454 | + 'input': 'マイチモンジ', | |
2455 | + }, | |
2456 | + { | |
2457 | + 'text': '十字路', | |
2458 | + 'input': 'ジュージロ', | |
2459 | + }, | |
2460 | + { | |
2461 | + #'text': '八の字をよせる', | |
2462 | + 'input': 'ハチノジヲ ヨセル', | |
2463 | + }, | |
2464 | + { 'note': '<処理>明らかにアラビア数字の形を表している場合は、数字を用いて書く。' }, | |
2465 | + { | |
2466 | + #'text': '8の字形', | |
2467 | + 'input': '8ノジガタ', | |
2468 | + }, | |
2469 | + { 'note': '(4) 同じ発音の語でも、数量や順序の意味のあるなしで、数字と仮名に書き分ける。' }, | |
2470 | + { | |
2471 | + #'text': '一番になった', | |
2472 | + 'input': '1バンニ ナッタ', | |
2473 | + }, | |
2474 | + { | |
2475 | + 'text': '一番大きい', | |
2476 | + 'input': 'イチバン オオキイ', | |
2477 | + }, | |
2478 | + { | |
2479 | + 'text': '一段昇る', | |
2480 | + 'input': '1ダン ノボル', | |
2481 | + }, | |
2482 | + { | |
2483 | + 'text': '一段ときれいだ', | |
2484 | + 'input': 'イチダント キレイダ', | |
2485 | + }, | |
2486 | + { | |
2487 | + #'text': 'ちょっと一杯', | |
2488 | + 'input': 'チョット 1パイ', | |
2489 | + }, | |
2490 | + { | |
2491 | + #'text': '一杯になった', | |
2492 | + 'input': 'イッパイニ ナッタ', | |
2493 | + }, | |
2494 | + { | |
2495 | + 'text': '第一段階', | |
2496 | + 'input': 'ダイ1 ダンカイ', | |
2497 | + }, | |
2498 | + { | |
2499 | + #'text': '第一、金がない', | |
2500 | + 'input': 'ダイイチ、カネガ ナイ', | |
2501 | + }, | |
2502 | + { 'note': '(5) 数字の読みが仮名で書かれていても、数量や順序の意味がある場合は数字を用いて書く。' }, | |
2503 | + { | |
2504 | + #'text': 'いちにち', | |
2505 | + 'input': '1ニチ', | |
2506 | + }, | |
2507 | + { | |
2508 | + #'text': 'もういちど', | |
2509 | + 'input': 'モー 1ド', | |
2510 | + }, | |
2511 | + { | |
2512 | + #'text': 'いちばん星', | |
2513 | + 'input': '1バンボシ', | |
2514 | + }, | |
2515 | + { | |
2516 | + 'text': 'さんりんしゃ', | |
2517 | + 'input': '3リンシャ', | |
2518 | + }, | |
2519 | + { 'note': '2.数字を和語読みする場合' }, | |
2520 | + { 'note': ' (1) 数を含む言葉で、和語読みするものは仮名で書く。' }, | |
2521 | + { | |
2522 | + 'text': '一人', | |
2523 | + 'input': 'ヒトリ', | |
2524 | + }, | |
2525 | + { | |
2526 | + 'text': '二人', | |
2527 | + 'input': 'フタリ', | |
2528 | + }, | |
2529 | + { | |
2530 | + 'text': '一言', | |
2531 | + 'input': 'ヒトコト', | |
2532 | + }, | |
2533 | + { | |
2534 | + 'text': '三日月', | |
2535 | + 'input': 'ミカヅキ', | |
2536 | + }, | |
2537 | + { | |
2538 | + 'text': '四隅', | |
2539 | + 'input': 'ヨスミ', | |
2540 | + }, | |
2541 | + { | |
2542 | + 'text': '五十路', | |
2543 | + 'input': 'イソジ', | |
2544 | + }, | |
2545 | + { | |
2546 | + 'text': '明け六つ', | |
2547 | + 'input': 'アケムツ', | |
2548 | + }, | |
2549 | + { | |
2550 | + 'text': '七草', | |
2551 | + 'input': 'ナナクサ', | |
2552 | + }, | |
2553 | + { | |
2554 | + 'text': '七転び八起き', | |
2555 | + 'input': 'ナナコロビ ヤオキ', | |
2556 | + }, | |
2557 | + { | |
2558 | + 'text': '九重', | |
2559 | + 'input': 'ココノエ', | |
2560 | + }, | |
2561 | + { | |
2562 | + 'text': '十重二十重', | |
2563 | + 'input': 'トエ ハタエ', | |
2564 | + }, | |
2565 | + { | |
2566 | + 'text': '二十日', | |
2567 | + 'input': 'ハツカ', | |
2568 | + }, | |
2569 | + { | |
2570 | + 'text': '二十歳', | |
2571 | + 'input': 'ハタチ', | |
2572 | + }, | |
2573 | + #{ | |
2574 | + # 'text': '三十日', | |
2575 | + # 'input': '30ニチ', # 'ミソカ', | |
2576 | + # }, | |
2577 | + { | |
2578 | + 'text': '一つから十', | |
2579 | + 'input': 'ヒトツカラ 10', # 'ヒトツカラ トオ', | |
2580 | + }, | |
2581 | + { | |
2582 | + 'text': '一日から十日', | |
2583 | + 'input': 'ツイタチカラ トオカ', | |
2584 | + }, | |
2585 | + { | |
2586 | + 'text': '1日から10日', | |
2587 | + 'input': 'ツイタチカラ トオカ', | |
2588 | + }, | |
2589 | + { | |
2590 | + 'text': '一日から一〇日', | |
2591 | + 'input': 'ツイタチカラ トオカ', | |
2592 | + }, | |
2593 | + { | |
2594 | + 'text': '1から10', | |
2595 | + 'input': '1カラ 10', | |
2596 | + }, | |
2597 | + | |
2598 | + { 'note': '【備考】漢字音と和語読みが混じる場合も、和語読みの部分は仮名で書く。' }, | |
2599 | + { | |
2600 | + 'text': '3泊4日', | |
2601 | + 'input': '3パク ヨッカ', | |
2602 | + }, | |
2603 | + { | |
2604 | + 'text': '二百十日', | |
2605 | + 'input': '2ヒャク トオカ', | |
2606 | + }, | |
2607 | + { 'note': '(2) 漢字音の系列に入っているものは、読み替えによって和語と同じ発音になっても数字で書く。' }, | |
2608 | + { | |
2609 | + 'text': '四時', | |
2610 | + 'input': '4ジ', | |
2611 | + }, | |
2612 | + { | |
2613 | + 'text': '四人', | |
2614 | + 'input': '4ニン', | |
2615 | + }, | |
2616 | + { | |
2617 | + 'text': '四冊', | |
2618 | + 'input': '4サツ', | |
2619 | + }, | |
2620 | + { | |
2621 | + 'text': '十四日', | |
2622 | + 'input': '14カ', | |
2623 | + }, | |
2624 | + { | |
2625 | + 'text': '二十四日', | |
2626 | + 'input': '24カ', | |
2627 | + }, | |
2628 | + { | |
2629 | + #'text': '三、四日', | |
2630 | + 'input': '3⠼4カ', | |
2631 | + }, | |
2632 | + { | |
2633 | + 'text': '三三七拍子', | |
2634 | + 'input': '3⠼3⠼7ビョーシ', | |
2635 | + }, | |
2636 | + { | |
2637 | + 'text': '七個', | |
2638 | + 'input': '7コ', | |
2639 | + }, | |
2640 | + { | |
2641 | + 'text': '十七歳', | |
2642 | + 'input': '17サイ', | |
2643 | + }, | |
2644 | + { | |
2645 | + 'text': '百十番', | |
2646 | + 'input': '110バン', | |
2647 | + }, | |
2648 | + | |
2649 | + { 'text': '1日', 'input': 'ツイタチ',}, | |
2650 | + { 'text': '2日', 'input': 'フツカ',}, | |
2651 | + { 'text': '3日', 'input': 'ミッカ',}, | |
2652 | + { 'text': '4日', 'input': 'ヨッカ',}, | |
2653 | + { 'text': '5日', 'input': 'イツカ',}, | |
2654 | + { 'text': '6日', 'input': 'ムイカ',}, | |
2655 | + { 'text': '7日', 'input': 'ナノカ',}, | |
2656 | + { 'text': '8日', 'input': 'ヨーカ',}, | |
2657 | + { 'text': '9日', 'input': 'ココノカ',}, | |
2658 | + { 'text': '10日', 'input': 'トオカ',}, | |
2659 | + { 'text': '11日', 'input': '11ニチ',}, | |
2660 | + { 'text': '12日', 'input': '12ニチ',}, | |
2661 | + { 'text': '13日', 'input': '13ニチ',}, | |
2662 | + { 'text': '14日', 'input': '14カ',}, | |
2663 | + { 'text': '15日', 'input': '15ニチ',}, | |
2664 | + { 'text': '16日', 'input': '16ニチ',}, | |
2665 | + { 'text': '17日', 'input': '17ニチ',}, | |
2666 | + { 'text': '18日', 'input': '18ニチ',}, | |
2667 | + { 'text': '19日', 'input': '19ニチ',}, | |
2668 | + { 'text': '20日', 'input': 'ハツカ',}, | |
2669 | + { 'text': '21日', 'input': '21ニチ',}, | |
2670 | + { 'text': '22日', 'input': '22ニチ',}, | |
2671 | + { 'text': '23日', 'input': '23ニチ',}, | |
2672 | + { 'text': '24日', 'input': '24カ',}, | |
2673 | + { 'text': '25日', 'input': '25ニチ',}, | |
2674 | + { 'text': '26日', 'input': '26ニチ',}, | |
2675 | + { 'text': '27日', 'input': '27ニチ',}, | |
2676 | + { 'text': '28日', 'input': '28ニチ',}, | |
2677 | + { 'text': '29日', 'input': '29ニチ',}, | |
2678 | + { 'text': '30日', 'input': '30ニチ',}, | |
2679 | + { 'text': '31日', 'input': '31ニチ',}, | |
2680 | + | |
2681 | + { 'text': '一日', 'input': 'ツイタチ',}, | |
2682 | + { 'text': '二日', 'input': 'フツカ',}, | |
2683 | + { 'text': '三日', 'input': 'ミッカ',}, | |
2684 | + { 'text': '四日', 'input': 'ヨッカ',}, | |
2685 | + { 'text': '五日', 'input': 'イツカ',}, | |
2686 | + { 'text': '六日', 'input': 'ムイカ',}, | |
2687 | + { 'text': '七日', 'input': 'ナノカ',}, | |
2688 | + { 'text': '八日', 'input': 'ヨーカ',}, | |
2689 | + { 'text': '九日', 'input': 'ココノカ',}, | |
2690 | + { 'text': '一〇日', 'input': 'トオカ',}, | |
2691 | + { 'text': '一一日', 'input': '11ニチ',}, | |
2692 | + { 'text': '一二日', 'input': '12ニチ',}, | |
2693 | + { 'text': '一三日', 'input': '13ニチ',}, | |
2694 | + { 'text': '一四日', 'input': '14カ',}, | |
2695 | + { 'text': '一五日', 'input': '15ニチ',}, | |
2696 | + { 'text': '一六日', 'input': '16ニチ',}, | |
2697 | + { 'text': '一七日', 'input': '17ニチ',}, | |
2698 | + { 'text': '一八日', 'input': '18ニチ',}, | |
2699 | + { 'text': '一九日', 'input': '19ニチ',}, | |
2700 | + { 'text': '二〇日', 'input': 'ハツカ',}, | |
2701 | + { 'text': '二一日', 'input': '21ニチ',}, | |
2702 | + { 'text': '二二日', 'input': '22ニチ',}, | |
2703 | + { 'text': '二三日', 'input': '23ニチ',}, | |
2704 | + { 'text': '二四日', 'input': '24カ',}, | |
2705 | + { 'text': '二五日', 'input': '25ニチ',}, | |
2706 | + { 'text': '二六日', 'input': '26ニチ',}, | |
2707 | + { 'text': '二七日', 'input': '27ニチ',}, | |
2708 | + { 'text': '二八日', 'input': '28ニチ',}, | |
2709 | + { 'text': '二九日', 'input': '29ニチ',}, | |
2710 | + { 'text': '三〇日', 'input': '30ニチ',}, | |
2711 | + { 'text': '三一日', 'input': '31ニチ',}, | |
2712 | + | |
2713 | + { 'text': '十日', 'input': 'トオカ',}, | |
2714 | + { 'text': '十一日', 'input': '11ニチ',}, | |
2715 | + { 'text': '十二日', 'input': '12ニチ',}, | |
2716 | + { 'text': '十三日', 'input': '13ニチ',}, | |
2717 | + { 'text': '十四日', 'input': '14カ',}, | |
2718 | + { 'text': '十五日', 'input': '15ニチ',}, | |
2719 | + { 'text': '十六日', 'input': '16ニチ',}, | |
2720 | + { 'text': '十七日', 'input': '17ニチ',}, | |
2721 | + { 'text': '十八日', 'input': '18ニチ',}, | |
2722 | + { 'text': '十九日', 'input': '19ニチ',}, | |
2723 | + { 'text': '二十日', 'input': 'ハツカ',}, | |
2724 | + { 'text': '二十一日', 'input': '21ニチ',}, | |
2725 | + { 'text': '二十二日', 'input': '22ニチ',}, | |
2726 | + { 'text': '二十三日', 'input': '23ニチ',}, | |
2727 | + { 'text': '二十四日', 'input': '24カ',}, | |
2728 | + { 'text': '二十五日', 'input': '25ニチ',}, | |
2729 | + { 'text': '二十六日', 'input': '26ニチ',}, | |
2730 | + { 'text': '二十七日', 'input': '27ニチ',}, | |
2731 | + { 'text': '二十八日', 'input': '28ニチ',}, | |
2732 | + { 'text': '二十九日', 'input': '29ニチ',}, | |
2733 | + { 'text': '三十日', 'input': '30ニチ',}, | |
2734 | + { 'text': '三十一日', 'input': '31ニチ',}, | |
2735 | + | |
2736 | + { 'note': '3.外国語の読みをする場合は漢字音に準じて書く。' }, | |
2737 | + { | |
2738 | + 'text': 'ボーイング747', | |
2739 | + 'input': 'ボーイング 747', | |
2740 | + }, | |
2741 | + { | |
2742 | + 'text': 'ベスト10', | |
2743 | + 'input': 'ベスト 10', | |
2744 | + }, | |
2745 | + { | |
2746 | + 'text': '3ランホームラン', | |
2747 | + 'input': '3ラン ホームラン', | |
2748 | + }, | |
2749 | + { 'note': '4.地名や人名などの固有名詞の中に使われている数字は、仮名で書くことを原則とする。' }, | |
2750 | + { | |
2751 | + 'text': '八戸市', | |
2752 | + 'input': 'ハチノヘシ', | |
2753 | + }, | |
2754 | + { | |
2755 | + 'text': '九州', | |
2756 | + 'input': 'キューシュー', | |
2757 | + }, | |
2758 | + { | |
2759 | + 'text': '四国', | |
2760 | + 'input': 'シコク', | |
2761 | + }, | |
2762 | + { | |
2763 | + #'text': '八幡平', | |
2764 | + 'input': 'ハチマンタイ', | |
2765 | + }, | |
2766 | + { | |
2767 | + 'text': '一郎', | |
2768 | + 'input': 'イチロー', | |
2769 | + }, | |
2770 | + { | |
2771 | + 'text': '直木三十五', | |
2772 | + 'input': 'ナオキ サンジューゴ', | |
2773 | + }, | |
2774 | + { | |
2775 | + 'text': '赤十字社', | |
2776 | + 'input': 'セキジュージシャ', | |
2777 | + }, | |
2778 | + { 'note': '【備考】固有名詞であっても、数量や順序の意味を明確にする必要がある場合などには数字を用いて書く。' }, | |
2779 | + { | |
2780 | + 'text': 'ルイ十四世', | |
2781 | + 'input': 'ルイ 14セイ', | |
2782 | + }, | |
2783 | + { | |
2784 | + 'text': '二月堂', | |
2785 | + 'input': '2ガツドー', | |
2786 | + }, | |
2787 | + { | |
2788 | + #'text': '市立一中', | |
2789 | + 'input': 'シリツ 1チュー', | |
2790 | + }, | |
2791 | + { | |
2792 | + 'text': '三十三間堂', | |
2793 | + 'input': '33ゲンドー', | |
2794 | + }, | |
2795 | + { | |
2796 | + 'text': '四条河原町', | |
2797 | + 'input': '4ジョー カワラマチ', | |
2798 | + }, | |
2799 | + { | |
2800 | + 'text': '劇団四季', | |
2801 | + 'input': 'ゲキダン 4キ', | |
2802 | + }, | |
2803 | + { 'note': '5.アルファベットやハイフンなど他の記号と一緒に使われている数字や、4桁で区切ったり仮名で書くと不自然になるような数字は、原文の表記に従って書く。' }, | |
2804 | + { | |
2805 | + 'text': '連絡先090-8000-7603', | |
2806 | + 'input': 'レンラクサキ 090-8000-7603', | |
2807 | + 'output': '⠛⠴⠑⠩⠱⠣ ⠼⠚⠊⠚⠤⠼⠓⠚⠚⠚⠤⠼⠛⠋⠚⠉', | |
2808 | + 'inpos1': [0,1,2,3,4,5,6,7,7,8,9,10,11,11,12,13,14,15,16,16,17,18,19], | |
2809 | + }, | |
2810 | + { | |
2811 | + 'text': '振替00150-8-44522', | |
2812 | + 'input': 'フリカエ 00150-8-44522', | |
2813 | + 'output': '⠭⠓⠡⠋ ⠼⠚⠚⠁⠑⠚⠤⠼⠓⠤⠼⠙⠙⠑⠃⠃', | |
2814 | + 'inpos1': [0,1,2,3,4,5,5,6,7,8,9,10,11,11,12,13,13,14,15,16,17], | |
2815 | + }, | |
2816 | + { | |
2817 | + 'text': 'ISBN 4-925053-14-0', | |
2818 | + 'input': 'ISBN 4-925053-14-0', | |
2819 | + 'output': '⠰⠠⠠⠊⠎⠃⠝ ⠼⠙⠤⠼⠊⠃⠑⠚⠑⠉⠤⠼⠁⠙⠤⠼⠚', | |
2820 | + 'inpos2': [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17], | |
2821 | + 'inpos1': [0,0,0,0,1,2,3,4,5,5,6,7,7,8,9,10,11,12,13,14,14,15,16,17,17], | |
2822 | + 'inpos': [0,0,0,0,1,2,3,4,5,5,6,7,7,8,9,10,11,12,13,14,14,15,16,17,17], | |
2823 | + }, | |
2824 | + { | |
2825 | + 'text': 'No.2514269', | |
2826 | + 'input': 'No. 2514269', | |
2827 | + 'output': '⠰⠠⠝⠕⠲ ⠼⠃⠑⠁⠙⠃⠋⠊', | |
2828 | + 'inpos1': [0,0,0,1,2,3,4,4,5,6,7,8,9,10], | |
2829 | + }, | |
2830 | + | |
2831 | + { 'note': '==== 3 ローマ数字の書き方 ===='}, | |
2832 | + { | |
2833 | + 'text': 'ⅰ', | |
2834 | + 'input': 'i', | |
2835 | + 'output': '⠰⠊', | |
2836 | + 'inpos2': [0], | |
2837 | + 'inpos1': [0,0], | |
2838 | + 'inpos': [0,0], | |
2839 | + }, | |
2840 | + { | |
2841 | + 'text': 'Ⅴ', | |
2842 | + 'input': 'V', | |
2843 | + 'output': '⠰⠠⠧', | |
2844 | + 'inpos2': [0], | |
2845 | + 'inpos1': [0,0,0], | |
2846 | + 'inpos': [0,0,0], | |
2847 | + }, | |
2848 | + { | |
2849 | + 'text': 'Ⅶ', | |
2850 | + 'input': 'VII', | |
2851 | + 'output': '⠰⠠⠠⠧⠊⠊', | |
2852 | + 'inpos1': [0,0,0,0,1,2], | |
2853 | + }, | |
2854 | + { | |
2855 | + 'text': 'Ⅹ', | |
2856 | + 'input': 'X', | |
2857 | + 'output': '⠰⠠⠭', | |
2858 | + 'inpos2': [0], | |
2859 | + 'inpos1': [0,0,0], | |
2860 | + 'inpos': [0,0,0], | |
2861 | + }, | |
2862 | + | |
2863 | + { 'note': '=== その3 アルファベット ===' }, | |
2864 | + { 'note': '==== 1 文字として書き表す場合 ====' }, | |
2865 | + { 'note': '1.アルファベットは外字符(56)を前置して書く。略字など2文字以上の場合でも、一つの外字符に続けて書く。大文字は該当する文字に大文字符(6)を前置して書くが、一続きの文字がすべて大文字の場合は、外字符の直後に二重大文字符(6)を続けて書く。なお、一続きの文字の一部でも、後ろに続く文字すべてが大文字であれば、その位置に二重大文字符を用いて書くことができる。' }, | |
2866 | + { | |
2867 | + 'text': 'ビタミンE', | |
2868 | + 'input': 'ビタミン E', | |
2869 | + 'output': '⠐⠧⠕⠷⠴ ⠰⠠⠑', | |
2870 | + 'inpos1': [0,0,1,2,3,4,5,5,5], | |
2871 | + }, | |
2872 | + { | |
2873 | + 'text': 'TV', | |
2874 | + 'input': 'TV', | |
2875 | + 'output': '⠰⠠⠠⠞⠧', | |
2876 | + 'inpos2': [0,1], | |
2877 | + 'inpos1': [0,0,0,0,1], | |
2878 | + 'inpos': [0,0,0,0,1], | |
2879 | + }, | |
2880 | + { | |
2881 | + 'text': 'PTA', | |
2882 | + 'input': 'PTA', | |
2883 | + 'output': '⠰⠠⠠⠏⠞⠁', | |
2884 | + 'inpos2': [0,1,2], | |
2885 | + 'inpos1': [0,0,0,0,1,2], | |
2886 | + 'inpos': [0,0,0,0,1,2], | |
2887 | + }, | |
2888 | + { | |
2889 | + 'text': 'OPEC', | |
2890 | + 'input': 'OPEC', | |
2891 | + 'output': '⠰⠠⠠⠕⠏⠑⠉', | |
2892 | + 'inpos2': [0,1,2,3], | |
2893 | + 'inpos1': [0,0,0,0,1,2,3], | |
2894 | + 'inpos': [0,0,0,0,1,2,3], | |
2895 | + }, | |
2896 | + { | |
2897 | + 'text': 'AM', | |
2898 | + 'input': 'AM', | |
2899 | + 'output': '⠰⠠⠠⠁⠍', | |
2900 | + 'inpos2': [0,1], | |
2901 | + 'inpos1': [0,0,0,0,1], | |
2902 | + 'inpos': [0,0,0,0,1], | |
2903 | + }, | |
2904 | + { | |
2905 | + 'text': 'AMe', | |
2906 | + 'input': 'AMe', | |
2907 | + 'output': '⠰⠠⠁⠠⠍⠑', | |
2908 | + 'inpos2': [0,1,2], | |
2909 | + 'inpos1': [0,0,0,1,1,2], | |
2910 | + 'inpos': [0,0,0,1,1,2], | |
2911 | + }, | |
2912 | + { | |
2913 | + 'text': 'AMeDAS', | |
2914 | + 'input': 'AMeDAS', | |
2915 | + 'output': '⠰⠠⠁⠠⠍⠑⠠⠙⠠⠁⠠⠎', | |
2916 | + 'inpos2': [0,1,2,3,4,5], | |
2917 | + 'inpos1': [0,0,0,1,1,2,3,3,4,4,5,5], | |
2918 | + 'inpos': [0,0,0,1,1,2,3,3,4,4,5,5], | |
2919 | + 'comment': '大文字と小文字が混在する単語では二重大文字符を使わないほうが読みやすい', | |
2920 | + }, | |
2921 | + { 'note': '【備考1】' }, | |
2922 | + { | |
2923 | + #'text': 'P・T・A', | |
2924 | + 'input': 'PTA', | |
2925 | + 'output': '⠰⠠⠠⠏⠞⠁', | |
2926 | + 'inpos1': [0,0,0,0,1,2], | |
2927 | + }, | |
2928 | + { 'note': '【備考2】' }, | |
2929 | + { | |
2930 | + #'text': 'U.S.A.', | |
2931 | + 'input': 'USA', | |
2932 | + 'output': '⠰⠠⠠⠥⠎⠁', | |
2933 | + 'inpos1': [0,0,0,0,1,2], | |
2934 | + }, | |
2935 | + { 'note': '【備考3】二つ以上の略称がハイフンで結ばれているときは、それぞれに外字符や大文字符・二重大文字符を前置し、第1つなぎ符を用いて書く。' }, | |
2936 | + { | |
2937 | + 'text': 'MS-DOS', | |
2938 | + 'input': 'MS-DOS', | |
2939 | + 'output': '⠰⠠⠠⠍⠎⠤⠰⠠⠠⠙⠕⠎', | |
2940 | + 'inpos2': [0,1,2,3,4,5], | |
2941 | + 'inpos1': [0,0,0,0,1,2,3,3,3,3,4,5], | |
2942 | + 'inpos': [0,0,0,0,1,2,3,3,3,3,4,5], | |
2943 | + 'comment': '36でつなぐとカナに戻る(ハイフンで外字符の効力がなくなる)', | |
2944 | + }, | |
2945 | + { | |
2946 | + 'text': 'MS-DOS', | |
2947 | + 'input': 'MS-DOS', | |
2948 | + 'output': '⠰⠠⠠⠍⠎⠤⠰⠠⠠⠙⠕⠎', | |
2949 | + 'inpos2': [0,1,2,3,4,5], | |
2950 | + 'inpos1': [0,0,0,0,1,2,3,3,3,3,4,5], | |
2951 | + 'inpos': [0,0,0,0,1,2,3,3,3,3,4,5], | |
2952 | + }, | |
2953 | + { 'note': '【備考4】アルファベットで書かれた略称の間の「/」に限り、(34) の記号を用いて書く。一つの外字符にアルファベットと記号を続けて書くが、大文字符や二重大文字符は改めて前置する。' }, | |
2954 | + { | |
2955 | + 'text': 'DOS/V', | |
2956 | + 'input': 'DOS/V', | |
2957 | + 'output': '⠰⠠⠠⠙⠕⠎⠌⠠⠧', | |
2958 | + 'inpos2': [0,1,2,3,4], | |
2959 | + 'inpos1': [0,0,0,0,1,2,3,4,4], | |
2960 | + 'inpos': [0,0,0,0,1,2,3,4,4], | |
2961 | + 'comment': '/は456-34という新記号がある', | |
2962 | + }, | |
2963 | + { | |
2964 | + 'text': 'DOS/V', | |
2965 | + 'input': 'DOS/V', | |
2966 | + 'output': '⠰⠠⠠⠙⠕⠎⠌⠠⠧', | |
2967 | + 'inpos2': [0,1,2,3,4], | |
2968 | + 'inpos1': [0,0,0,0,1,2,3,4,4], | |
2969 | + 'inpos': [0,0,0,0,1,2,3,4,4], | |
2970 | + 'comment': '/は456-34という新記号がある', | |
2971 | + }, | |
2972 | + { 'note': '2.一続きに書き表すべき1語中のアルファベットと仮名の間は、第1つなぎ符をはさんで続けて書く。' }, | |
2973 | + { | |
2974 | + 'text': 'A型', | |
2975 | + 'input': 'Aガタ', | |
2976 | + 'output': '⠰⠠⠁⠤⠐⠡⠕', | |
2977 | + 'inpos1': [0,0,0,0,1,1,2], | |
2978 | + }, | |
2979 | + { | |
2980 | + 'text': 'X線', | |
2981 | + 'input': 'Xセン', | |
2982 | + 'output': '⠰⠠⠭⠤⠻⠴', | |
2983 | + 'inpos1': [0,0,0,0,1,2], | |
2984 | + }, | |
2985 | + { 'note': '【備考】アルファベットや省略符としてのピリオドの後ろに助詞・助動詞が続く場合は、間を区切って書く。' }, | |
2986 | + { | |
2987 | + 'text': 'Aは', | |
2988 | + 'input': 'A ワ', | |
2989 | + }, | |
2990 | + { | |
2991 | + 'text': 'NHKまで', | |
2992 | + 'input': 'NHK マデ', | |
2993 | + }, | |
2994 | + { | |
2995 | + 'text': 'PRだった', | |
2996 | + 'input': 'PR ダッタ', | |
2997 | + }, | |
2998 | + { | |
2999 | + 'text': 'No.を', | |
3000 | + 'input': 'No. ヲ', | |
3001 | + }, | |
3002 | + { 'note': '3.一続きに書き表すべき1語中の仮名とアルファベットの間は続けて書く。' }, | |
3003 | + { | |
3004 | + 'text': '何㎝', | |
3005 | + 'input': 'ナンcm', | |
3006 | + }, | |
3007 | + { | |
3008 | + 'text': '何cm', | |
3009 | + 'input': 'ナンcm', | |
3010 | + }, | |
3011 | + { | |
3012 | + 'text': '数㎏', | |
3013 | + 'input': 'スーkg', | |
3014 | + }, | |
3015 | + { | |
3016 | + 'text': '数kg', | |
3017 | + 'input': 'スーkg', | |
3018 | + }, | |
3019 | + { 'note': '4.一続きに書き表すべき1語中のアルファベットと数字、数字とアルファベットの間は続けて書く。' }, | |
3020 | + { | |
3021 | + 'text': 'p105', | |
3022 | + 'input': 'p105', | |
3023 | + 'output': '⠰⠏⠼⠁⠚⠑', | |
3024 | + 'inpos2': [0,1,2,3], | |
3025 | + 'inpos1': [0,0,1,1,2,3], | |
3026 | + 'inpos': [0,0,1,1,2,3], | |
3027 | + }, | |
3028 | + { | |
3029 | + 'text': 'B5判', | |
3030 | + 'input': 'B5ハン', | |
3031 | + }, | |
3032 | + { 'note': '<処理>アルファベットに省略符としてのピリオドが付いているときは、後ろに続く数字との間を区切って書く。' }, | |
3033 | + { | |
3034 | + 'text': 'No.1から', | |
3035 | + 'input': 'No. 1カラ', | |
3036 | + 'output': '⠰⠠⠝⠕⠲ ⠼⠁⠡⠑', | |
3037 | + 'inpos1': [0,0,0,1,2,3,4,4,5,6], | |
3038 | + }, | |
3039 | + { 'note': '==== 2 語や文を書き表す場合 ====' }, | |
3040 | + { 'note': '1.アルファベットで書かれた語句や文は、その前後ろを外国語引用符(236~356)で囲んで書く。外国語引用符の内側は英文記号を用いて、英語点字の表記法に従って書く。' }, | |
3041 | + { | |
3042 | + 'text': 'チェコ製のglass', | |
3043 | + 'input': 'チェコセイノ glass', | |
3044 | + 'output': '⠈⠟⠪⠻⠃⠎ ⠰⠛⠇⠁⠎⠎', | |
3045 | + 'inpos1': [0,0,2,3,4,5,6,7,7,8,9,10,11], | |
3046 | + 'comment': '規則変更→ 空白をはさまない1単語は外国語引用符ではなく外字符でもよい', | |
3047 | + }, | |
3048 | + { | |
3049 | + 'text': '世界保健機関(World Health Organization)の活動', | |
3050 | + 'input': 'セカイ ホケン キカン(⠦World Health Organization⠴)ノ カツドー', | |
3051 | + 'output': '⠻⠡⠃ ⠮⠫⠴ ⠣⠡⠴⠶⠦⠠⠺⠕⠗⠇⠙ ⠠⠓⠑⠁⠇⠞⠓ ⠠⠕⠗⠛⠁⠝⠊⠵⠁⠞⠊⠕⠝⠴⠶⠎ ⠡⠝⠐⠞⠒', | |
3052 | + }, | |
3053 | + { | |
3054 | + 'text': 'MY FAIR LADY, a Broadway play, is a musical.', | |
3055 | + 'input': '⠦MY FAIR LADY, a Broadway play, is a musical.⠴', | |
3056 | + }, | |
3057 | + { 'note': '2.一続きに書き表すべき1語中の外国語引用符と仮名の間は、第1つなぎ符をはさんで続けて書き、仮名と外国語引用符の間は続けて書く。' }, | |
3058 | + { 'note': '規則変更→ 外国語引用符の後は必ずマスアケする' }, | |
3059 | + { | |
3060 | + 'text': 'Gift券', | |
3061 | + 'input': 'Giftケン', | |
3062 | + 'output': '⠰⠠⠛⠊⠋⠞⠤⠫⠴', | |
3063 | + 'inpos1': [0,0,0,1,2,3,3,4,5], | |
3064 | + 'comment': '規則変更→1単語なので外字符を使う。マスアケではなくつなぎ符を使う。' | |
3065 | + }, | |
3066 | + { | |
3067 | + 'text': '赤wine', | |
3068 | + 'input': 'アカwine', | |
3069 | + 'output': '⠁⠡⠰⠺⠊⠝⠑', | |
3070 | + 'inpos1': [0,1,2,2,3,4,5], | |
3071 | + }, | |
3072 | + { | |
3073 | + 'text': '名speech集', | |
3074 | + 'input': 'メイspeechシュー', | |
3075 | + 'output': '⠿⠃⠰⠎⠏⠑⠑⠉⠓⠤⠈⠹⠒', | |
3076 | + 'inpos1': [0,1,2,2,3,4,5,6,7,7,8,8,10], | |
3077 | + }, | |
3078 | + { 'note': '【備考】外国語引用符の後ろに助詞・助動詞が続く場合は、間を区切って書く。' }, | |
3079 | + { | |
3080 | + 'text': 'I love you.に相当する日本語は何か', | |
3081 | + 'input': '⠦I love you.⠴ ニ ソートー スル ニホンゴワ ナニカ', | |
3082 | + 'output': '⠦⠠⠊ ⠇⠕⠧⠑ ⠽⠕⠥⠲⠴ ⠇ ⠺⠒⠞⠒ ⠹⠙ ⠇⠮⠴⠐⠪⠄ ⠅⠇⠡', | |
3083 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32], | |
3084 | + }, | |
3085 | + { | |
3086 | + 'text': 'tea roomらしい', | |
3087 | + 'input': '⠦tea room⠴ ラシイ', | |
3088 | + 'output': '⠦⠞⠑⠁ ⠗⠕⠕⠍⠴ ⠑⠳⠃', | |
3089 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,12,13], | |
3090 | + }, | |
3091 | + { | |
3092 | + 'text': 'Windows Live メール', | |
3093 | + 'input': '⠦Windows Live⠴ メール', | |
3094 | + }, | |
3095 | + { 'note': '3.一般書に挿入されているドイツ語やフランス語など' }, | |
3096 | + | |
3097 | + { 'note': '4.ローマ字で書かれた日本語' }, | |
3098 | + | |
3099 | + { 'note': '5.人名は、原文の書き方によって外国語引用符と外字符を使い分ける。なお、外国語引用符の中ではピリオドは省略することができない。' }, | |
3100 | + | |
3101 | + { 'note': '== 第3章 語の書き表し方 ==' }, | |
3102 | + { 'note': '=== その1 分かち書き ===' }, | |
3103 | + { 'note': '1.自立語は前を区切って書く。' }, | |
3104 | + { | |
3105 | + 'comment': '点訳のてびき第3版 第3章 その1 1', | |
3106 | + 'text': '美しい山桜', | |
3107 | + 'input': 'ウツクシイ ヤマザクラ', | |
3108 | + }, | |
3109 | + { | |
3110 | + 'comment': '点訳のてびき第3版 第3章 その1 1', | |
3111 | + 'text': '早くする', | |
3112 | + 'input': 'ハヤク スル', | |
3113 | + }, | |
3114 | + { | |
3115 | + 'comment': '点訳のてびき第3版 第3章 その1 1', | |
3116 | + 'text': 'ゆっくり歩く', | |
3117 | + 'input': 'ユックリ アルク', | |
3118 | + }, | |
3119 | + { | |
3120 | + 'text': '運動をした。', | |
3121 | + 'input': 'ウンドーヲ シタ。', | |
3122 | + }, | |
3123 | + { | |
3124 | + 'text': 'マッサージをしている。', | |
3125 | + 'input': 'マッサージヲ シテ イル。', | |
3126 | + }, | |
3127 | + { | |
3128 | + 'text': '取り止めにした。', | |
3129 | + 'input': 'トリヤメニ シタ。', | |
3130 | + }, | |
3131 | + { 'note': '2.付属語(助詞・助動詞は)は、自立語または他の付属語に続けて書く。' }, | |
3132 | + { | |
3133 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.14', | |
3134 | + 'text': '山ん中', | |
3135 | + 'input': 'ヤマン ナカ', | |
3136 | + }, | |
3137 | + { | |
3138 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.16', | |
3139 | + 'text': '好かんやつ', | |
3140 | + 'input': 'スカン ヤツ', | |
3141 | + }, | |
3142 | + { | |
3143 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.17', | |
3144 | + 'text': '嘘みたいな話', | |
3145 | + 'input': 'ウソミタイナ ハナシ', | |
3146 | + }, | |
3147 | + { | |
3148 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.18', | |
3149 | + 'text': 'どうなのですか', | |
3150 | + 'input': 'ドーナノデスカ', | |
3151 | + }, | |
3152 | + { 'note': '【備考1】ア行・ラ行で始まる助詞・助動詞が数字の後ろに続く場合は、第1つなぎ符をはさんで続けて書く。' }, | |
3153 | + { 'note': '【備考2】助詞・助動詞がアルファベットや省略符としてのピリオド、および外国語引用符の後ろに続く場合は、前を区切って書く。' }, | |
3154 | + { | |
3155 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.31', | |
3156 | + 'text': 'CDを聞く', | |
3157 | + 'input': 'CD ヲ キク', | |
3158 | + 'output': '⠰⠠⠠⠉⠙ ⠔ ⠣⠩', | |
3159 | + 'inpos1': [0,0,0,0,1,2,3,4,5,6], | |
3160 | + }, | |
3161 | + { | |
3162 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.32', | |
3163 | + 'text': 'SFみたいな話', | |
3164 | + 'input': 'SF ミタイナ ハナシ', | |
3165 | + 'output': '⠰⠠⠠⠎⠋ ⠷⠕⠃⠅ ⠥⠅⠳', | |
3166 | + 'inpos1': [0,0,0,0,1,2,3,4,5,6,7,8,9,10], | |
3167 | + }, | |
3168 | + { | |
3169 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.33', | |
3170 | + 'text': 'cf.は参照を示す', | |
3171 | + 'input': 'cf. ワ サンショーヲ シメス', | |
3172 | + 'output': '⠰⠉⠋⠲ ⠄ ⠱⠴⠈⠺⠒⠔ ⠳⠿⠹', | |
3173 | + 'inpos1': [0,0,1,2,3,4,5,6,7,8,8,10,11,12,13,14,15], | |
3174 | + }, | |
3175 | + { | |
3176 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.34', | |
3177 | + 'text': 'あなたのモットーはchallengeですね', | |
3178 | + 'input': 'アナタノ モットーワ challenge デスネ', | |
3179 | + 'output': '⠁⠅⠕⠎ ⠾⠂⠞⠒⠄ ⠰⠉⠓⠁⠇⠇⠑⠝⠛⠑ ⠐⠟⠹⠏', | |
3180 | + 'inpos1': [0,1,2,3,4,5,6,7,8,9,10,11,11,12,13,14,15,16,17,18,19,20,21,21,22,23], | |
3181 | + 'comment': '規則変更→1単語は外国語引用符を使わない' | |
3182 | + }, | |
3183 | + { 'note': '<処理>アルファベットで書かれた外国語に「な」や「だ」などが続いて、形容動詞と考えられる場合でも、助詞・助動詞と同様に区切って書いてよい。' }, | |
3184 | + { | |
3185 | + 'comment': '点訳のてびき第3版 第3章 その1 2 No.35', | |
3186 | + 'text': 'Basicな装い', | |
3187 | + 'input': 'Basic ナ ヨソオイ', | |
3188 | + 'output': '⠰⠠⠃⠁⠎⠊⠉ ⠅ ⠜⠺⠊⠃', | |
3189 | + 'inpos1': [0,0,0,1,2,3,4,5,6,7,8,9,10,11], | |
3190 | + }, | |
3191 | + { 'note': '3.実質的な意味が薄れた名詞(形容詞なども)、自立語であるから前を区切って書く。' }, | |
3192 | + { | |
3193 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.36', | |
3194 | + 'text': '東京辺り', | |
3195 | + 'input': 'トーキョー アタリ', | |
3196 | + }, | |
3197 | + { | |
3198 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.37', | |
3199 | + 'text': '力の限り', | |
3200 | + 'input': 'チカラノ カギリ', | |
3201 | + }, | |
3202 | + { | |
3203 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.38', | |
3204 | + 'text': '悲しみのあまり', | |
3205 | + 'input': 'カナシミノ アマリ', | |
3206 | + }, | |
3207 | + { | |
3208 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.39', | |
3209 | + 'text': '忘れずに読むこと', | |
3210 | + 'input': 'ワスレズニ ヨム コト', | |
3211 | + }, | |
3212 | + { | |
3213 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.40', | |
3214 | + 'text': 'わたしの生まれた頃', | |
3215 | + 'input': 'ワタシノ ウマレタ コロ', | |
3216 | + }, | |
3217 | + { | |
3218 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.41', | |
3219 | + 'text': '遅れたため', | |
3220 | + 'input': 'オクレタ タメ', | |
3221 | + }, | |
3222 | + { | |
3223 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.42', | |
3224 | + #'text': '1時間近く', | |
3225 | + 'input': '1ジカン チカク', | |
3226 | + 'output': '⠼⠁⠐⠳⠡⠴ ⠗⠡⠩', | |
3227 | + 'inpos1': [0,0,1,1,2,3,4,5,6,7], | |
3228 | + }, | |
3229 | + { | |
3230 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.43', | |
3231 | + 'text': 'その点について', | |
3232 | + 'input': 'ソノ テンニ ツイテ', | |
3233 | + }, | |
3234 | + { | |
3235 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.51', | |
3236 | + 'text': 'そういうわけ', | |
3237 | + 'input': 'ソー イウ ワケ', | |
3238 | + }, | |
3239 | + | |
3240 | + { 'note': '【備考1】次のような言葉は、接尾語や助詞なので前に続けて書く。' }, | |
3241 | + { | |
3242 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.52', | |
3243 | + 'text': '一人当り10個ずつ', | |
3244 | + 'input': 'ヒトリアタリ 10コズツ', | |
3245 | + 'output': '⠧⠞⠓⠁⠕⠓ ⠼⠁⠚⠪⠐⠹⠝', | |
3246 | + 'inpos1': [0,1,2,3,4,5,6,7,7,8,9,10,10,11], | |
3247 | + }, | |
3248 | + { | |
3249 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.54', | |
3250 | + 'text': 'いく度か', | |
3251 | + 'input': 'イクドカ', # 'イクタビカ', | |
3252 | + }, | |
3253 | + { | |
3254 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.55', | |
3255 | + 'text': 'まあ楽しみですこと', | |
3256 | + 'input': 'マア タノシミデスコト', | |
3257 | + }, | |
3258 | + { 'note': '<処理>同じ漢字でも読み方の違いによって書き分ける。' }, | |
3259 | + { | |
3260 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.59', | |
3261 | + 'text': 'ここら辺り', | |
3262 | + 'input': 'ココラ アタリ', | |
3263 | + }, | |
3264 | + { | |
3265 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.63', | |
3266 | + 'text': 'その後', | |
3267 | + 'input': 'ソノゴ',# ソノ アト, ソノ ノチ, ソノ ウシロ | |
3268 | + }, | |
3269 | + { | |
3270 | + 'comment': '点訳のてびき第3版 第3章 その1 3 No.64', | |
3271 | + 'text': '今月末', | |
3272 | + 'input': 'コンゲツマツ', # コンゲツ スエ | |
3273 | + }, | |
3274 | + { 'note': '【備考2】会話などで名詞の語形や音韻が変化した場合でも、前を区切って書いてよい。' }, | |
3275 | + { 'note': '4.本来の意味が薄れて付属語的に用いられている動詞(補助動詞など)も、自立語なので前を区切って書く。' }, | |
3276 | + { | |
3277 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.75', | |
3278 | + 'text': 'お読み頂く', | |
3279 | + 'input': 'オヨミ イタダク', | |
3280 | + }, | |
3281 | + { | |
3282 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.76', | |
3283 | + 'text': '発車いたします', | |
3284 | + 'input': 'ハッシャ イタシマス', | |
3285 | + }, | |
3286 | + { | |
3287 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.77', | |
3288 | + 'text': '行っていらっしゃい', | |
3289 | + 'input': 'イッテ イラッシャイ', | |
3290 | + }, | |
3291 | + { | |
3292 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.78', | |
3293 | + 'text': '見ている', | |
3294 | + 'input': 'ミテ イル', | |
3295 | + }, | |
3296 | + { | |
3297 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.79', | |
3298 | + 'text': '現代における', | |
3299 | + 'input': 'ゲンダイニ オケル', | |
3300 | + }, | |
3301 | + { | |
3302 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.80', | |
3303 | + 'text': 'しまっておく', | |
3304 | + 'input': 'シマッテ オク', | |
3305 | + }, | |
3306 | + { | |
3307 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.81', | |
3308 | + 'text': '日本に於て', | |
3309 | + 'input': 'ニッポンニ オイテ', # 'ニホンニ オイテ', | |
3310 | + }, | |
3311 | + { | |
3312 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.82', | |
3313 | + 'text': '出てきた', | |
3314 | + 'input': 'デテ キタ', | |
3315 | + }, | |
3316 | + { | |
3317 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.83', | |
3318 | + 'text': '行ってくる', | |
3319 | + 'input': 'イッテ クル', | |
3320 | + }, | |
3321 | + { | |
3322 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.84', | |
3323 | + 'text': 'ごめんください', | |
3324 | + 'input': 'ゴメン クダサイ', | |
3325 | + }, | |
3326 | + { | |
3327 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.85', | |
3328 | + 'text': 'お遊びください', | |
3329 | + 'input': 'オアソビ クダサイ', | |
3330 | + }, | |
3331 | + { | |
3332 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.86', | |
3333 | + 'text': 'おはようございます', | |
3334 | + 'input': 'オハヨー ゴザイマス', | |
3335 | + }, | |
3336 | + { | |
3337 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.87', | |
3338 | + 'text': '休館日につき', | |
3339 | + 'input': 'キューカンビニ ツキ', | |
3340 | + }, | |
3341 | + { | |
3342 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.88', | |
3343 | + 'text': 'これについて', | |
3344 | + 'input': 'コレニ ツイテ', | |
3345 | + }, | |
3346 | + { | |
3347 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.89', | |
3348 | + 'text': '彼にとって', | |
3349 | + 'input': 'カレニ トッテ', | |
3350 | + }, | |
3351 | + { | |
3352 | + 'comment': '点訳のてびき第3版 第3章 その1 4 No.96', | |
3353 | + 'text': '計画により', | |
3354 | + 'input': 'ケイカクニ ヨリ', | |
3355 | + }, | |
3356 | + { 'note': '5.副詞「こう・そう・ああ・どう」、連体詞「この・その・あの・どの・ある・わが」なども自立語なので、いずれも後ろの自立語との間を区切って書く。' }, | |
3357 | + { | |
3358 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.2', | |
3359 | + 'text': 'そういう', | |
3360 | + 'input': 'ソー イウ', | |
3361 | + }, | |
3362 | + { | |
3363 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.5', | |
3364 | + 'text': 'どうして帰りましょう', | |
3365 | + 'input': 'ドー シテ カエリマショー', | |
3366 | + }, | |
3367 | + { 'note': '【備考】後ろの語と結びついて1語になっている場合は続ける。' }, | |
3368 | + { | |
3369 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.20', | |
3370 | + 'text': 'この間', | |
3371 | + 'input': 'コノアイダ', | |
3372 | + }, | |
3373 | + { | |
3374 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.21', | |
3375 | + 'text': 'この期', | |
3376 | + 'input': 'コノゴ', | |
3377 | + }, | |
3378 | + { | |
3379 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.22', | |
3380 | + 'text': 'この程', | |
3381 | + 'input': 'コノホド', | |
3382 | + }, | |
3383 | + { | |
3384 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.23', | |
3385 | + 'text': 'この度', | |
3386 | + 'input': 'コノタビ', | |
3387 | + }, | |
3388 | + { | |
3389 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.26', | |
3390 | + 'text': 'そのくせ', | |
3391 | + 'input': 'ソノクセ', | |
3392 | + }, | |
3393 | + { | |
3394 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.30', | |
3395 | + 'text': 'そのうちに', | |
3396 | + 'input': 'ソノウチニ', | |
3397 | + }, | |
3398 | + { | |
3399 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.31', | |
3400 | + 'text': 'そのまま', | |
3401 | + 'input': 'ソノママ', | |
3402 | + }, | |
3403 | + { | |
3404 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.32', | |
3405 | + 'text': 'その節', | |
3406 | + 'input': 'ソノセツ', | |
3407 | + }, | |
3408 | + { | |
3409 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.36', | |
3410 | + 'text': 'わがまま', | |
3411 | + 'input': 'ワガママ', | |
3412 | + }, | |
3413 | + { 'note': '6.「にして」「をして」「ずして」などの、「して」が文語的表現の助詞である場合は前に続けて書く。' }, | |
3414 | + { | |
3415 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.37', | |
3416 | + 'text': '不幸にして', | |
3417 | + 'input': 'フコーニシテ', | |
3418 | + }, | |
3419 | + { | |
3420 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.38', | |
3421 | + 'text': '今にして', | |
3422 | + 'input': 'イマニシテ', | |
3423 | + }, | |
3424 | + { | |
3425 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.39', | |
3426 | + 'text': '居ながらにして', | |
3427 | + 'input': 'イナガラニシテ', | |
3428 | + }, | |
3429 | + { | |
3430 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.40', | |
3431 | + 'text': '労せずして', | |
3432 | + 'input': 'ローセズシテ', | |
3433 | + }, | |
3434 | + { | |
3435 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.41', | |
3436 | + 'text': '私をして言わしむれば', | |
3437 | + 'input': 'ワタシヲシテ イワシムレバ', # 'ワタクシヲシテ イワシムレバ' | |
3438 | + }, | |
3439 | + { | |
3440 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.42', | |
3441 | + 'text': '年わかくして', | |
3442 | + 'input': 'トシ ワカクシテ', | |
3443 | + }, | |
3444 | + { | |
3445 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.43', | |
3446 | + 'text': '水清くして', | |
3447 | + 'input': 'ミズ キヨクシテ', | |
3448 | + }, | |
3449 | + { | |
3450 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.45', | |
3451 | + #'text': '二人して', | |
3452 | + 'input': 'フタリシテ', # 2ニンシテ | |
3453 | + }, | |
3454 | + { | |
3455 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.46', | |
3456 | + 'text': 'それだからして', | |
3457 | + 'input': 'ソレダカラシテ', | |
3458 | + }, | |
3459 | + { | |
3460 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.48', | |
3461 | + 'text': '見るべくして', | |
3462 | + 'input': 'ミルベクシテ', | |
3463 | + }, | |
3464 | + { 'note': '【備考1】' }, | |
3465 | + { 'note': '【備考2】' }, | |
3466 | + { | |
3467 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.50', | |
3468 | + 'text': '人として', | |
3469 | + 'input': 'ヒトト シテ', | |
3470 | + }, | |
3471 | + { | |
3472 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.51', | |
3473 | + 'text': '私としては', | |
3474 | + 'input': 'ワタシト シテワ', # 'ワタクシト シテワ', | |
3475 | + }, | |
3476 | + { 'note': '7.「なさい・なさる」などが、独立の動詞であれば前を区切って書く。' }, | |
3477 | + { | |
3478 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.65', | |
3479 | + 'text': '立ってなさい', | |
3480 | + 'input': 'タッテ ナサイ', | |
3481 | + }, | |
3482 | + { | |
3483 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.66', | |
3484 | + 'text': '見てなさい', | |
3485 | + 'input': 'ミテ ナサイ', | |
3486 | + }, | |
3487 | + { 'note': '【備考】動詞の連用形に続く場合は続けて書く。「い」が省略されているときは続けて書く。「お」がついて名詞化した語に「なさい・なさる」が続く場合は区切って書いてよい。' }, | |
3488 | + { | |
3489 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.67', | |
3490 | + 'text': 'お黙りなさい', | |
3491 | + 'input': 'オダマリ ナサイ', | |
3492 | + }, | |
3493 | + { | |
3494 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.70', | |
3495 | + 'text': 'お休みなされる', | |
3496 | + 'input': 'オヤスミ ナサレル', | |
3497 | + }, | |
3498 | + { | |
3499 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.71', | |
3500 | + 'text': 'お読みなされ', | |
3501 | + 'input': 'オヨミ ナサレ', | |
3502 | + }, | |
3503 | + { 'note': '8.形容詞の「ない」は前を区切って書き、助動詞の「ない」は前に続けて書く。' }, | |
3504 | + { | |
3505 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3506 | + 'text': '関係ない', | |
3507 | + 'input': 'カンケイ ナイ', | |
3508 | + }, | |
3509 | + { | |
3510 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3511 | + 'text': '異存なければ', | |
3512 | + 'input': 'イゾン ナケレバ', | |
3513 | + }, | |
3514 | + { | |
3515 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.74', | |
3516 | + 'text': '問題なかった', | |
3517 | + 'input': 'モンダイ ナカッタ', | |
3518 | + }, | |
3519 | + { | |
3520 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.75', | |
3521 | + 'text': 'わかりっこない', | |
3522 | + 'input': 'ワカリッコ ナイ', | |
3523 | + }, | |
3524 | + { | |
3525 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.76', | |
3526 | + 'text': '間違いなし', | |
3527 | + 'input': 'マチガイ ナシ', | |
3528 | + }, | |
3529 | + { | |
3530 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3531 | + 'text': '声なき声', | |
3532 | + 'input': 'コエ ナキ コエ', | |
3533 | + }, | |
3534 | + { | |
3535 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3536 | + 'text': 'こだわりなく', | |
3537 | + 'input': 'コダワリ ナク', | |
3538 | + }, | |
3539 | + { | |
3540 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.79', | |
3541 | + 'text': 'そうじゃない', | |
3542 | + 'input': 'ソージャ ナイ', | |
3543 | + }, | |
3544 | + { | |
3545 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.80', | |
3546 | + 'text': '目じゃない', | |
3547 | + 'input': 'メジャ ナイ', | |
3548 | + }, | |
3549 | + { | |
3550 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3551 | + 'text': '意気地ない', | |
3552 | + 'input': 'イクジ ナイ', | |
3553 | + }, | |
3554 | + { | |
3555 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3556 | + 'text': '自信なげ', | |
3557 | + 'input': 'ジシン ナゲ', | |
3558 | + }, | |
3559 | + { | |
3560 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3561 | + 'text': '起きない', | |
3562 | + 'input': 'オキナイ', | |
3563 | + }, | |
3564 | + { | |
3565 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3566 | + 'text': '歩かない', | |
3567 | + 'input': 'アルカナイ', | |
3568 | + }, | |
3569 | + { | |
3570 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3571 | + 'text': '捨てない', | |
3572 | + 'input': 'ステナイ', | |
3573 | + }, | |
3574 | + { | |
3575 | + 'comment': '点訳のてびき第3版 第3章 その1 8', | |
3576 | + 'text': '間違えない', | |
3577 | + 'input': 'マチガエナイ', | |
3578 | + }, | |
3579 | + { 'note': '【備考】「ない」などが前の語と複合して、1語になっている場合は続けて書く。' }, | |
3580 | + { | |
3581 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.87', | |
3582 | + 'text': '味気ない', | |
3583 | + 'input': 'アジケナイ', | |
3584 | + }, | |
3585 | + { | |
3586 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3587 | + 'text': '呆気ない', | |
3588 | + 'input': 'アッケナイ', | |
3589 | + }, | |
3590 | + { | |
3591 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.95', | |
3592 | + 'text': '隈なく', | |
3593 | + 'input': 'クマナク', | |
3594 | + }, | |
3595 | + { | |
3596 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3597 | + 'text': '難なく', | |
3598 | + 'input': 'ナンナク', | |
3599 | + }, | |
3600 | + { | |
3601 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3602 | + 'text': '何となく', | |
3603 | + 'input': 'ナントナク', | |
3604 | + }, | |
3605 | + { | |
3606 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.98', | |
3607 | + 'text': '心置きなく', | |
3608 | + 'input': 'ココロオキナク', | |
3609 | + }, | |
3610 | + { | |
3611 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.99', | |
3612 | + 'text': '満遍無く', | |
3613 | + 'input': 'マンベンナク', | |
3614 | + }, | |
3615 | + { | |
3616 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3617 | + 'text': '程なく', | |
3618 | + 'input': 'ホドナク', | |
3619 | + }, | |
3620 | + { | |
3621 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3622 | + 'text': '形なし', | |
3623 | + 'input': 'カタナシ', | |
3624 | + }, | |
3625 | + { | |
3626 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3627 | + 'text': '底無し', | |
3628 | + 'input': 'ソコナシ', | |
3629 | + }, | |
3630 | + { | |
3631 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3632 | + 'text': '意気地無し', | |
3633 | + 'input': 'イクジナシ', | |
3634 | + }, | |
3635 | + { | |
3636 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3637 | + 'text': 'ろくでなし', | |
3638 | + 'input': 'ロクデナシ', | |
3639 | + }, | |
3640 | + { | |
3641 | + 'comment': '点訳のてびき第3版 第3章 その1 8 備考', | |
3642 | + 'text': '事も無げ', | |
3643 | + 'input': 'コトモナゲ', | |
3644 | + }, | |
3645 | + { 'note': '<処理>「て」「で」に続く「ない」は、「ない」の前を区切って書いてよい。' }, | |
3646 | + { | |
3647 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.106', | |
3648 | + 'text': '彼にはまだ話してない', | |
3649 | + 'input': 'カレニワ マダ ハナシテ ナイ', | |
3650 | + }, | |
3651 | + { | |
3652 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.107', | |
3653 | + 'text': 'しばらく休んでない', | |
3654 | + 'input': 'シバラク ヤスンデ ナイ', | |
3655 | + }, | |
3656 | + { 'note': '9.形容詞などの「~く」の後ろは区切って書く。' }, | |
3657 | + { | |
3658 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.110', | |
3659 | + 'text': '良くない', | |
3660 | + 'input': 'ヨク ナイ', | |
3661 | + }, | |
3662 | + { | |
3663 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.112', | |
3664 | + 'text': '食べたくなくなる', | |
3665 | + 'input': 'タベタク ナク ナル', | |
3666 | + }, | |
3667 | + { | |
3668 | + 'comment': '点訳のてびき第3版 第3章 その1 5 No.114', | |
3669 | + 'text': 'それどころではなくなる', | |
3670 | + 'input': 'ソレドコロデワ ナク ナル', | |
3671 | + }, | |
3672 | + | |
3673 | + { 'note': '=== その2 複合語 ===' }, | |
3674 | + { 'note': '1.区切ると意味の理解を損なう短い複合語や短い略語は、一続きに書く。' }, | |
3675 | + { | |
3676 | + 'comment': '点訳のてびき第3版 第3章 その2 1', | |
3677 | + 'text': '朝夕', | |
3678 | + 'input': 'アサユー' | |
3679 | + }, | |
3680 | + { 'note': '【備考】内部に助詞などを含んでいても、1語として熟している短い複合語は一続きに書く。' }, | |
3681 | + { | |
3682 | + 'comment': '点訳のてびき第3版 第3章 その2 1 備考', | |
3683 | + 'text': '息の根', | |
3684 | + 'input': 'イキノネ' | |
3685 | + }, | |
3686 | + { 'note': '2.接頭語・接尾語・造語要素と自立語の間は続けて書く。' }, | |
3687 | + { | |
3688 | + 'comment': '点訳のてびき第3版 第3章 その2 2', | |
3689 | + 'text': '相たずさえる', | |
3690 | + 'input': 'アイタズサエル' | |
3691 | + }, | |
3692 | + { | |
3693 | + 'comment': '点訳のてびき第3版 第3章 その2 2', | |
3694 | + 'text': '各種', | |
3695 | + 'input': 'カクシュ' | |
3696 | + }, | |
3697 | + { | |
3698 | + 'comment': '点訳のてびき第3版 第3章 その2 2', | |
3699 | + 'text': '各国', | |
3700 | + 'input': 'カッコク' | |
3701 | + }, | |
3702 | + { | |
3703 | + 'comment': '点訳のてびき第3版 第3章 その2 2', | |
3704 | + 'text': '旧街道', | |
3705 | + 'input': 'キューカイドー' | |
3706 | + }, | |
3707 | + { 'note': '【備考1】接頭語・接尾語・造語要素であっても、意味の理解を助ける場合には、発音上の切れ目を考慮して区切って書いてよい。' }, | |
3708 | + { | |
3709 | + 'comment': '点訳のてびき第3版 第3章 その2 2 備考1', | |
3710 | + 'text': '各党', | |
3711 | + 'input': 'カク トー' | |
3712 | + }, | |
3713 | + { | |
3714 | + 'comment': '点訳のてびき第3版 第3章 その2 2 備考1', | |
3715 | + 'text': '各方面', | |
3716 | + 'input': 'カク ホーメン' | |
3717 | + }, | |
3718 | + { | |
3719 | + 'comment': '点訳のてびき第3版 第3章 その2 2 備考1', | |
3720 | + 'text': '旧陸軍', | |
3721 | + 'input': 'キュー リクグン' | |
3722 | + }, | |
3723 | + { 'note': '【備考2】語頭にある接頭語や造語要素が、マスあけを含む複合語全体にかかる場合には、その後ろを区切って書く。' }, | |
3724 | + { | |
3725 | + 'comment': '点訳のてびき第3版 第3章 その2 2 備考2', | |
3726 | + 'text': '新東京名所', | |
3727 | + 'input': 'シン トーキョー メイショ' | |
3728 | + }, | |
3729 | + { 'note': '【備考3】外来語の接辞も続けて書くが、意味の理解を助ける場合には、区切って書いてよい。' }, | |
3730 | + { | |
3731 | + 'comment': '点訳のてびき第3版 第3章 その2 2 備考3', | |
3732 | + 'text': 'フレンドシップ', | |
3733 | + 'input': 'フレンドシップ' | |
3734 | + }, | |
3735 | + { | |
3736 | + 'comment': '点訳のてびき第3版 第3章 その2 2 備考3', | |
3737 | + 'text': 'インターネット', | |
3738 | + 'input': 'インター ネット' | |
3739 | + }, | |
3740 | + { 'note': '<処理>「等」は「など」「ら」と読む場合には前に続けて書くが、「とう」と読む場合は前を区切って書く。' }, | |
3741 | + { | |
3742 | + 'comment': '点訳のてびき第3版 第3章 その2 2 処理', | |
3743 | + 'text': '山や川等', | |
3744 | + 'input': 'ヤマヤ カワナド' | |
3745 | + }, | |
3746 | + { | |
3747 | + 'comment': '点訳のてびき第3版 第3章 その2 2 処理', | |
3748 | + 'text': '我等は', | |
3749 | + 'input': 'ワレラワ' | |
3750 | + }, | |
3751 | + { 'note': '3.複合名詞の内部に、3拍以上の意味のまとまりが二つ以上あれば、その境目で区切って書くことを原則とする。' }, | |
3752 | + { 'comment': '点訳のてびき第3版 第3章 その2 3.', | |
3753 | + 'text': '桜並木', 'input': 'サクラ ナミキ' }, | |
3754 | + { 'comment': '点訳のてびき第3版 第3章 その2 3.', | |
3755 | + 'text': '花嫁姿', 'input': 'ハナヨメ スガタ' }, | |
3756 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 3.', | |
3757 | + # 'text': '一人娘', 'input': 'ヒトリ ムスメ' }, | |
3758 | + { 'comment': '点訳のてびき第3版 第3章 その2 3.', | |
3759 | + 'text': '左半身', 'input': 'ヒダリ ハンシン' }, | |
3760 | + | |
3761 | + { 'note': '【備考1】接尾語的に用いられている語であっても、3拍以上の漢語は区切って書いてよい。' }, | |
3762 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 3. 備考1', | |
3763 | + # 'text': '手当たり次第', 'input': 'テアタリ シダイ' }, | |
3764 | + { 'comment': '点訳のてびき第3版 第3章 その2 3. 備考1', | |
3765 | + 'text': '若者同士', 'input': 'ワカモノ ドーシ' }, | |
3766 | + | |
3767 | + { 'note': '【備考2】複合動詞や複合形容詞から転成したものや、形容詞の語幹を含んでいる場合など、区切ると意味の理解を損なうおそれのある語は続けて書く。' }, | |
3768 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 3. 備考2', | |
3769 | + # 'text': '扱い始め', 'input': 'アツカイハジメ' }, | |
3770 | + | |
3771 | + { 'note': '【備考3】動詞から転成した3拍以上の語も区切って書くが、自立性が弱いと思われるものは続けて書いてよい。' }, | |
3772 | + { 'note': '【備考4】外来語の複合名詞で、区切ると意味の理解を損なうおそれのある語は続けて書く。' }, | |
3773 | + { 'comment': '点訳のてびき第3版 第3章 その2 3. 備考4', 'text': 'プラットホーム', 'input': 'プラットホーム' }, | |
3774 | + | |
3775 | + { 'note': '4.複合名詞内部の2拍以下の意味のまとまりは、続けて書くことを原則とする。' }, | |
3776 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 4.', | |
3777 | + # 'text': '松並木', 'input': 'マツナミキ' }, | |
3778 | + { 'comment': '点訳のてびき第3版 第3章 その2 4.', | |
3779 | + 'text': '蝉時雨', 'input': 'セミシグレ' }, | |
3780 | + { 'comment': '点訳のてびき第3版 第3章 その2 4.', | |
3781 | + 'text': '右半身', 'input': 'ミギハンシン' }, | |
3782 | + { 'comment': '点訳のてびき第3版 第3章 その2 4.', | |
3783 | + 'text': '腕次第', 'input': 'ウデシダイ' }, | |
3784 | + | |
3785 | + { 'note': '【備考1】2字漢語は、2拍であっても3拍以上の意味のまとまりと同様に扱う。' }, | |
3786 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 4. 備考1', | |
3787 | + # 'text': '母子年金', 'input': 'ボシ ネンキン' }, | |
3788 | + | |
3789 | + { 'note': '【備考2】複合名詞などの意味のまとまりが2拍以下であっても、自立性が強く、意味の理解を助ける場合には、区切って書いてよい。' }, | |
3790 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 4. 備考2', | |
3791 | + # 'text': '要問い合わせ', 'input': 'ヨー トイアワセ' }, | |
3792 | + | |
3793 | + { 'note': '<処理>2拍の外来語を含む混種語は、意味の理解を助ける場合には区切って書いてよい。' }, | |
3794 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 4. 備考2', | |
3795 | + # 'text': 'バス停留所', 'input': 'バス テイリュージョ' }, | |
3796 | + | |
3797 | + { 'note': '5.内部に二つ以上の意味のまとまりがない場合や、区切ると意味の理解を損なうおそれのある複合名詞は続けて書く。' }, | |
3798 | + { 'comment': '点訳のてびき第3版 第3章 その2 5.', | |
3799 | + 'text': '小中学校', 'input': 'ショーチューガッコー' }, | |
3800 | + | |
3801 | + { 'note': '6.アルファベットを含む複合名詞は、語句のまとまりを考慮して続けて書くか、適宜区切って書く。' }, | |
3802 | + { 'note': '7.漢字1字ずつが対等な関係で並んでいる複合名詞などは、意味の理解を容易にするために、語句のまとまりや発音などを考慮して適宜区切るか、すべてを続けて書く。' }, | |
3803 | + { 'note': '8.複合名詞は続けて書くことを原則とする。' }, | |
3804 | + { 'comment': '点訳のてびき第3版 第3章 その2 8.', | |
3805 | + 'text': '飛び込む', 'input': 'トビコム' }, | |
3806 | + | |
3807 | + { 'note': '【備考】内部に助詞「て」を含む場合は「て」の後ろで区切って書いてよい。' }, | |
3808 | + { 'comment': '点訳のてびき第3版 第3章 その2 8. 備考', | |
3809 | + 'text': 'やってくる', 'input': 'ヤッテ クル' }, | |
3810 | + | |
3811 | + { 'note': '9.名詞や副詞に動詞の「する」が続く場合は、「する」の前を区切って書くことを原則とする。' }, | |
3812 | + { 'note': '【備考1】1字漢語などに「する」が続いて音韻が変化したり、連濁する語は続けて書く。' }, | |
3813 | + { 'note': '【備考2】1字漢語に「する」が続く場合は一続きに書くが、「する」の前に助詞「を」をはさむことができる場合は区切って書いてよい。' }, | |
3814 | + { 'note': '【備考3】和語に「する」が続く語は、区切って書くが、和語の自立性が弱いと思われる場合は続けて書いてよい。' }, | |
3815 | + { 'note': '10.複合形容詞は続けて書く。' }, | |
3816 | + #{ 'comment': '点訳のてびき第3版 第3章 その2 10.', | |
3817 | + # 'text': '面白おかしい', 'input': 'オモシロオカシイ' }, | |
3818 | + | |
3819 | + { 'note': '11.接続詞句や副詞句は、意味の理解を容易にするために、発音上の切れ目などを考慮して適宜区切って書く。' }, | |
3820 | + { 'note': '12.連濁を生じた複合語は続けて書く。' }, | |
3821 | + { 'comment': '点訳のてびき第3版 第3章 その2 12.', | |
3822 | + 'text': '柱時計', 'input': 'ハシラドケイ' }, | |
3823 | + | |
3824 | + { 'note': '13.短い語からなる慣用句などは、すべて続けて書くか、意味のまとまりを目安に適宜区切って書く。' }, | |
3825 | + { 'note': '14.年月日や名数などは、その段階ごとに区切って書く。' }, | |
3826 | + { | |
3827 | + 'comment': '点訳のてびき第3版 第3章 その2 14', | |
3828 | + 'text': '4月15日', | |
3829 | + 'input': '4ガツ 15ニチ' | |
3830 | + }, | |
3831 | + { | |
3832 | + 'comment': '点訳のてびき第3版 第3章 その2 14', | |
3833 | + 'text': '04月', | |
3834 | + 'input': '04ガツ' | |
3835 | + }, | |
3836 | + { 'note': '【備考】年月日や名数などの後ろに続く2拍以下の語は、意味の理解を助ける場合には発音上の切れ目を考慮して区切って書いてよい。' }, | |
3837 | + { 'note': '15.二つ以上の意味のまとまりからなる繰り返し言葉は、区切って書くことを原則とする。' }, | |
3838 | + { 'note': '【備考1】連濁する語は続けて書く。' }, | |
3839 | + { 'note': '【備考2】区切ると意味の理解を損なう場合は続けて書く。' }, | |
3840 | + { 'note': '【備考3】擬声語・擬態語は、3拍以上の繰り返しは区切って書き、2拍以下の繰り返しは続けて書く。' }, | |
3841 | + { 'note': '16.動植物名や理化学用語なども、複合動詞の切れ続きに準じて書くことを原則とする。' }, | |
3842 | + { 'note': '【備考】区切ると意味の理解を損なうと思われる場合は、第1つなぎ符をはさんで続けて書くか、一続きに書くことができる。' }, | |
3843 | + { 'note': '17.医学用語などは、発音や意味のまとまりに留意して、複合動詞の切れ続きに準じて書く。' }, | |
3844 | + | |
3845 | + { 'note': '=== その3 固有名詞 ===' }, | |
3846 | + { 'note': '1.人名の名字と名前の間は、区切って書く。' }, | |
3847 | + { | |
3848 | + 'comment': '点訳のてびき第3版 第3章 その3 1.', | |
3849 | + 'text': '湯川秀樹', | |
3850 | + 'input': 'ユカワ ヒデキ' | |
3851 | + }, | |
3852 | + { | |
3853 | + 'comment': '点訳のてびき第3版 第3章 その3 1.', | |
3854 | + 'text': '石川倉次', | |
3855 | + 'input': 'イシカワ クラジ' | |
3856 | + }, | |
3857 | + { | |
3858 | + 'comment': '点訳のてびき第3版 第3章 その3 1.', | |
3859 | + 'text': '武者小路実篤', | |
3860 | + 'input': 'ムシャノコージ サネアツ' | |
3861 | + }, | |
3862 | + { 'note': '3.人名に続く「さん」「様」「君」「殿」「氏(し)」「氏(うじ)」は、区切って書く。' }, | |
3863 | + { | |
3864 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3865 | + 'text': '鈴木さん', 'input': 'スズキ サン' | |
3866 | + }, | |
3867 | + { | |
3868 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3869 | + 'text': '鈴木様', 'input': 'スズキ サマ' | |
3870 | + }, | |
3871 | + { | |
3872 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3873 | + 'text': '鈴木さま', 'input': 'スズキ サマ' | |
3874 | + }, | |
3875 | + { | |
3876 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3877 | + 'text': '鈴木君', 'input': 'スズキ クン' | |
3878 | + }, | |
3879 | + { | |
3880 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3881 | + 'text': '鈴木くん', 'input': 'スズキ クン' | |
3882 | + }, | |
3883 | + { | |
3884 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3885 | + 'text': '鈴木殿', 'input': 'スズキ ドノ' | |
3886 | + }, | |
3887 | + { | |
3888 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3889 | + 'text': '鈴木氏', 'input': 'スズキ シ' | |
3890 | + }, | |
3891 | + { | |
3892 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3893 | + 'text': '一郎君', 'input': 'イチロー クン' | |
3894 | + }, | |
3895 | + { | |
3896 | + 'comment': '点訳のてびき第3版 第3章 その3 3.', | |
3897 | + 'text': '一郎くん', 'input': 'イチロー クン' | |
3898 | + }, | |
3899 | + { | |
3900 | + 'comment': '点訳のてびき第3版 第3章 その3 3. 備考1', | |
3901 | + 'text': '魚屋さん', 'input': 'サカナヤサン' | |
3902 | + }, | |
3903 | + | |
3904 | + { 'note': '4.地名(国名を含む)および地名と接尾語や造語要素または普通名詞などとの複合語は、段階(都道府県・市区町村)ごとに区切って書く。' }, | |
3905 | + { | |
3906 | + 'comment': '点訳のてびき第3版 第3章 その3 4.', | |
3907 | + 'text': '東京都千代田区永田町1の7', | |
3908 | + 'input': 'トーキョート チヨダク ナガタチョー 1ノ 7' | |
3909 | + }, | |
3910 | + { | |
3911 | + 'text': '東京都千代田区永田町1-7', | |
3912 | + 'input': 'トーキョート チヨダク ナガタチョー 1-7' | |
3913 | + }, | |
3914 | + { | |
3915 | + 'text': '東京都千代田区永田町一の七', | |
3916 | + 'input': 'トーキョート チヨダク ナガタチョー 1ノ 7' | |
3917 | + }, | |
3918 | + { | |
3919 | + 'comment': '点訳のてびき第3版 第3章 その3 4.', | |
3920 | + 'text': '福島県伊達市月舘町月舘', | |
3921 | + 'input': 'フクシマケン ダテシ ツキダテマチ ツキダテ' | |
3922 | + }, | |
3923 | + {'text':'綾部市保健福祉センター', 'input':'アヤベシ ホケン フクシ センター'}, | |
3924 | + {'text':'東京都交通局', 'input':'トーキョート コーツーキョク'}, | |
3925 | + {'text':'府中町役場', 'input':'フチューマチ ヤクバ'}, | |
3926 | + {'text':'町役場', 'input':'マチヤクバ'}, | |
3927 | + | |
3928 | + { 'note': '=== その4 方言・古文など ===' }, | |
3929 | + | |
3930 | + { 'note': '== 第4章 記号類の使い方 ==' }, | |
3931 | + { 'note': '=== その1 句読符 ===' }, | |
3932 | + { 'note': '==== 1.句点 ====' }, | |
3933 | + { | |
3934 | + 'comment': '点訳のてびき第3版 第4章 その1 1.', | |
3935 | + 'text': '雨が降っていた。けれどぼくは出かけた。', | |
3936 | + 'input': 'アメガ フッテ イタ。ケレド ボクワ デカケタ。', | |
3937 | + 'output': '⠁⠿⠐⠡ ⠭⠂⠟ ⠃⠕⠲ ⠫⠛⠐⠞ ⠐⠮⠩⠄ ⠐⠟⠡⠫⠕⠲', | |
3938 | + 'inpos1': [0,1,2,2,3,4,5,6,7,8,9,10,10,10,11,12,13,13,14,15,15,16,17,18,19,19,20,21,22,23], | |
3939 | + }, | |
3940 | + { 'note': '==== 2.疑問符、感嘆符 ====' }, | |
3941 | + { | |
3942 | + 'comment': '点訳のてびき第3版 第4章 その1 2.', | |
3943 | + 'text': 'お元気? 久しぶりですね。', | |
3944 | + 'input': 'オゲンキ? ヒサシブリデスネ。', | |
3945 | + 'output': '⠊⠐⠫⠴⠣⠢ ⠧⠱⠳⠐⠭⠓⠐⠟⠹⠏⠲', | |
3946 | + 'inpos1': [0,1,1,2,3,4,4,5,6,7,8,9,9,10,11,11,12,13,14], | |
3947 | + }, | |
3948 | + { | |
3949 | + 'comment': '点訳のてびき第3版 第4章 その1 2.', | |
3950 | + 'text': 'えっ! 彼が哲学者!?', | |
3951 | + 'input': 'エッ! カレガ テツガクシャ!?', | |
3952 | + #'output': '⠋⠂⠖ ⠡⠛⠐⠡ ⠟⠝⠐⠡⠩⠈⠱⠖⠢', | |
3953 | + }, | |
3954 | + { 'note': '==== 3.読点 ====' }, | |
3955 | + { | |
3956 | + 'comment': '点訳のてびき第3版 第4章 その1 3.', | |
3957 | + 'text': '森には、いろいろな動物が住んでいる。', | |
3958 | + 'input': 'モリニワ、イロイロナ ドーブツガ スンデ イル。', | |
3959 | + 'output': '⠾⠓⠇⠄⠰ ⠃⠚⠃⠚⠅ ⠐⠞⠒⠐⠭⠝⠐⠡ ⠹⠴⠐⠟ ⠃⠙⠲', | |
3960 | + 'inpos1': [0,1,2,3,4,4,5,6,7,8,9,10,11,11,12,13,13,14,15,15,16,17,18,19,19,20,21,22,23], | |
3961 | + }, | |
3962 | + { 'note': '==== 4.中点 ====' }, | |
3963 | + { | |
3964 | + 'comment': '点訳のてびき第3版 第4章 その1 4.', | |
3965 | + 'text': '松・杉・檜は、針葉樹です。', | |
3966 | + 'input': 'マツ・スギ・ヒノキワ、シンヨージュデス。', | |
3967 | + 'output': '⠵⠝⠐ ⠹⠐⠣⠐ ⠧⠎⠣⠄⠰ ⠳⠴⠜⠒⠘⠹⠐⠟⠹⠲', | |
3968 | + 'inpos1': [0,1,2,2,3,4,4,5,5,6,7,8,9,10,10,11,12,13,14,15,15,17,17,18,19], | |
3969 | + }, | |
3970 | + { 'note': '=== その2 囲みの記号 ===' }, | |
3971 | + { 'note': '==== 1.カギ類 ====' }, | |
3972 | + { | |
3973 | + 'comment': '点訳のてびき第3版 第4章 その2 1.', | |
3974 | + 'text': '「住所」「氏名」「電話番号」を書いてください。', | |
3975 | + 'input': '「ジューショ」 「シメイ」 「デンワ バンゴー」ヲ カイテ クダサイ。', | |
3976 | + #'output': '⠤⠘⠹⠒⠈⠺⠤ ⠤⠳⠿⠃⠤ ⠤⠐⠟⠴⠄ ⠐⠥⠴⠐⠪⠒⠤⠔ ⠡⠃⠟ ⠩⠐⠕⠱⠃⠲', | |
3977 | + }, | |
3978 | + { 'note': '==== 2.カッコ類 ====' }, | |
3979 | + { | |
3980 | + 'comment': '点訳のてびき第3版 第4章 その2 2.', | |
3981 | + 'text': 'Au(金)の比重', | |
3982 | + 'input': 'Au(キン)ノ ヒジュー', | |
3983 | + 'output': '⠰⠠⠁⠥⠶⠣⠴⠶⠎ ⠧⠘⠹⠒', | |
3984 | + 'inpos1': [0,0,0,1,2,3,4,5,6,7,8,9,9,11], | |
3985 | + }, | |
3986 | + { | |
3987 | + 'comment': '点訳のてびき第3版 第4章 その2 2.', | |
3988 | + 'text': 'すぐ(に)(副詞)陽が暮れる。', # 日が暮れる→読み付与誤り回避の変更 | |
3989 | + 'input': 'スグ(ニ) (フクシ) ヒガ クレル。', | |
3990 | + 'output': '⠹⠐⠩⠶⠇⠶ ⠶⠭⠩⠳⠶ ⠧⠐⠡ ⠩⠛⠙⠲', | |
3991 | + 'inpos1': [0,1,1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,15,16,17,18], | |
3992 | + }, | |
3993 | + { 'note': '==== 3.指示符類 ====' }, | |
3994 | + { 'note': '==== 4.外国語引用符 ====' }, | |
3995 | + { | |
3996 | + 'comment': '点訳のてびき第3版 第4章 その2 4.', | |
3997 | + #'text': '“MODERN TIMES”', | |
3998 | + 'input': '⠦MODERN TIMES⠴', | |
3999 | + 'output': '⠦⠠⠠⠍⠕⠙⠑⠗⠝ ⠠⠠⠞⠊⠍⠑⠎⠴', | |
4000 | + 'inpos1': [0,1,1,1,2,3,4,5,6,7,8,8,8,9,10,11,12,13], | |
4001 | + }, | |
4002 | + { 'note': '==== 5.発音記号符 ====' }, | |
4003 | + { 'note': '==== 6.点訳者挿入符 ====' }, | |
4004 | + { 'note': '==== 7.段落挿入符類 ====' }, | |
4005 | + | |
4006 | + { 'note': '=== その3 線類 ===' }, | |
4007 | + { 'note': '==== 1.棒線・点線 ====' }, | |
4008 | + { 'note': '==== 2.矢印類 ====' }, | |
4009 | + { | |
4010 | + 'comment': '点訳のてびき第3版 第4章 その3 2.', | |
4011 | + 'text': '札幌→東京', | |
4012 | + 'input': 'サッポロ→トーキョー', | |
4013 | + 'output': '⠱⠂⠠⠮⠚ ⠒⠒⠕ ⠞⠒⠈⠪⠒', | |
4014 | + }, | |
4015 | + { | |
4016 | + 'comment': '点訳のてびき第3版 第4章 その3 2.', | |
4017 | + 'text': '札幌←東京', | |
4018 | + 'input': 'サッポロ←トーキョー', | |
4019 | + 'output': '⠱⠂⠠⠮⠚ ⠪⠒⠒ ⠞⠒⠈⠪⠒', | |
4020 | + }, | |
4021 | + { 'note': '==== 3.波線 ====' }, | |
4022 | + | |
4023 | + { 'note': '=== その4 その他の記号類 ===' }, | |
4024 | + { 'note': '==== 1.つなぎ符類 ====' }, | |
4025 | + { 'note': '【備考1】数字に続く「ワ」の後ろにア行・ラ行のカナが3つ続くときは、位取り点と誤読されるので、その場合に限り第1つなぎ符を用いる。' }, | |
4026 | + { | |
4027 | + 'comment': '点訳のてびき第3版 第4章 その4 1. 備考1', | |
4028 | + 'text': '4割入り', | |
4029 | + 'input': '4ワリイリ', | |
4030 | + 'output': '⠼⠙⠤⠄⠓⠃⠓', | |
4031 | + 'inpos1': [0,0,0,1,2,3,4], | |
4032 | + }, | |
4033 | + { | |
4034 | + 'comment': '点訳のてびき第3版 第4章 その4 1. 備考1に該当しない場合', | |
4035 | + 'text': '4割抜き', | |
4036 | + 'input': '4ワリ ヌキ', | |
4037 | + 'output': '⠼⠙⠄⠓ ⠍⠣', | |
4038 | + 'inpos1': [0,0,1,2,3,4,5], | |
4039 | + }, | |
4040 | + { 'note': '==== 2.小見出し符類 ====' }, | |
4041 | + { 'note': '==== 3.文中注記符 ====' }, | |
4042 | + { 'note': '==== 4.星印類 ====' }, | |
4043 | + { | |
4044 | + 'comment': '白星印を 56-2346-2 と定義', | |
4045 | + 'text': '☆', | |
4046 | + 'input': '☆', | |
4047 | + 'output': '⠰⠮⠂', | |
4048 | + }, | |
4049 | + { | |
4050 | + 'comment': '黒星印を 56-2346-23 と定義', | |
4051 | + 'text': '★', | |
4052 | + 'input': '★', | |
4053 | + 'output': '⠰⠮⠆', | |
4054 | + }, | |
4055 | + { | |
4056 | + 'comment': '第1星印 35-35 (後ろを1マスあける)', | |
4057 | + 'text': '※あ', | |
4058 | + 'input': '※ア', | |
4059 | + 'output': '⠔⠔ ⠁', | |
4060 | + }, | |
4061 | + { 'note': '==== 5.詩行符類 ====' }, | |
4062 | + { 'note': '==== 6.空欄符号 ====' }, | |
4063 | + { 'note': '==== 7.伏せ字 ====' }, | |
4064 | + { | |
4065 | + 'comment': '白丸を 6-1356-2 と定義', | |
4066 | + 'text': '○', | |
4067 | + 'input': '○', | |
4068 | + 'output': '⠠⠵⠂', | |
4069 | + }, | |
4070 | + { | |
4071 | + 'comment': '黒丸を 6-1356-23 と定義', | |
4072 | + 'text': '●', | |
4073 | + 'input': '●', | |
4074 | + 'output': '⠠⠵⠆', | |
4075 | + }, | |
4076 | + { | |
4077 | + 'comment': '二重丸を 6-1356-256 と定義', | |
4078 | + 'text': '◎', | |
4079 | + 'input': '◎', | |
4080 | + 'output': '⠠⠵⠲', | |
4081 | + }, | |
4082 | + { | |
4083 | + 'comment': '白四角を 6-1256-2 と定義', | |
4084 | + 'text': '□', | |
4085 | + 'input': '□', | |
4086 | + 'output': '⠠⠳⠂', | |
4087 | + }, | |
4088 | + { | |
4089 | + 'comment': '黒四角を 6-1256-23 と定義', | |
4090 | + 'text': '■', | |
4091 | + 'input': '■', | |
4092 | + 'output': '⠠⠳⠆', | |
4093 | + }, | |
4094 | + { | |
4095 | + 'comment': '白上向き三角を 6-156-2 と定義', | |
4096 | + 'text': '△', | |
4097 | + 'input': '△', | |
4098 | + 'output': '⠠⠱⠂', | |
4099 | + }, | |
4100 | + { | |
4101 | + 'comment': '黒上向き三角を 6-156-23 と定義', | |
4102 | + 'text': '▲', | |
4103 | + 'input': '▲', | |
4104 | + 'output': '⠠⠱⠆', | |
4105 | + }, | |
4106 | + { | |
4107 | + 'comment': '白下向き三角を 56-156-2 と定義', | |
4108 | + 'text': '▽', | |
4109 | + 'input': '▽', | |
4110 | + 'output': '⠰⠱⠂', | |
4111 | + }, | |
4112 | + { | |
4113 | + 'comment': '黒下向き三角を 56-156-23 と定義', | |
4114 | + 'text': '▼', | |
4115 | + 'input': '▼', | |
4116 | + 'output': '⠰⠱⠆', | |
4117 | + }, | |
4118 | + { | |
4119 | + 'comment': '白菱形を 46-1236-2 と定義(1236=ひ)', | |
4120 | + 'text': '◇', | |
4121 | + 'input': '◇', | |
4122 | + 'output': '⠨⠧⠂', | |
4123 | + }, | |
4124 | + { | |
4125 | + 'comment': '黒菱形を 46-1256-23 と定義(1236=ひ)', | |
4126 | + 'text': '◆', | |
4127 | + 'input': '◆', | |
4128 | + 'output': '⠨⠧⠆', | |
4129 | + }, | |
4130 | + { | |
4131 | + 'comment': 'バツ印を 56-16-2 と定義', | |
4132 | + 'text': '×', | |
4133 | + 'input': '×', | |
4134 | + 'output': '⠰⠡⠂', | |
4135 | + }, | |
4136 | + { 'note': '==== 8.パーセント ====' }, | |
4137 | + { | |
4138 | + 'comment': '点訳のてびき第3版 第4章 その4 8.', | |
4139 | + 'text': '100%', | |
4140 | + 'input': '100%', | |
4141 | + 'output': '⠼⠁⠚⠚⠰⠏', | |
4142 | + 'inpos2': [0,1,2,3], | |
4143 | + 'inpos1': [0,0,1,2,3,3], | |
4144 | + 'inpos': [0,0,1,2,3,3], | |
4145 | + }, | |
4146 | + { | |
4147 | + 'comment': '点訳のてびき第3版 第4章 その4 8.', | |
4148 | + 'text': '数%', | |
4149 | + 'input': 'スー%', | |
4150 | + 'output': '⠹⠒⠰⠏', | |
4151 | + 'inpos1': [0,1,2,2], | |
4152 | + }, | |
4153 | + { | |
4154 | + 'comment': '点訳のてびき第3版 第4章 その4 8.', | |
4155 | + 'text': 'A%', | |
4156 | + 'input': 'A%', | |
4157 | + 'output': '⠰⠠⠁⠰⠏', | |
4158 | + 'inpos2': [0,1], | |
4159 | + 'inpos1': [0,0,0,1,1], | |
4160 | + 'inpos': [0,0,0,1,1], | |
4161 | + }, | |
4162 | + { | |
4163 | + 'comment': '点訳のてびき第3版 第4章 その4 8.', | |
4164 | + 'text': '25%引き', | |
4165 | + 'input': '25%ビキ', | |
4166 | + 'output': '⠼⠃⠑⠰⠏⠐⠧⠣', | |
4167 | + 'inpos2': [0,1,2,3,4], | |
4168 | + 'inpos1': [0,0,1,2,2,3,3,4], | |
4169 | + 'inpos': [0,0,1,2,2,3,3,4], | |
4170 | + }, | |
4171 | + { | |
4172 | + 'comment': '点訳のてびき第3版 第4章 その4 8.', | |
4173 | + 'text': '××%', | |
4174 | + 'input': '××%', | |
4175 | + #'output': '⠐⠿⠐⠿⠤⠰⠏', | |
4176 | + 'inpos2': [0,1,2], | |
4177 | + }, | |
4178 | + { 'note': '==== 9.アンドマーク ====' }, | |
4179 | + { | |
4180 | + 'comment': '点訳のてびき第3版 第4章 その4 9.', | |
4181 | + 'text': 'Q&A', | |
4182 | + 'input': 'Q & A', | |
4183 | + 'output': '⠰⠠⠟ ⠰⠯ ⠰⠠⠁', | |
4184 | + 'inpos1': [0,0,0,1,2,2,3,4,4,4], | |
4185 | + }, | |
4186 | + { | |
4187 | + 'comment': '点訳のてびき第3版 第4章 その4 9.', | |
4188 | + 'text': 'シャープス&フラッツ', | |
4189 | + 'input': 'シャープス & フラッツ', | |
4190 | + 'output': '⠈⠱⠒⠠⠭⠹ ⠰⠯ ⠭⠑⠂⠝', | |
4191 | + 'inpos1': [0,0,2,3,3,4,5,6,6,7,8,9,10,11], | |
4192 | + }, | |
4193 | + { 'note': '==== 10.ナンバーマーク ====' }, | |
4194 | + { | |
4195 | + 'comment': '点訳のてびき第3版 第4章 その4 10.', | |
4196 | + 'text': '4#で応答メッセージが録音できます。', | |
4197 | + 'input': '4# デ オートー メッセージガ ロクオン デキマス。', | |
4198 | + 'output': '⠼⠙⠰⠩ ⠐⠟ ⠊⠒⠞⠒ ⠿⠂⠻⠒⠐⠳⠐⠡ ⠚⠩⠊⠴ ⠐⠟⠣⠵⠹⠲', | |
4199 | + 'inpos1': [0,0,1,1,2,3,3,4,5,6,7,8,9,10,11,12,13,14,14,15,15,16,17,18,19,20,21,22,22,23,24,25,26], | |
4200 | + }, | |
4201 | + { | |
4202 | + 'comment': '点訳のてびき第3版 第4章 その4 10.', | |
4203 | + 'text': '#50のミシン糸', | |
4204 | + 'input': '#50ノ ミシンイト', | |
4205 | + 'output': '⠰⠩⠼⠑⠚⠎ ⠷⠳⠴⠃⠞', | |
4206 | + 'inpos1': [0,0,1,1,2,3,4,5,6,7,8,9], | |
4207 | + }, | |
4208 | + { 'note': '==== 11.アステリスク ====' }, | |
4209 | + { | |
4210 | + 'comment': '点訳のてびき第3版 第4章 その4 11.', | |
4211 | + 'text': '*または#を押すたびに', | |
4212 | + 'input': '* マタワ # ヲ オス タビニ', | |
4213 | + 'output': '⠰⠡ ⠵⠕⠄ ⠰⠩ ⠔ ⠊⠹ ⠕⠐⠧⠇', | |
4214 | + 'inpos1': [0,0,1,2,3,4,5,6,6,7,8,9,10,11,12,13,14,14,15], | |
4215 | + }, | |
4216 | + { 'note': '==== 12.小文字符 ====' }, | |
4217 | + { | |
4218 | + 'comment': '点訳のてびき第3版 第4章 その4 12.', | |
4219 | + #'text': '「ァ」は、', | |
4220 | + 'input': '「ァ」ワ、', | |
4221 | + #'output': '⠤⠘⠁⠤⠄⠰', | |
4222 | + }, | |
4223 | + { 'note': '+ ポジションマッピング +' }, | |
4224 | + { | |
4225 | + 'text': '12345 ', | |
4226 | + 'input': '12345 ', | |
4227 | + 'output': '⠼⠁⠃⠉⠙⠑ ', | |
4228 | + 'inpos2': [0,1,2,3,4,5], | |
4229 | + 'inpos1': [0,0,1,2,3,4,5], | |
4230 | + 'inpos': [0,0,1,2,3,4,5], | |
4231 | + 'comment': '行末の空白を保存する', | |
4232 | + }, | |
4233 | + { | |
4234 | + 'text': 'やっぱり ', | |
4235 | + 'input': 'ヤッパリ ', | |
4236 | + 'output': '⠌⠂⠠⠥⠓ ', | |
4237 | + 'inpos2': [0,1,2,3,4], | |
4238 | + 'inpos1': [0,1,2,2,3,4], | |
4239 | + 'inpos': [0,1,2,2,3,4], | |
4240 | + }, | |
4241 | + { | |
4242 | + 'text': '機能 ', | |
4243 | + 'input': 'キノー ', | |
4244 | + 'output': '⠣⠎⠒ ', | |
4245 | + 'inpos2': [0,0,1,2], | |
4246 | + 'inpos1': [0,1,2,3], | |
4247 | + 'inpos': [0,0,1,2], | |
4248 | + }, | |
4249 | + { | |
4250 | + 'text': '実技 ', | |
4251 | + 'input': 'ジツギ ', | |
4252 | + 'output': '⠐⠳⠝⠐⠣ ', | |
4253 | + 'inpos2': [0,0,1,2], | |
4254 | + 'inpos1': [0,0,1,2,2,3], | |
4255 | + 'inpos': [0,0,0,1,1,2], | |
4256 | + }, | |
4257 | + | |
4258 | + { 'note': '+ 点字表記辞典 +' }, | |
4259 | + { 'text': '相対する', 'input': 'アイタイスル'}, | |
4260 | + { 'text': '相たずさえて', 'input': 'アイタズサエテ'}, | |
4261 | + { 'text': '相整う', 'input': 'アイトトノウ'}, | |
4262 | + { 'text': '相憐れむ', 'input': 'アイアワレム'}, | |
4263 | + { 'text': '木立の間', 'input': 'コダチノ アイダ'}, | |
4264 | + { 'text': '開いた口', 'input': 'アイタ クチ'}, | |
4265 | + { 'text': '相無く', 'input': 'アイナク'}, | |
4266 | + { 'text': 'お生憎様', 'input': 'オアイニクサマ'}, | |
4267 | + { 'text': '開かずの間', 'input': 'アカズノ マ'}, | |
4268 | + { 'text': '不開の間', 'input': 'アカズノ マ'}, | |
4269 | + { 'text': '山田県主', 'input': 'ヤマダノ アガタヌシ'}, | |
4270 | + { 'text': '暁闇', 'input': 'アカツキヤミ'}, | |
4271 | + { 'text': '上がり降り', 'input': 'アガリオリ'}, | |
4272 | + { 'text': '四条上ル', 'input': '4ジョー アガル'}, | |
4273 | + { 'text': '秋津国', 'input': 'アキツクニ'}, | |
4274 | + { 'text': '現つ神', 'input': 'アキツカミ'}, | |
4275 | + { 'text': '阿Q正伝', 'input': 'アQ セイデン'}, | |
4276 | + { 'text': '悪源太', 'input': 'アクゲンタ'}, | |
4277 | + { 'text': '明くる朝', 'input': 'アクル アサ'}, | |
4278 | + { 'text': '明くる年', 'input': 'アクル トシ'}, | |
4279 | + { 'text': '明の星', 'input': 'アケノ ホシ'}, | |
4280 | + { 'text': '麻布十番', 'input': 'アザブ ジューバン'}, | |
4281 | + { 'text': '男漁り', 'input': 'オトコ アサリ'}, | |
4282 | + { 'text': '古本漁り', 'input': 'フルホン アサリ'}, | |
4283 | + { 'text': '足の甲', 'input': 'アシノ コー'}, | |
4284 | + { 'text': '日の足', 'input': 'ヒノアシ'}, | |
4285 | + { 'text': '醤油味', 'input': 'ショーユ アジ'}, | |
4286 | + { 'text': '源朝臣頼政', 'input': 'ミナモトノ アソン ヨリマサ'}, | |
4287 | + { 'text': '兄貴風を吹かす', 'input': 'アニキカゼヲ フカス'}, | |
4288 | + { 'text': '東漢直駒', 'input': 'ヤマトノ アヤノ アタイノ コマ'}, | |
4289 | + { 'text': '天照大神', 'input': 'アマテラス オオミカミ'}, | |
4290 | + { 'text': '天の岩戸', 'input': 'アマノ イワト'}, | |
4291 | + { 'text': '天香具山', 'input': 'アマノ カグヤマ'}, | |
4292 | + { 'text': '天の羽衣', 'input': 'アマノ ハゴロモ'}, | |
4293 | + { 'text': '天の原', 'input': 'アマノハラ'}, | |
4294 | + { 'text': '天鈿女命', 'input': 'アメノ ウズメノ ミコト'}, | |
4295 | + { 'text': '水争', 'input': 'ミズアラソイ'}, | |
4296 | + #{ 'text': 'あらぬ方を向く', 'input': 'アラヌ カタヲ ムク'}, | |
4297 | + { 'text': '蟻の塔草', 'input': 'アリノトーグサ'}, | |
4298 | + { 'text': '有りの儘に打ち明ける', 'input': 'アリノママニ ウチアケル'}, | |
4299 | + { 'text': '有りの実', 'input': 'アリノミ'}, | |
4300 | + { 'text': '栄えある', 'input': 'ハエ アル'}, | |
4301 | + { 'text': '或る程度', 'input': 'アル テイド'}, | |
4302 | + { 'text': '有るが儘', 'input': 'アルガ ママ'}, | |
4303 | + { 'text': 'アルカリ泉', 'input': 'アルカリセン'}, | |
4304 | + { 'text': '合わせ鏡', 'input': 'アワセ カガミ'}, | |
4305 | + { 'text': '鬘合わせ', 'input': 'カツラ アワセ'}, | |
4306 | + { 'text': '暗順応', 'input': 'アンジュンノー'}, | |
4307 | + | |
4308 | + ] | |
4309 | + |
@@ -0,0 +1,248 @@ | ||
1 | +# -*- coding: utf-8 -*- | |
2 | +#jptools/jpBrailleRunner.py | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#This file is covered by the GNU General Public License. | |
5 | +#See the file COPYING for more details. | |
6 | +#Copyright (C) 2013 Masataka.Shinke, Takuya Nishimoto | |
7 | +# h1: カナと記号のテスト | |
8 | +# h2: テキスト解析とマスあけのテスト | |
9 | + | |
10 | +# from __future__ import unicode_literals | |
11 | +import sys | |
12 | +sys.path.append(r'..\source\synthDrivers\jtalk') | |
13 | +from harness import tests | |
14 | +import os | |
15 | +import sys | |
16 | +import optparse | |
17 | +import datetime | |
18 | +import cStringIO | |
19 | +import timeit | |
20 | + | |
21 | +jtalk_dir = os.path.join(os.getcwdu(), '..', 'source', 'synthDrivers', 'jtalk') | |
22 | +sys.path.append(jtalk_dir) | |
23 | + | |
24 | +import translator1 | |
25 | +import translator2 | |
26 | + | |
27 | +def __write(file, s=""): | |
28 | + file.write(s.encode('utf-8', 'ignore')) | |
29 | + | |
30 | +def __writeln(file, s=""): | |
31 | + file.write(s.encode('utf-8', 'ignore') + "\n") | |
32 | + | |
33 | +output = None | |
34 | + | |
35 | +def __print(s=""): | |
36 | + global output | |
37 | + output.write(s.encode('utf-8', 'ignore') + "\n") | |
38 | + | |
39 | +def dot_numbers(s): | |
40 | + ret = [] | |
41 | + for c in s: | |
42 | + code = ord(c) | |
43 | + if code == 0x20 or code == 0x2800: | |
44 | + ret.append('0') | |
45 | + elif 0x2801 <= code and code <= 0x28ff: | |
46 | + ar = [] | |
47 | + if code & 0x01: ar.append('1') | |
48 | + if code & 0x02: ar.append('2') | |
49 | + if code & 0x04: ar.append('3') | |
50 | + if code & 0x08: ar.append('4') | |
51 | + if code & 0x10: ar.append('5') | |
52 | + if code & 0x20: ar.append('6') | |
53 | + if code & 0x40: ar.append('7') | |
54 | + if code & 0x80: ar.append('8') | |
55 | + ret.append(u''.join(ar)) | |
56 | + return u' '.join(ret) | |
57 | + | |
58 | +def pass1(): | |
59 | + global output | |
60 | + outfile = '__h1output.txt' | |
61 | + with open(outfile, 'w') as f: | |
62 | + count = 0 | |
63 | + for t in tests: | |
64 | + if t.has_key('output'): | |
65 | + result, inpos1 = translator1.translateWithInPos(t['input']) | |
66 | + if t.has_key('inpos1'): | |
67 | + correct_inpos1 = ','.join(['%d' % n for n in t['inpos1'] ]) | |
68 | + else: | |
69 | + correct_inpos1 = None | |
70 | + result_inpos1 = ','.join(['%d' % n for n in inpos1]) | |
71 | + if result != t['output'] or \ | |
72 | + (correct_inpos1 and result_inpos1 != correct_inpos1) or \ | |
73 | + (len(result) != len(inpos1)): | |
74 | + count+=1 | |
75 | + f.write("input: " + t['input'].encode('utf-8') + "\n") | |
76 | + f.write("result: " + result.encode('utf-8') + "\n") | |
77 | + f.write("correct: " + t['output'].encode('utf-8') + "\n") | |
78 | + if correct_inpos1: | |
79 | + f.write("correct_inpos1: " + correct_inpos1 + "\n") | |
80 | + f.write("result_inpos1: " + result_inpos1 + "\n") | |
81 | + if 'comment' in t: | |
82 | + f.write("comment: " + t['comment'].encode('utf-8') + "\n") | |
83 | + f.write("\n") | |
84 | + print 'h1: %d error(s). see %s' % (count, outfile) | |
85 | + | |
86 | +def pass2(verboseMode=False): | |
87 | + global output | |
88 | + outfile = '__h2output.txt' | |
89 | + with open(outfile, 'w') as f: | |
90 | + output = cStringIO.StringIO() | |
91 | + translator2.initialize(jtalk_dir, __print) | |
92 | + log = output.getvalue() | |
93 | + output.close() | |
94 | + f.write(log) | |
95 | + f.write("\n") | |
96 | + count = 0 | |
97 | + for t in tests: | |
98 | + if t.has_key('text'): | |
99 | + output = cStringIO.StringIO() | |
100 | + result, pat, inpos1, inpos2 = translator2.translateWithInPos2( | |
101 | + t['text'], logwrite=__print) | |
102 | + log = output.getvalue() | |
103 | + output.close() | |
104 | + # inpos2 | |
105 | + if t.has_key('inpos2'): | |
106 | + correct_inpos2 = ','.join(['%d' % n for n in t['inpos2'] ]) | |
107 | + else: | |
108 | + correct_inpos2 = None | |
109 | + # inpos1 | |
110 | + if t.has_key('inpos1'): | |
111 | + correct_inpos1 = ','.join(['%d' % n for n in t['inpos1'] ]) | |
112 | + else: | |
113 | + correct_inpos1 = None | |
114 | + # merged inpos | |
115 | + inpos, outpos = translator2.mergePositionMap( | |
116 | + inpos1, inpos2, len(pat), len(t['text'])) | |
117 | + if t.has_key('inpos'): | |
118 | + correct_inpos = ','.join(['%d' % n for n in t['inpos'] ]) | |
119 | + else: | |
120 | + correct_inpos = None | |
121 | + # result | |
122 | + result_inpos2 = ','.join(['%d' % n for n in inpos2]) | |
123 | + result_inpos1 = ','.join(['%d' % n for n in inpos1]) | |
124 | + result_inpos = ','.join(['%d' % n for n in inpos]) | |
125 | + result_outpos = ','.join(['%d' % n for n in outpos]) | |
126 | + # output | |
127 | + isError = False | |
128 | + if result != t['input'] or \ | |
129 | + (correct_inpos2 and result_inpos2 != correct_inpos2) or \ | |
130 | + (correct_inpos and result_inpos != correct_inpos): | |
131 | + isError = True | |
132 | + count+=1 | |
133 | + if isError or verboseMode: | |
134 | + f.write("text : " + t['text'].encode('utf-8') + "\n") | |
135 | + f.write("correct: " + t['input'].encode('utf-8') + "\n") | |
136 | + f.write("result : " + result.encode('utf-8') + "\n") | |
137 | + f.write("pat : " + pat.encode('utf-8') + "\n") | |
138 | + if correct_inpos2: | |
139 | + f.write("cor_in2: " + correct_inpos2 + "\n") | |
140 | + if correct_inpos1: | |
141 | + f.write("cor_in1: " + correct_inpos1 + "\n") | |
142 | + if correct_inpos: | |
143 | + f.write("cor_in : " + correct_inpos + "\n") | |
144 | + f.write("res_in2: " + result_inpos2 + "\n") | |
145 | + f.write("res_in1: " + result_inpos1 + "\n") | |
146 | + f.write("res_in : " + result_inpos + "\n") | |
147 | + f.write("res_out: " + result_outpos + "\n") | |
148 | + if 'comment' in t and t['comment']: | |
149 | + f.write("comment: " + t['comment'].encode('utf-8') + "\n") | |
150 | + f.write("\n") | |
151 | + f.write(log) | |
152 | + f.write("\n") | |
153 | + print 'h2: %d error(s). see %s' % (count, outfile) | |
154 | + | |
155 | +def make_doc(): | |
156 | + outfile = '__jpBrailleHarness.t2t' | |
157 | + timestamp = datetime.datetime.now().strftime('%Y%m%d-%H%M%S') | |
158 | + with open(outfile, 'w') as f: | |
159 | + __writeln(f, u""" | |
160 | +NVDA 日本語版 点訳テストケース """ + timestamp + u""" | |
161 | + | |
162 | +%!Target: xhtml | |
163 | +%!Encoding: UTF-8 | |
164 | + | |
165 | +目次 | |
166 | +%%toc | |
167 | + | |
168 | +""") | |
169 | + count = 0 | |
170 | + for t in tests: | |
171 | + # 'note' はテストケースではなく説明の記述 | |
172 | + if t.has_key('note'): | |
173 | + __writeln(f) | |
174 | + __writeln(f, t['note']) | |
175 | + __writeln(f) | |
176 | + continue | |
177 | + count += 1 | |
178 | + __writeln(f, u"番号: %d" % count) | |
179 | + | |
180 | + if t.has_key('text'): | |
181 | + __writeln(f, u"- 日本語: " + t['text'].replace(u' ', u'□').replace(' ', u'□')) | |
182 | + if t.has_key('input'): | |
183 | + __writeln(f, u"- カナ表記: " + t['input'].replace(' ', u'□')) | |
184 | + if t.has_key('output'): | |
185 | + __writeln(f, u"- 点字: " + t['output'].replace(' ', u'□')) | |
186 | + if t.has_key('output'): | |
187 | + __writeln(f, u"- ドット番号: " + dot_numbers(t['output'])) | |
188 | + if t.has_key('comment'): | |
189 | + __writeln(f, u"- コメント: " + t['comment']) | |
190 | + __writeln(f, u"-") | |
191 | + | |
192 | +if __name__ == '__main__': | |
193 | + parser = optparse.OptionParser() | |
194 | + parser.add_option("-1", "--pass1only", | |
195 | + action="store_true", | |
196 | + dest="pass1_only", | |
197 | + default="False", | |
198 | + help="pass1 only timeit") | |
199 | + parser.add_option("-2", "--pass2only", | |
200 | + action="store_true", | |
201 | + dest="pass2_only", | |
202 | + default="False", | |
203 | + help="pass2 only timeit") | |
204 | + parser.add_option("-v", "--verbose", | |
205 | + action="store_true", | |
206 | + dest="verbose", | |
207 | + default="False", | |
208 | + help="pass2 only timeit") | |
209 | + parser.add_option("-m", "--makedoc", | |
210 | + action="store_true", | |
211 | + dest="make_doc", | |
212 | + default="False", | |
213 | + help="make t2t document of harness") | |
214 | + parser.add_option("-n", "--number", | |
215 | + action="store", | |
216 | + dest="number", | |
217 | + type="int", | |
218 | + default=1, | |
219 | + help="number for timeit") | |
220 | + parser.add_option("-o", "--outposTest", | |
221 | + action="store_true", | |
222 | + dest="outpos_test", | |
223 | + default=False, | |
224 | + help="outpos test") | |
225 | + (options, args) = parser.parse_args() | |
226 | + | |
227 | + if options.outpos_test == True: | |
228 | + # translate([b'louis/tables/en-us-g2.ctb'], 'Hello world!') | |
229 | + inPos = [0, 0, 1, 2, 3, 4, 5, 6, 6, 11] | |
230 | + inlen = len('Hello world!') | |
231 | + outlen = len(',hello _w6') | |
232 | + outPos = translator2.makeOutPos(inPos, inlen, outlen) | |
233 | + print outPos | |
234 | + assert outPos == [1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 9] | |
235 | + elif options.make_doc == True: | |
236 | + make_doc() | |
237 | + elif options.pass1_only == True: | |
238 | + t = timeit.Timer(stmt=pass1) | |
239 | + print t.timeit(number=options.number) | |
240 | + elif options.pass2_only == True: | |
241 | + t = timeit.Timer(stmt=pass2) | |
242 | + print t.timeit(number=options.number) | |
243 | + elif options.verbose == True: | |
244 | + pass2(verboseMode=True) | |
245 | + else: | |
246 | + pass1() | |
247 | + pass2() | |
248 | + |
@@ -0,0 +1,78 @@ | ||
1 | +# jtalkPredicTest.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | + | |
4 | +from __future__ import unicode_literals, print_function | |
5 | +import os | |
6 | +import sys | |
7 | +sys.path.append(r'..\source\synthDrivers\jtalk') | |
8 | +from _jtalk_core import * | |
9 | +from _nvdajp_unicode import unicode_normalize | |
10 | +import _nvdajp_predic | |
11 | + | |
12 | +tests = [ | |
13 | + ['ー', 'チョーオン'], | |
14 | + ['ン', 'ウン'], | |
15 | + ['あ ー', 'あ チョーオン'], | |
16 | + ['あ ン', 'あ ウン'], | |
17 | + ['0123345', ' ゼロ イチ ニー サン サン ヨン ゴー '], | |
18 | + ['人々', '人人'], | |
19 | + ['昔々', '昔昔'], | |
20 | + ['家々', '家家'], | |
21 | + ['山々', '山山'], | |
22 | + ['は', 'ハ'], | |
23 | + ['あ は', 'あ ハ'], | |
24 | + ['A', 'a'], | |
25 | + ['59 名', '59名'], | |
26 | + ['4行', '4ギョー'], | |
27 | + ['2 分前更新', '2分マエコーシン'], | |
28 | + ['1MB', '1メガバイト'], | |
29 | + ['10MB', '10メガバイト'], | |
30 | + ['1.2MB', '1.2メガバイト'], | |
31 | + ['0.5MB', '0.5メガバイト'], | |
32 | + ['321.1MB', '321.1メガバイト'], | |
33 | + ['123.45MB', '123.45メガバイト'], | |
34 | + ['2.7GB', '2.7ギガバイト'], | |
35 | + ['10KB', '10キロバイト'], | |
36 | + ['1 MB', '1メガバイト'], | |
37 | + ['10 MB', '10メガバイト'], | |
38 | + ['1.2 MB', '1.2メガバイト'], | |
39 | + ['0.5 MB', '0.5メガバイト'], | |
40 | + ['321.0 MB', '321.0メガバイト'], | |
41 | + ['123.45 MB', '123.45メガバイト'], | |
42 | + ['2.7 GB', '2.7ギガバイト'], | |
43 | + ['10 KB', '10キロバイト'], | |
44 | + ['12.01 KB', '12.01キロバイト'], | |
45 | + ['12.01', '12.01'], | |
46 | + ['12.35', '12.35'], | |
47 | + ['01234', ' ゼロ イチ ニー サン ヨン '], | |
48 | + ['1.01', '1.01'], | |
49 | + ['1.10', '1.10'], | |
50 | + ['2011.03.11', '2011テン ゼロ サン テン11'], | |
51 | + ['2011.11.11', '2011テン11テン11'], | |
52 | + ['7.0.1', '7テン0テン1'], | |
53 | + ['7.0.10', '7テン0テン10'], | |
54 | + ['1.2.3', '1テン2テン3'], | |
55 | + ['7.01.45', '7テン ゼロ イチ テン45'], | |
56 | + ['7.1.45', '7テン1テン45'], | |
57 | + ['7.01.01', '7テン ゼロ イチ テン ゼロ イチ '], | |
58 | + ['7.1.01', '7テン1テン ゼロ イチ '], | |
59 | + ['0.0.0.1', '0テン0テン0テン1'], | |
60 | + ['1,234円', '1234円'], | |
61 | + ['0,1', '0カンマ1'], | |
62 | + ['134,554', '134554'], | |
63 | + ['2013年2月10日', '2013年2月10日'], | |
64 | + ['2013年2月10日', '2013年2月10日'], # remove U+200E LEFT-TO-RIGHT MARK | |
65 | + ['2013年2月10日、23:45:19', '2013年2月10日、23:45:19'], # remove U+200E U+200F | |
66 | +] | |
67 | + | |
68 | +def _print(s): | |
69 | + print(s.encode('utf-8', 'ignore')) | |
70 | + | |
71 | +if __name__ == '__main__': | |
72 | + _nvdajp_predic.setup() | |
73 | + for item in tests: | |
74 | + msg = item[0] | |
75 | + msg = unicode_normalize(msg) | |
76 | + s = _nvdajp_predic.convert(msg) | |
77 | + if item[1] != s: | |
78 | + _print('expected:%s result:%s' % (item[1], s)) |
@@ -0,0 +1,88 @@ | ||
1 | +# _jtalk_runner.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +# Japanese speech engine test module | |
4 | +# by Takuya Nishimoto | |
5 | +# http://ja.nishimotz.com/project:libopenjtalk | |
6 | +# Usage: | |
7 | +# > cd source | |
8 | +# > python synthDrivers/jtalk/_jtalk_runner.py | |
9 | + | |
10 | +import os | |
11 | +import sys | |
12 | +sys.path.append(r'..\source\synthDrivers\jtalk') | |
13 | +from _jtalk_core import * | |
14 | + | |
15 | +import _nvdajp_predic | |
16 | +#JT_DIR = unicode(os.path.abspath(os.path.dirname(__file__)), 'mbcs') | |
17 | +JT_DIR = r'..\source\synthDrivers\jtalk' | |
18 | +JT_DLL = os.path.join(JT_DIR, 'libopenjtalk.dll') | |
19 | +VOICE_DIR = os.path.join(JT_DIR, 'm001') | |
20 | + | |
21 | +# for miscdep/include/jtalk | |
22 | +#JT_DIR = os.path.join(os.getcwdu(), '..', '..', 'source', 'synthDrivers', 'jtalk') | |
23 | +#JT_DLL = os.path.join(JT_DIR, 'libopenjtalk.dll') | |
24 | +#VOICE_DIR = os.path.join(JT_DIR, 'm001') | |
25 | + | |
26 | +def pa_play(data, samp_rate = 16000): | |
27 | + # requires pyaudio (PortAudio wrapper) | |
28 | + # http://people.csail.mit.edu/hubert/pyaudio/ | |
29 | + import time | |
30 | + import pyaudio | |
31 | + p = pyaudio.PyAudio() | |
32 | + stream = p.open(format = p.get_format_from_width(2), | |
33 | + channels = 1, rate = samp_rate, output = True) | |
34 | + size = len(data) | |
35 | + pos = 0 # byte count | |
36 | + while pos < size: | |
37 | + a = stream.get_write_available() * 2 | |
38 | + o = data[pos:pos+a] | |
39 | + stream.write(o) | |
40 | + pos += a | |
41 | + time.sleep(float(size) / 2 / samp_rate) | |
42 | + stream.close() | |
43 | + p.terminate() | |
44 | + | |
45 | +def __print(s): | |
46 | + print s.encode('cp932', 'ignore') | |
47 | + | |
48 | +def print_code(msg): | |
49 | + s = '' | |
50 | + for c in msg: | |
51 | + s += '%04x ' % ord(c) | |
52 | + print s | |
53 | + | |
54 | +if __name__ == '__main__': | |
55 | + njd = NJD() | |
56 | + jpcommon = JPCommon() | |
57 | + engine = HTS_Engine() | |
58 | + voice_args = {"id": "V1", "name": "m001", "lang":"ja", "samp_rate": 48000, "fperiod": 240, "alpha": 0.55, "lf0_base":5.0, "use_lpf":1, "speaker_attenuation":1.0, "dir": VOICE_DIR} | |
59 | + libjt = libjt_initialize(JT_DLL, **voice_args) | |
60 | + libjt_load(voice_args['dir'].encode('mbcs')) | |
61 | + Mecab_initialize(__print, JT_DIR) | |
62 | + # | |
63 | + #msg = u'100.25ドル。ウェルカムトゥー nvda テンキーのinsertキーとメインのinsertキーの両方がnvdaキーとして動作します' | |
64 | + #msg = u'YouTube iTunes Store sjis co jp' | |
65 | + #msg = u'十五絡脈病証。' # nvdajp ticket 29828 | |
66 | + #msg = u'マーク。まーく。' # nvdajp ticket 29859 | |
67 | + msg = u'∫⣿♪ ウェルカムトゥー 鈹噯呃瘂蹻脘鑱涿癃 十五絡脈病証 マーク。まーく。ふぅー。ふぅぅぅぅぅー。ぅー。ぅぅー。' | |
68 | + _nvdajp_predic.setup() | |
69 | + msg = _nvdajp_predic.convert(msg) | |
70 | + s = Mecab_text2mecab(msg, CODE_='utf-8') | |
71 | + __print("utf-8: (%s)" % s.decode('utf-8', 'ignore')) | |
72 | + mf = MecabFeatures() | |
73 | + Mecab_analysis(s, mf) | |
74 | + Mecab_print(mf, __print, CODE_='utf-8') | |
75 | + Mecab_correctFeatures(mf, CODE_='utf-8') | |
76 | + Mecab_utf8_to_cp932(mf) | |
77 | + Mecab_print(mf, __print, CODE_='cp932') | |
78 | + fperiod = voice_args['fperiod'] | |
79 | + data = libjt_synthesis(mf.feature, mf.size, fperiod_ = fperiod, logwrite_ = __print) | |
80 | + mf = None | |
81 | + if data: | |
82 | + pa_play(data, voice_args['samp_rate']) | |
83 | + import wave | |
84 | + w = wave.Wave_write("_test.wav") | |
85 | + w.setparams( (1, 2, voice_args['samp_rate'], len(data)/2, 'NONE', 'not compressed') ) | |
86 | + w.writeframes(data) | |
87 | + w.close() | |
88 | + libjt_clear() |
@@ -0,0 +1,3 @@ | ||
1 | +python jpBrailleRunner.py -m | |
2 | +python ..\txt2tags.py -t xhtml --toc __jpBrailleHarness.t2t | |
3 | +python -c "import sys;lines = [line.strip() for line in sys.stdin.readlines()];import re;p = re.compile(r'<a href=\x22(mailto|http):[^>]+>([^<]+)</a>');print '\n'.join(map(lambda l:p.sub(r'\2', l), lines))" < __jpBrailleHarness.xhtml > c:\users\nishimotz\dropbox\public\jpBrailleHarness.xhtml |
@@ -0,0 +1,5 @@ | ||
1 | +from synthDriverHandler import SynthDriver | |
2 | +class SynthDriver(SynthDriver): | |
3 | + @classmethod | |
4 | + def check(cls): | |
5 | + return False |
@@ -0,0 +1,61 @@ | ||
1 | +# _bgthread.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#Copyright (C) 2006-2010 NVDA Contributors <http://www.nvda-project.org/> | |
5 | +#Copyright (C) 2010-2012 Takuya Nishimoto (nishimotz.com) | |
6 | +#Copyright (C) 2013 Masamitsu Misono (043.jp) | |
7 | +#This file is covered by the GNU General Public License. | |
8 | +#See the file COPYING for more details. | |
9 | +# | |
10 | +# based on NVDA (synthDrivers/_espeak.py) | |
11 | + | |
12 | +from logHandler import log | |
13 | +import threading | |
14 | +import Queue | |
15 | + | |
16 | +bgThread = None | |
17 | +bgQueue = None | |
18 | +isSpeaking = False | |
19 | + | |
20 | +class BgThread(threading.Thread): | |
21 | + def __init__(self): | |
22 | + threading.Thread.__init__(self) | |
23 | + self.setDaemon(True) | |
24 | + | |
25 | + def run(self): | |
26 | + global isSpeaking | |
27 | + while True: | |
28 | + func, args, kwargs = bgQueue.get() | |
29 | + if not func: | |
30 | + break | |
31 | + try: | |
32 | + func(*args, **kwargs) | |
33 | + except: | |
34 | + log.error("Error running function from queue", exc_info=True) | |
35 | + finally: | |
36 | + isSpeaking = False | |
37 | + bgQueue.task_done() | |
38 | + | |
39 | +def execWhenDone(func, *args, **kwargs): | |
40 | + global bgQueue | |
41 | + # This can't be a kwarg in the function definition because it will consume the first non-keywor dargument which is meant for func. | |
42 | + mustBeAsync = kwargs.pop("mustBeAsync", False) | |
43 | + if mustBeAsync or bgQueue.unfinished_tasks != 0: | |
44 | + # Either this operation must be asynchronous or There is still an operation in progress. | |
45 | + # Therefore, run this asynchronously in the background thread. | |
46 | + bgQueue.put((func, args, kwargs)) | |
47 | + else: | |
48 | + func(*args, **kwargs) | |
49 | + | |
50 | +def initialize(): | |
51 | + global bgThread, bgQueue | |
52 | + bgQueue = Queue.Queue() | |
53 | + bgThread = BgThread() | |
54 | + bgThread.start() | |
55 | + | |
56 | +def terminate(): | |
57 | + global bgThread, bgQueue | |
58 | + bgQueue.put((None, None, None)) | |
59 | + bgThread.join() | |
60 | + bgThread = None | |
61 | + bgQueue = None |
@@ -0,0 +1,495 @@ | ||
1 | +# _jtalk_core.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#Copyright (C) 2010-2012 Takuya Nishimoto (NVDA Japanese Team) | |
5 | +#This file is covered by the GNU General Public License. | |
6 | +#See the file COPYING for more details. | |
7 | + | |
8 | +# Japanese speech engine wrapper for Open JTalk | |
9 | +# http://ja.nishimotz.com/project:libopenjtalk | |
10 | + | |
11 | +import codecs | |
12 | +import re | |
13 | +import string | |
14 | +import os | |
15 | +import struct | |
16 | +import sys | |
17 | +from mecab import * | |
18 | + | |
19 | +############################################ | |
20 | + | |
21 | +# htsengineapi/include/HTS_engine.h | |
22 | + | |
23 | +# size of structure: | |
24 | +# HTS_Global 56 | |
25 | +# HTS_ModelSet 76 | |
26 | +# HTS_Label 24 | |
27 | +# HTS_SStreamSet 24 | |
28 | +# HTS_PStreamSet 12 | |
29 | +# HTS_GStreamSet 20 | |
30 | + | |
31 | +class HTS_ModelSet(Structure): | |
32 | + _fields_ = [ | |
33 | + ("_dummy", c_byte * 56), | |
34 | + ] | |
35 | + | |
36 | +class HTS_Label(Structure): | |
37 | + _fields_ = [ | |
38 | + ("_dummy", c_byte * 76), | |
39 | + ] | |
40 | +HTS_Label_ptr = POINTER(HTS_Label) | |
41 | + | |
42 | +class HTS_SStreamSet(Structure): | |
43 | + _fields_ = [ | |
44 | + ("_dummy", c_byte * 24), | |
45 | + ] | |
46 | + | |
47 | +class HTS_PStreamSet(Structure): | |
48 | + _fields_ = [ | |
49 | + ("_dummy", c_byte * 12), | |
50 | + ] | |
51 | + | |
52 | +class HTS_GStream(Structure): | |
53 | + _fields_ = [ | |
54 | + ("static_length", c_int), # int static_length; /* static features length */ | |
55 | + ("par", c_double_p_p), # double **par; /* generated parameter */ | |
56 | + ] | |
57 | + | |
58 | +HTS_GStream_ptr = POINTER(HTS_GStream) | |
59 | + | |
60 | +# FIXME: engine.gss.total_nsample is always 0 | |
61 | +class HTS_GStreamSet(Structure): | |
62 | + _fields_ = [ | |
63 | + ("total_nsample", c_int), # int total_nsample; /* total sample */ | |
64 | + ("total_frame", c_int), # int total_frame; /* total frame */ | |
65 | + ("nstream", c_int), # int nstream; /* # of streams */ | |
66 | + ("gstream", HTS_GStream_ptr), # HTS_GStream *gstream; /* generated parameter streams */ | |
67 | + ("gspeech", c_short_p), # short *gspeech; /* generated speech */ | |
68 | + ] | |
69 | +HTS_GStreamSet_ptr = POINTER(HTS_GStreamSet) | |
70 | + | |
71 | +class HTS_Global(Structure): | |
72 | + _fields_ = [ | |
73 | + ("state", c_int), # /* Gamma=-1/stage : if stage=0 then Gamma=0 */ | |
74 | + ("use_log_gain", c_int), # HTS_Boolean (TRUE=1) /* log gain flag (for LSP) */ | |
75 | + ("sampling_rate", c_int), # /* sampling rate */ | |
76 | + ("fperiod", c_int), # /* frame period */ | |
77 | + ("alpha", c_double), # /* all-pass constant */ | |
78 | + ("beta", c_double), # /* postfiltering coefficient */ | |
79 | + ("audio_buff_size", c_int), # /* audio buffer size (for audio device) */ | |
80 | + ("msd_threshold", c_double_p), # /* MSD thresholds */ | |
81 | + ("duration_iw", c_double_p), # /* weights for duration interpolation */ | |
82 | + ("parameter_iw", c_double_p_p), # /* weights for parameter interpolation */ | |
83 | + ("gv_iw", c_double_p_p), # /* weights for GV interpolation */ | |
84 | + ("gv_weight", c_double_p), # /* GV weights */ | |
85 | + ] | |
86 | +HTS_Global_ptr = POINTER(HTS_Global) | |
87 | + | |
88 | +class HTS_Engine(Structure): | |
89 | + _fields_ = [ | |
90 | + ("global", HTS_Global), | |
91 | + ("audio", c_void_p), # HTS_Audio (requires nvdajp miscdep 86 or later) | |
92 | + ("ms", HTS_ModelSet), | |
93 | + ("label", HTS_Label), | |
94 | + ("sss", HTS_SStreamSet), | |
95 | + ("pss", HTS_PStreamSet), | |
96 | + ("gss", HTS_GStreamSet), | |
97 | + ("lf0_offset", c_double), | |
98 | + ("lf0_amp", c_double), | |
99 | + ] | |
100 | +HTS_Engine_ptr = POINTER(HTS_Engine) | |
101 | + | |
102 | +############################################ | |
103 | + | |
104 | +class NJD(Structure): | |
105 | + _fields_ = [ | |
106 | + ("_dummy", c_byte * 8), | |
107 | + ] | |
108 | +NJD_ptr = POINTER(NJD) | |
109 | + | |
110 | +class JPCommonNode(Structure): | |
111 | + pass | |
112 | +JPCommonNode_ptr = POINTER(JPCommonNode) | |
113 | +JPCommonNode._fields_ = [ | |
114 | + ('pron', c_char_p), | |
115 | + ('pos', c_char_p), | |
116 | + ('ctype', c_char_p), | |
117 | + ('cform', c_char_p), | |
118 | + ('acc', c_int), | |
119 | + ('chain_flag', c_int), | |
120 | + ('prev', JPCommonNode_ptr), | |
121 | + ('next', JPCommonNode_ptr), | |
122 | + ] | |
123 | + | |
124 | +class JPCommonLabelBreathGroup(Structure): | |
125 | + pass | |
126 | +JPCommonLabelBreathGroup_ptr = POINTER(JPCommonLabelBreathGroup) | |
127 | + | |
128 | +class JPCommonLabelAccentPhrase(Structure): | |
129 | + pass | |
130 | +JPCommonLabelAccentPhrase_ptr = POINTER(JPCommonLabelAccentPhrase) | |
131 | + | |
132 | +class JPCommonLabelWord(Structure): | |
133 | + pass | |
134 | +JPCommonLabelWord_ptr = POINTER(JPCommonLabelWord) | |
135 | + | |
136 | +class JPCommonLabelMora(Structure): | |
137 | + pass | |
138 | +JPCommonLabelMora_ptr = POINTER(JPCommonLabelMora) | |
139 | + | |
140 | +class JPCommonLabelPhoneme(Structure): | |
141 | + pass | |
142 | +JPCommonLabelPhoneme_ptr = POINTER(JPCommonLabelPhoneme) | |
143 | + | |
144 | +# jpcommon/jpcommon.h | |
145 | +class JPCommonLabel(Structure): | |
146 | + _fields_ = [ | |
147 | + ('size', c_int), | |
148 | + ('feature', c_char_p_p), | |
149 | + ('breath_head', JPCommonLabelBreathGroup_ptr), | |
150 | + ('breath_tail', JPCommonLabelBreathGroup_ptr), | |
151 | + ('accent_head', JPCommonLabelAccentPhrase_ptr), | |
152 | + ('accent_tail', JPCommonLabelAccentPhrase_ptr), | |
153 | + ('word_head', JPCommonLabelWord_ptr), | |
154 | + ('word_tail', JPCommonLabelWord_ptr), | |
155 | + ('mora_head', JPCommonLabelMora_ptr), | |
156 | + ('mora_tail', JPCommonLabelMora_ptr), | |
157 | + ('phoneme_head', JPCommonLabelPhoneme_ptr), | |
158 | + ('phoneme_tail', JPCommonLabelPhoneme_ptr), | |
159 | + ('short_pause_flag', c_int), | |
160 | + ] | |
161 | +JPCommonLabel_ptr = POINTER(JPCommonLabel) | |
162 | + | |
163 | +class JPCommon(Structure): | |
164 | + _fields_ = [ | |
165 | + ("head", JPCommonNode_ptr), | |
166 | + ("tail", JPCommonNode_ptr), | |
167 | + ("label", JPCommonLabel_ptr), | |
168 | + ] | |
169 | +JPCommon_ptr = POINTER(JPCommon) | |
170 | + | |
171 | +# for debug | |
172 | +def JPC_label_print(feature, size, logwrite_): | |
173 | + if logwrite_ is None: return | |
174 | + if feature is None or size is None: | |
175 | + logwrite_( "JPC_label_print size: 0" ) | |
176 | + return | |
177 | + s2 = "JPC_label_print size: %d\n" % size | |
178 | + for i in xrange(0, size): | |
179 | + s = string_at(feature[i]) | |
180 | + if s: | |
181 | + s2 += "%s\n" % s | |
182 | + else: | |
183 | + s2 += "[None]" | |
184 | + logwrite_(s2) | |
185 | + | |
186 | +############################################# | |
187 | + | |
188 | +FNLEN = 1000 | |
189 | +FILENAME = c_char * FNLEN | |
190 | +FILENAME_ptr = POINTER(FILENAME) | |
191 | +FILENAME_ptr_ptr = POINTER(FILENAME_ptr) | |
192 | +FILENAME_ptr_x3 = FILENAME_ptr * 3 | |
193 | +FILENAME_ptr_x3_ptr = POINTER(FILENAME_ptr_x3) | |
194 | + | |
195 | +libjt = None | |
196 | +njd = NJD() | |
197 | +jpcommon = JPCommon() | |
198 | +engine = HTS_Engine() | |
199 | +use_lpf = 0 | |
200 | + | |
201 | +def libjt_version(): | |
202 | + if libjt is None: return "libjt version none" | |
203 | + return libjt.jt_version() | |
204 | + | |
205 | +def libjt_initialize(JT_DLL, **args): | |
206 | + global libjt, njd, jpcommon, engine, use_lpf | |
207 | + use_lpf = args['use_lpf'] | |
208 | + | |
209 | + if libjt is None: libjt = cdll.LoadLibrary(JT_DLL.encode('mbcs')) | |
210 | + libjt.jt_version.restype = c_char_p | |
211 | + | |
212 | + libjt.NJD_initialize.argtypes = [NJD_ptr] | |
213 | + libjt.NJD_initialize(njd) | |
214 | + | |
215 | + libjt.JPCommon_initialize.argtypes = [JPCommon_ptr] | |
216 | + libjt.JPCommon_initialize(jpcommon) | |
217 | + | |
218 | + libjt.HTS_Engine_initialize.argtypes = [HTS_Engine_ptr, c_int] | |
219 | + if use_lpf: | |
220 | + libjt.HTS_Engine_initialize(engine, 3) | |
221 | + else: | |
222 | + libjt.HTS_Engine_initialize(engine, 2) | |
223 | + | |
224 | + libjt.HTS_Engine_set_sampling_rate.argtypes = [HTS_Engine_ptr, c_int] | |
225 | + libjt.HTS_Engine_set_sampling_rate(engine, args['samp_rate']) # 16000 | |
226 | + | |
227 | + libjt.HTS_Engine_set_fperiod.argtypes = [HTS_Engine_ptr, c_int] | |
228 | + libjt.HTS_Engine_set_fperiod(engine, args['fperiod']) # if samping-rate is 16000: 80(point=5ms) frame period | |
229 | + | |
230 | + libjt.HTS_Engine_set_alpha.argtypes = [HTS_Engine_ptr, c_double] | |
231 | + libjt.HTS_Engine_set_alpha(engine, args['alpha']) # 0.42 | |
232 | + | |
233 | + libjt.HTS_Engine_set_gamma.argtypes = [HTS_Engine_ptr, c_int] | |
234 | + libjt.HTS_Engine_set_gamma(engine, 0) | |
235 | + | |
236 | + libjt.HTS_Engine_set_log_gain.argtypes = [HTS_Engine_ptr, c_int] | |
237 | + libjt.HTS_Engine_set_log_gain(engine, 0) | |
238 | + | |
239 | + libjt.HTS_Engine_set_beta.argtypes = [HTS_Engine_ptr, c_double] | |
240 | + libjt.HTS_Engine_set_beta(engine, 0.0) | |
241 | + | |
242 | + libjt.HTS_Engine_set_audio_buff_size.argtypes = [HTS_Engine_ptr, c_int] | |
243 | + libjt.HTS_Engine_set_audio_buff_size(engine, 1600) | |
244 | + | |
245 | + libjt.HTS_Engine_set_msd_threshold.argtypes = [HTS_Engine_ptr, c_int, c_double] | |
246 | + libjt.HTS_Engine_set_msd_threshold(engine, 1, 0.5) | |
247 | + | |
248 | + libjt.HTS_Engine_set_gv_weight.argtypes = [HTS_Engine_ptr, c_int, c_double] | |
249 | + libjt.HTS_Engine_set_gv_weight(engine, 0, 1.0) | |
250 | + libjt.HTS_Engine_set_gv_weight(engine, 1, 0.7) | |
251 | + if use_lpf: | |
252 | + libjt.HTS_Engine_set_gv_weight(engine, 2, 1.0) | |
253 | + | |
254 | + # for libjt_synthesis() | |
255 | + libjt.mecab2njd.argtypes = [NJD_ptr, FEATURE_ptr_array_ptr, c_int] | |
256 | + libjt.njd_set_pronunciation.argtypes = [NJD_ptr] | |
257 | + libjt.njd_set_digit.argtypes = [NJD_ptr] | |
258 | + libjt.njd_set_accent_phrase.argtypes = [NJD_ptr] | |
259 | + libjt.njd_set_accent_type.argtypes = [NJD_ptr] | |
260 | + libjt.njd_set_unvoiced_vowel.argtypes = [NJD_ptr] | |
261 | + libjt.njd_set_long_vowel.argtypes = [NJD_ptr] | |
262 | + libjt.njd2jpcommon.argtypes = [JPCommon_ptr, NJD_ptr] | |
263 | + libjt.JPCommon_make_label.argtypes = [JPCommon_ptr] | |
264 | + libjt.JPCommon_get_label_size.argtypes = [JPCommon_ptr] | |
265 | + libjt.JPCommon_get_label_size.argtypes = [JPCommon_ptr] | |
266 | + libjt.JPCommon_get_label_feature.argtypes = [JPCommon_ptr] | |
267 | + libjt.JPCommon_get_label_feature.restype = c_char_p_p | |
268 | + libjt.JPCommon_get_label_size.argtypes = [JPCommon_ptr] | |
269 | + libjt.HTS_Engine_load_label_from_string_list.argtypes = [ | |
270 | + HTS_Engine_ptr, c_char_p_p, c_int] | |
271 | + | |
272 | + libjt.HTS_Engine_create_sstream.argtypes = [HTS_Engine_ptr] | |
273 | + libjt.HTS_Engine_create_pstream.argtypes = [HTS_Engine_ptr] | |
274 | + libjt.HTS_Engine_create_gstream.argtypes = [HTS_Engine_ptr] | |
275 | + libjt.HTS_Engine_refresh.argtypes = [HTS_Engine_ptr] | |
276 | + libjt.JPCommon_refresh.argtypes = [JPCommon_ptr] | |
277 | + libjt.NJD_refresh.argtypes = [NJD_ptr] | |
278 | + libjt.HTS_GStreamSet_get_total_nsample.argtypes = [HTS_GStreamSet_ptr] | |
279 | + libjt.HTS_GStreamSet_get_speech.argtypes = [HTS_GStreamSet_ptr, c_int] | |
280 | + libjt.NJD_print.argtypes = [NJD_ptr] | |
281 | + libjt.JPCommon_print.argtypes = [JPCommon_ptr] | |
282 | + libjt.JPCommonLabel_print.argtypes = [JPCommonLabel_ptr] | |
283 | + | |
284 | + libjt.jt_total_nsample.argtypes = [HTS_Engine_ptr] | |
285 | + libjt.jt_speech_ptr.argtypes = [HTS_Engine_ptr] | |
286 | + libjt.jt_speech_ptr.restype = c_short_p | |
287 | + libjt.jt_save_logs.argtypes = [c_char_p, HTS_Engine_ptr, NJD_ptr] | |
288 | + libjt.jt_save_riff.argtypes = [c_char_p, HTS_Engine_ptr] | |
289 | + libjt.jt_speech_normalize.argtypes = [HTS_Engine_ptr, c_short, c_int] | |
290 | + libjt.jt_trim_silence.argtypes = [HTS_Engine_ptr, c_short, c_short] | |
291 | + libjt.jt_trim_silence.restype = c_int | |
292 | + | |
293 | + libjt.NJD_clear.argtypes = [NJD_ptr] | |
294 | + libjt.JPCommon_clear.argtypes = [JPCommon_ptr] | |
295 | + libjt.HTS_Engine_clear.argtypes = [HTS_Engine_ptr] | |
296 | + | |
297 | + libjt.HTS_Engine_set_lf0_offset_amp.argtypes = [HTS_Engine_ptr, c_double, c_double] | |
298 | + | |
299 | + # for libjt_jpcommon_make_label() | |
300 | + libjt.JPCommonLabel_clear.argtypes = [JPCommonLabel_ptr] | |
301 | + libjt.JPCommonLabel_initialize.argtypes = [JPCommonLabel_ptr] | |
302 | + libjt.JPCommonNode_get_pron.restype = c_char_p | |
303 | + libjt.JPCommonNode_get_pos.restype = c_char_p | |
304 | + libjt.JPCommonNode_get_ctype.restype = c_char_p | |
305 | + libjt.JPCommonNode_get_cform.restype = c_char_p | |
306 | + libjt.JPCommonNode_get_acc.restype = c_int | |
307 | + libjt.JPCommonNode_get_chain_flag.restype = c_int | |
308 | + libjt.JPCommonLabel_push_word.argtype = [JPCommonLabel_ptr, c_char_p, c_char_p, c_char_p, c_char_p, c_int, c_int] | |
309 | + | |
310 | +def libjt_load(VOICE): | |
311 | + global libjt, engine, use_lpf | |
312 | + VOICE = VOICE.encode('mbcs') | |
313 | + libjt.HTS_Engine_load_duration_from_fn.argtypes = [ | |
314 | + HTS_Engine_ptr, FILENAME_ptr_ptr, FILENAME_ptr_ptr, c_int] | |
315 | + | |
316 | + fn_ms_dur_buf = create_string_buffer(os.path.join(VOICE, "dur.pdf")) | |
317 | + fn_ms_dur_buf_ptr = cast(byref(fn_ms_dur_buf), FILENAME_ptr) | |
318 | + fn_ms_dur = cast(byref(fn_ms_dur_buf_ptr), FILENAME_ptr_ptr) | |
319 | + fn_ts_dur_buf = create_string_buffer(os.path.join(VOICE, "tree-dur.inf")) | |
320 | + fn_ts_dur_buf_ptr = cast(byref(fn_ts_dur_buf), FILENAME_ptr) | |
321 | + fn_ts_dur = cast(byref(fn_ts_dur_buf_ptr), FILENAME_ptr_ptr) | |
322 | + libjt.HTS_Engine_load_duration_from_fn(engine, fn_ms_dur, fn_ts_dur, 1) | |
323 | + | |
324 | + libjt.HTS_Engine_load_parameter_from_fn.argtypes = [ | |
325 | + HTS_Engine_ptr, FILENAME_ptr_ptr, FILENAME_ptr_ptr, | |
326 | + FILENAME_ptr_x3_ptr, c_int, c_int, c_int, c_int] | |
327 | + | |
328 | + fn_ms_mcp_buf = create_string_buffer(os.path.join(VOICE, "mgc.pdf")) | |
329 | + fn_ms_mcp_buf_ptr = cast(byref(fn_ms_mcp_buf), FILENAME_ptr) | |
330 | + fn_ms_mcp = cast(byref(fn_ms_mcp_buf_ptr), FILENAME_ptr_ptr) | |
331 | + fn_ts_mcp_buf = create_string_buffer(os.path.join(VOICE, "tree-mgc.inf")) | |
332 | + fn_ts_mcp_buf_ptr = cast(byref(fn_ts_mcp_buf), FILENAME_ptr) | |
333 | + fn_ts_mcp = cast(byref(fn_ts_mcp_buf_ptr), FILENAME_ptr_ptr) | |
334 | + fn_ws_mcp_buf_1 = create_string_buffer(os.path.join(VOICE, "mgc.win1")) | |
335 | + fn_ws_mcp_buf_2 = create_string_buffer(os.path.join(VOICE, "mgc.win2")) | |
336 | + fn_ws_mcp_buf_3 = create_string_buffer(os.path.join(VOICE, "mgc.win3")) | |
337 | + fn_ws_mcp_buf_ptr_x3 = FILENAME_ptr_x3( | |
338 | + cast(byref(fn_ws_mcp_buf_1), FILENAME_ptr), | |
339 | + cast(byref(fn_ws_mcp_buf_2), FILENAME_ptr), | |
340 | + cast(byref(fn_ws_mcp_buf_3), FILENAME_ptr)) | |
341 | + fn_ws_mcp = cast(byref(fn_ws_mcp_buf_ptr_x3), FILENAME_ptr_x3_ptr) | |
342 | + libjt.HTS_Engine_load_parameter_from_fn( | |
343 | + engine, fn_ms_mcp, fn_ts_mcp, fn_ws_mcp, | |
344 | + 0, 0, 3, 1) | |
345 | + | |
346 | + fn_ms_lf0_buf = create_string_buffer(os.path.join(VOICE, "lf0.pdf")) | |
347 | + fn_ms_lf0_buf_ptr = cast(byref(fn_ms_lf0_buf), FILENAME_ptr) | |
348 | + fn_ms_lf0 = cast(byref(fn_ms_lf0_buf_ptr), FILENAME_ptr_ptr) | |
349 | + fn_ts_lf0_buf = create_string_buffer(os.path.join(VOICE, "tree-lf0.inf")) | |
350 | + fn_ts_lf0_buf_ptr = cast(byref(fn_ts_lf0_buf), FILENAME_ptr) | |
351 | + fn_ts_lf0 = cast(byref(fn_ts_lf0_buf_ptr), FILENAME_ptr_ptr) | |
352 | + fn_ws_lf0_buf_1 = create_string_buffer(os.path.join(VOICE, "lf0.win1")) | |
353 | + fn_ws_lf0_buf_2 = create_string_buffer(os.path.join(VOICE, "lf0.win2")) | |
354 | + fn_ws_lf0_buf_3 = create_string_buffer(os.path.join(VOICE, "lf0.win3")) | |
355 | + fn_ws_lf0_buf_ptr_x3 = FILENAME_ptr_x3( | |
356 | + cast(byref(fn_ws_lf0_buf_1), FILENAME_ptr), | |
357 | + cast(byref(fn_ws_lf0_buf_2), FILENAME_ptr), | |
358 | + cast(byref(fn_ws_lf0_buf_3), FILENAME_ptr)) | |
359 | + fn_ws_lf0 = cast(byref(fn_ws_lf0_buf_ptr_x3), FILENAME_ptr_x3_ptr) | |
360 | + libjt.HTS_Engine_load_parameter_from_fn( | |
361 | + engine, fn_ms_lf0, fn_ts_lf0, fn_ws_lf0, | |
362 | + 1, 1, 3, 1) | |
363 | + | |
364 | + if use_lpf: | |
365 | + fn_ms_lpf_buf = create_string_buffer(os.path.join(VOICE, "lpf.pdf")) | |
366 | + fn_ms_lpf_buf_ptr = cast(byref(fn_ms_lpf_buf), FILENAME_ptr) | |
367 | + fn_ms_lpf = cast(byref(fn_ms_lpf_buf_ptr), FILENAME_ptr_ptr) | |
368 | + fn_ts_lpf_buf = create_string_buffer(os.path.join(VOICE, "tree-lpf.inf")) | |
369 | + fn_ts_lpf_buf_ptr = cast(byref(fn_ts_lpf_buf), FILENAME_ptr) | |
370 | + fn_ts_lpf = cast(byref(fn_ts_lpf_buf_ptr), FILENAME_ptr_ptr) | |
371 | + fn_ws_lpf_buf_1 = create_string_buffer(os.path.join(VOICE, "lpf.win1")) | |
372 | + fn_ws_lpf_buf_ptr_x3 = FILENAME_ptr_x3( | |
373 | + cast(byref(fn_ws_lpf_buf_1), FILENAME_ptr), | |
374 | + cast(0, FILENAME_ptr), | |
375 | + cast(0, FILENAME_ptr)) | |
376 | + fn_ws_lpf = cast(byref(fn_ws_lpf_buf_ptr_x3), FILENAME_ptr_x3_ptr) | |
377 | + libjt.HTS_Engine_load_parameter_from_fn(engine, fn_ms_lpf, fn_ts_lpf, fn_ws_lpf, 2, 0, 1, 1) | |
378 | + | |
379 | + libjt.HTS_Engine_load_gv_from_fn.argtypes = [ | |
380 | + HTS_Engine_ptr, FILENAME_ptr_ptr, FILENAME_ptr_ptr, | |
381 | + c_int, c_int] | |
382 | + | |
383 | + fn_ms_gvm_buf = create_string_buffer(os.path.join(VOICE, "gv-mgc.pdf")) | |
384 | + fn_ms_gvm_buf_ptr = cast(byref(fn_ms_gvm_buf), FILENAME_ptr) | |
385 | + fn_ms_gvm = cast(byref(fn_ms_gvm_buf_ptr), FILENAME_ptr_ptr) | |
386 | + fn_ts_gvm_buf = create_string_buffer(os.path.join(VOICE, "tree-gv-mgc.inf")) | |
387 | + fn_ts_gvm_buf_ptr = cast(byref(fn_ts_gvm_buf), FILENAME_ptr) | |
388 | + fn_ts_gvm = cast(byref(fn_ts_gvm_buf_ptr), FILENAME_ptr_ptr) | |
389 | + libjt.HTS_Engine_load_gv_from_fn( | |
390 | + engine, fn_ms_gvm, fn_ts_gvm, 0, 1) | |
391 | + | |
392 | + fn_ms_gvl_buf = create_string_buffer(os.path.join(VOICE, "gv-lf0.pdf")) | |
393 | + fn_ms_gvl_buf_ptr = cast(byref(fn_ms_gvl_buf), FILENAME_ptr) | |
394 | + fn_ms_gvl = cast(byref(fn_ms_gvl_buf_ptr), FILENAME_ptr_ptr) | |
395 | + fn_ts_gvl_buf = create_string_buffer(os.path.join(VOICE, "tree-gv-lf0.inf")) | |
396 | + fn_ts_gvl_buf_ptr = cast(byref(fn_ts_gvl_buf), FILENAME_ptr) | |
397 | + fn_ts_gvl = cast(byref(fn_ts_gvl_buf_ptr), FILENAME_ptr_ptr) | |
398 | + libjt.HTS_Engine_load_gv_from_fn( | |
399 | + engine, fn_ms_gvl, fn_ts_gvl, 1, 1) | |
400 | + | |
401 | + libjt.HTS_Engine_load_gv_switch_from_fn.argtypes = [ | |
402 | + HTS_Engine_ptr, FILENAME_ptr] | |
403 | + | |
404 | + fn_gv_switch_buf = create_string_buffer(os.path.join(VOICE, "gv-switch.inf")) | |
405 | + fn_gv_switch = cast(byref(fn_gv_switch_buf), FILENAME_ptr) | |
406 | + libjt.HTS_Engine_load_gv_switch_from_fn( | |
407 | + engine, fn_gv_switch) | |
408 | + | |
409 | +def libjt_refresh(): | |
410 | + libjt.HTS_Engine_refresh(engine) | |
411 | + libjt.JPCommon_refresh(jpcommon) | |
412 | + libjt.NJD_refresh(njd) | |
413 | + | |
414 | +def libjt_clear(): | |
415 | + libjt.NJD_clear(njd) | |
416 | + libjt.JPCommon_clear(jpcommon) | |
417 | + libjt.HTS_Engine_clear(engine) | |
418 | + | |
419 | +#def libjt_jpcommon_make_label(jpcommon, logwrite_=None): | |
420 | +# if jpcommon.label: | |
421 | +# libjt.JPCommonLabel_clear(jpcommon.label) | |
422 | +# else: | |
423 | +# jpcommon.label = cast(mc_calloc(1, sizeof(JPCommonLabel)), JPCommonLabel_ptr) | |
424 | +# libjt.JPCommonLabel_initialize(jpcommon.label) | |
425 | +# node = jpcommon.head | |
426 | +# while node: | |
427 | +# label = jpcommon.label | |
428 | +# pron = libjt.JPCommonNode_get_pron(node) | |
429 | +# pos = libjt.JPCommonNode_get_pos(node) | |
430 | +# ctype = libjt.JPCommonNode_get_ctype(node) | |
431 | +# cform = libjt.JPCommonNode_get_cform(node) | |
432 | +# acc = libjt.JPCommonNode_get_acc(node) | |
433 | +# flag = libjt.JPCommonNode_get_chain_flag(node) | |
434 | +# if logwrite_ : logwrite_('%s,%s,%d,%d' % (pron, pos, acc, flag)) | |
435 | +# libjt.JPCommonLabel_push_word(label, pron, pos, ctype, cform, acc, flag) | |
436 | +# node = cast(node[0].next, JPCommonNode_ptr) | |
437 | +# libjt.JPCommonLabel_make(jpcommon.label) | |
438 | + | |
439 | +def libjt_synthesis(feature, size, fperiod_=80, feed_func_=None, is_speaking_func_=None, thres_=32, thres2_=32, level_=32767, logwrite_=None, lf0_offset_=0.0, lf0_amp_=1.0): | |
440 | + if feature is None or size is None: return None | |
441 | + if logwrite_ : logwrite_('libjt_synthesis start.') | |
442 | + try: | |
443 | + libjt.HTS_Engine_set_lf0_offset_amp(engine, lf0_offset_, lf0_amp_) | |
444 | + libjt.HTS_Engine_set_fperiod(engine, fperiod_) # 80(point=5ms) frame period | |
445 | + libjt.mecab2njd(njd, feature, size) | |
446 | + libjt.njd_set_pronunciation(njd) | |
447 | + libjt.njd_set_digit(njd) | |
448 | + libjt.njd_set_accent_phrase(njd) | |
449 | + except WindowsError: | |
450 | + if logwrite_ : logwrite_('libjt_synthesis error #1 ') | |
451 | + # exception: access violation reading 0x00000000 | |
452 | + # https://github.com/nishimotz/libopenjtalk/commit/10d3abda6835e0547846fb5e12a36c1425561aaa#diff-66 | |
453 | + try: | |
454 | + libjt.njd_set_accent_type(njd) | |
455 | + except WindowsError: | |
456 | + if logwrite_ : logwrite_('libjt_synthesis njd_set_accent_type() error ') | |
457 | + try: | |
458 | + libjt.njd_set_unvoiced_vowel(njd) | |
459 | + libjt.njd_set_long_vowel(njd) | |
460 | + libjt.njd2jpcommon(jpcommon, njd) | |
461 | + libjt.JPCommon_make_label(jpcommon) | |
462 | + except WindowsError: | |
463 | + if logwrite_ : logwrite_('libjt_synthesis error #2 ') | |
464 | + if is_speaking_func_ and not is_speaking_func_() : | |
465 | + libjt_refresh() | |
466 | + return None | |
467 | + try: | |
468 | + s = libjt.JPCommon_get_label_size(jpcommon) | |
469 | + except WindowsError: | |
470 | + if logwrite_ : logwrite_('libjt_synthesis JPCommon_get_label_size() error ') | |
471 | + buf = None | |
472 | + if s > 2: | |
473 | + try: | |
474 | + f = libjt.JPCommon_get_label_feature(jpcommon) | |
475 | + libjt.HTS_Engine_load_label_from_string_list(engine, f, s) | |
476 | + libjt.HTS_Engine_create_sstream(engine) | |
477 | + libjt.HTS_Engine_create_pstream(engine) | |
478 | + libjt.HTS_Engine_create_gstream(engine) | |
479 | + except WindowsError: | |
480 | + if logwrite_ : logwrite_('libjt_synthesis error #3 ') | |
481 | + if is_speaking_func_ and not is_speaking_func_() : | |
482 | + libjt_refresh() | |
483 | + return None | |
484 | + try: | |
485 | + total_nsample = libjt.jt_trim_silence(engine, thres_, thres2_) | |
486 | + libjt.jt_speech_normalize(engine, level_, total_nsample) | |
487 | + speech_ptr = libjt.jt_speech_ptr(engine) | |
488 | + byte_count = total_nsample * sizeof(c_short) | |
489 | + buf = string_at(speech_ptr, byte_count) | |
490 | + if feed_func_: feed_func_(buf) | |
491 | + #libjt.jt_save_logs("_logfile", engine, njd) | |
492 | + except WindowsError: | |
493 | + if logwrite_ : logwrite_('libjt_synthesis error #5 ') | |
494 | + if logwrite_ : logwrite_('libjt_synthesis done.') | |
495 | + return buf |
@@ -0,0 +1,250 @@ | ||
1 | +# _nvdajp_espeak.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | + | |
4 | +from __future__ import unicode_literals | |
5 | +import translator2 | |
6 | +from logHandler import log | |
7 | +import re | |
8 | +import copy | |
9 | +from _nvdajp_unicode import unicode_normalize | |
10 | +from speech import CharacterModeCommand | |
11 | + | |
12 | +_logwrite = log.debug | |
13 | + | |
14 | +def isJapaneseLang(msg): | |
15 | + for i in msg: | |
16 | + c = ord(i) | |
17 | + if (0x3040 <= c <= 0x30ff) or (0x3100 <= c <= 0x9fff): | |
18 | + return True | |
19 | + return False | |
20 | + | |
21 | +kanadic = None | |
22 | + | |
23 | +def load_kanadic(): | |
24 | + return [ | |
25 | + [re.compile('キュ'), 'cu'], | |
26 | + [re.compile('キョ'), 'co'], | |
27 | + [re.compile('ギャ'), 'ga'], | |
28 | + [re.compile('ギュ'), 'gu'], | |
29 | + [re.compile('ギョ'), 'go'], | |
30 | + | |
31 | + [re.compile('シャ'), 'sha'], | |
32 | + [re.compile('シュ'), 'shu'], | |
33 | + [re.compile('ショ'), 'sho'], | |
34 | + | |
35 | + [re.compile('ジャ'), 'jar'], | |
36 | + [re.compile('ジュ'), 'ju'], | |
37 | + [re.compile('ジョ'), 'jo'], | |
38 | + [re.compile('ヂャ'), 'jar'], | |
39 | + [re.compile('ヂュ'), 'ju'], | |
40 | + [re.compile('ヂョ'), 'jo'], | |
41 | + [re.compile('ニャ'), 'nyar'], | |
42 | + [re.compile('ニュ'), 'new'], | |
43 | + [re.compile('ニョ'), 'no'], | |
44 | + | |
45 | + [re.compile('ヒャ'), 'hyar'], | |
46 | + [re.compile('ヒュ'), 'hu'], | |
47 | + [re.compile('ヒョ'), 'ho'], | |
48 | + [re.compile('ビャ'), 'bar'], | |
49 | + [re.compile('ビュ'), 'bu'], | |
50 | + [re.compile('ビョ'), 'bo'], | |
51 | + [re.compile('ピャ'), 'pyar'], | |
52 | + [re.compile('ピュ'), 'pew'], | |
53 | + [re.compile('ピョ'), 'po'], | |
54 | + | |
55 | + [re.compile('ミャ'), 'ma'], | |
56 | + [re.compile('ミュ'), 'mu'], | |
57 | + [re.compile('ミョ'), 'mo'], | |
58 | + [re.compile('リャ'), 'ra'], | |
59 | + [re.compile('リュ'), 'ru'], | |
60 | + [re.compile('リョ'), 'ro'], | |
61 | + | |
62 | + [re.compile('イェ'), 'yiay'], | |
63 | + [re.compile('キェ'), 'kyay'], | |
64 | + [re.compile('シェ'), 'shay'], | |
65 | + [re.compile('チェ'), 'chay'], | |
66 | + [re.compile('ニェ'), 'nyay'], | |
67 | + [re.compile('ヒェ'), 'hyay'], | |
68 | + [re.compile('スィ'), 'si'], | |
69 | + [re.compile('ティ'), 'tee'], | |
70 | + [re.compile('ジェ'), 'jay'], | |
71 | + [re.compile('ズィ'), 'zee'], | |
72 | + [re.compile('ディ'), 'di'], | |
73 | + [re.compile('ウィ'), 'we'], | |
74 | + [re.compile('ウェ'), 'way'], | |
75 | + [re.compile('ウォ'), 'wo'], | |
76 | + [re.compile('トゥ'), 'tu'], | |
77 | + [re.compile('クァ'), 'kwa'], | |
78 | + [re.compile('クィ'), 'kwee'], | |
79 | + [re.compile('クェ'), 'kway'], | |
80 | + [re.compile('クォ'), 'kwo'], | |
81 | + [re.compile('ドゥ'), 'du'], | |
82 | + [re.compile('グァ'), 'gwa'], | |
83 | + [re.compile('グィ'), 'gwee'], | |
84 | + [re.compile('グェ'), 'gway'], | |
85 | + [re.compile('グォ'), 'gwo'], | |
86 | + [re.compile('テュ'), 'tu'], | |
87 | + [re.compile('フュ'), 'fu'], | |
88 | + [re.compile('フョ'), 'fo'], | |
89 | + [re.compile('ツァ'), 'tsar'], | |
90 | + [re.compile('ツィ'), 'tsee'], | |
91 | + [re.compile('ツェ'), 'tsay'], | |
92 | + [re.compile('ツォ'), 'tso'], | |
93 | + [re.compile('デュ'), 'du'], | |
94 | + [re.compile('ヴュ'), 'vu'], | |
95 | + [re.compile('ヴョ'), 'vo'], | |
96 | + [re.compile('ファ'), 'far'], | |
97 | + [re.compile('フィ'), 'fi'], | |
98 | + [re.compile('フェ'), 'fe'], | |
99 | + [re.compile('フォ'), 'fo'], | |
100 | + [re.compile('ヴァ'), 'var'], | |
101 | + [re.compile('ヴィ'), 'vee'], | |
102 | + [re.compile('ヴェ'), 'vay'], | |
103 | + [re.compile('ヴォ'), 'vo'], | |
104 | + [re.compile('ヴ'), 'vu'], | |
105 | + | |
106 | + [re.compile('カ'), 'ca'], | |
107 | + [re.compile('キ'), 'kee'], | |
108 | + [re.compile('ク'), 'cu'], | |
109 | + [re.compile('ケ'), 'kay'], | |
110 | + [re.compile('コ'), 'co'], | |
111 | + | |
112 | + [re.compile('ガ'), 'ga'], | |
113 | + [re.compile('ギ'), 'gi'], | |
114 | + [re.compile('グ'), 'gu'], | |
115 | + [re.compile('ゲ'), 'gay'], | |
116 | + [re.compile('ゴ'), 'go'], | |
117 | + | |
118 | + [re.compile('サ'), 'sa'], | |
119 | + [re.compile('シ'), 'shi'], | |
120 | + [re.compile('ス'), 'su'], | |
121 | + [re.compile('セ'), 'say'], | |
122 | + [re.compile('ソ'), 'so'], | |
123 | + | |
124 | + [re.compile('ザ'), 'za'], | |
125 | + [re.compile('ジ'), 'zee'], | |
126 | + [re.compile('ズ'), 'zu'], | |
127 | + [re.compile('ゼ'), 'zay'], | |
128 | + [re.compile('ゾ'), 'zo'], | |
129 | + | |
130 | + [re.compile('タ'), 'ta'], | |
131 | + [re.compile('チ'), 'chee'], | |
132 | + [re.compile('ツ'), 'tsu'], | |
133 | + [re.compile('テ'), 'tay'], | |
134 | + [re.compile('ト'), 'tau'], | |
135 | + | |
136 | + [re.compile('ダ'), 'da'], | |
137 | + [re.compile('ヂ'), 'gee'], | |
138 | + [re.compile('ヅ'), 'zu'], | |
139 | + [re.compile('デ'), 'day'], | |
140 | + [re.compile('ド'), 'dau'], | |
141 | + | |
142 | + [re.compile('ナ'), 'na'], | |
143 | + [re.compile('ニ'), 'nee'], | |
144 | + [re.compile('ヌ'), 'nu'], | |
145 | + [re.compile('ネ'), 'nay'], | |
146 | + [re.compile('ノ'), 'no'], | |
147 | + | |
148 | + [re.compile('ハ'), 'ha'], | |
149 | + [re.compile('ヒ'), 'hee'], | |
150 | + [re.compile('フ'), 'fu'], | |
151 | + [re.compile('ヘ'), 'hay'], | |
152 | + [re.compile('ホ'), 'ho'], | |
153 | + | |
154 | + [re.compile('バ'), 'ba'], | |
155 | + [re.compile('ビ'), 'bee'], | |
156 | + [re.compile('ブ'), 'boo'], | |
157 | + [re.compile('ベ'), 'bay'], | |
158 | + [re.compile('ボ'), 'bo'], | |
159 | + | |
160 | + [re.compile('パ'), 'pa'], | |
161 | + [re.compile('ピ'), 'pee'], | |
162 | + [re.compile('プ'), 'pu'], | |
163 | + [re.compile('ペ'), 'pay'], | |
164 | + [re.compile('ポ'), 'po'], | |
165 | + | |
166 | + [re.compile('マ'), 'ma'], | |
167 | + [re.compile('ミ'), 'mee'], | |
168 | + [re.compile('ム'), 'mu'], | |
169 | + [re.compile('メ'), 'may'], | |
170 | + [re.compile('モ'), 'mo'], | |
171 | + | |
172 | + [re.compile('ヤ'), 'ya'], | |
173 | + [re.compile('ユ'), 'yu'], | |
174 | + [re.compile('ヨ'), 'yo'], | |
175 | + | |
176 | + [re.compile('ラ'), 'la'], | |
177 | + [re.compile('リ'), ' lee'], | |
178 | + [re.compile('ル'), 'lu'], | |
179 | + [re.compile('レ'), ' lay'], | |
180 | + [re.compile('ロ'), ' low'], | |
181 | + | |
182 | + [re.compile('ワ'), 'wa'], | |
183 | + [re.compile('ヲ'), 'wo'], | |
184 | + | |
185 | + [re.compile('ン'), 'n '], | |
186 | + | |
187 | + [re.compile('ア'), ' ah '], | |
188 | + [re.compile('イ'), ' ee '], | |
189 | + [re.compile('ウ'), ' u '], | |
190 | + [re.compile('エ'), ' a '], | |
191 | + [re.compile('オ'), ' o '], | |
192 | + | |
193 | + [re.compile('ァ'), 'ah'], | |
194 | + [re.compile('ィ'), 'ee'], | |
195 | + [re.compile('ゥ'), 'u'], | |
196 | + [re.compile('ェ'), 'a'], | |
197 | + [re.compile('ォ'), 'o'], | |
198 | + | |
199 | + [re.compile('ャ'), 'ya'], | |
200 | + [re.compile('ュ'), 'yu'], | |
201 | + [re.compile('ョ'), 'yo'], | |
202 | + | |
203 | + [re.compile('ッ'), ' '], | |
204 | + [re.compile('ー'), ' '], | |
205 | + | |
206 | + # Braille | |
207 | + [re.compile('[\u2800-\u28ff]+'), ''], | |
208 | + | |
209 | + # Japanese & CJK | |
210 | + [re.compile('[\u3040-\u9fff]+'), ''], | |
211 | + ] | |
212 | + | |
213 | +def replaceJapanese(msg): | |
214 | + if not translator2.mecab_initialized: | |
215 | + translator2.initialize() | |
216 | + msg = translator2.japanese_braille_separate(msg, _logwrite)[0] | |
217 | + | |
218 | + global kanadic | |
219 | + if kanadic is None: | |
220 | + kanadic = load_kanadic() | |
221 | + for p in kanadic: | |
222 | + try: | |
223 | + msg = re.sub(p[0], p[1], msg) | |
224 | + except: | |
225 | + pass | |
226 | + return msg | |
227 | + | |
228 | +def replaceJapaneseFromSpeechSequence(speechSequence): | |
229 | + # we don't want to use CharacterMode for replaced Japanese text | |
230 | + a = [] | |
231 | + charmode = False | |
232 | + for item in speechSequence: | |
233 | + disableCharMode = False | |
234 | + if isinstance(item, basestring): | |
235 | + item = unicode_normalize(item) | |
236 | + if isJapaneseLang(item): | |
237 | + item = replaceJapanese(item) | |
238 | + if charmode: | |
239 | + disableCharMode = True | |
240 | + elif isinstance(item, CharacterModeCommand): | |
241 | + cmstate = item.state | |
242 | + if disableCharMode: | |
243 | + a.append(CharacterModeCommand(False)) | |
244 | + a.append(item) | |
245 | + if charmode: | |
246 | + a.append(CharacterModeCommand(True)) | |
247 | + disableCharMode = False | |
248 | + else: | |
249 | + a.append(item) | |
250 | + return a |
@@ -0,0 +1,296 @@ | ||
1 | +# _nvdajp_jtalk.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +# speech engine nvdajp_jtalk | |
5 | +# Copyright (C) 2010-2012 Takuya Nishimoto (nishimotz.com) | |
6 | +# based on Open JTalk (bin/open_jtalk.c) http://github.com/nishimotz/libopenjtalk/ | |
7 | + | |
8 | +from logHandler import log | |
9 | +import time | |
10 | +import Queue | |
11 | +import os | |
12 | +import codecs | |
13 | +import re | |
14 | +import string | |
15 | +import ctypes | |
16 | +import baseObject | |
17 | +import copy | |
18 | +import nvwave | |
19 | +from .. import _espeak | |
20 | +import _jtalk_core | |
21 | +import _nvdajp_predic | |
22 | +from _nvdajp_unicode import unicode_normalize | |
23 | +import _bgthread | |
24 | +import sys | |
25 | +import time | |
26 | +import watchdog | |
27 | +import config | |
28 | + | |
29 | +jtalk_dir = unicode(os.path.dirname(__file__), 'mbcs') | |
30 | +if hasattr(sys,'frozen'): | |
31 | + d = os.path.join(os.getcwdu(), 'synthDrivers', 'jtalk') | |
32 | + if os.path.isdir(d): | |
33 | + jtalk_dir = d | |
34 | + | |
35 | +DEBUG = False | |
36 | + | |
37 | +RATE_BOOST_MULTIPLIER = 1.5 | |
38 | + | |
39 | +# math.log(150) = 5.0, math.log(350) = 5.86 | |
40 | +_jtalk_voices = [ | |
41 | + {"id": "V1", | |
42 | + "name": "m001", | |
43 | + "lang":"ja", | |
44 | + "samp_rate": 48000, | |
45 | + "fperiod": 240, | |
46 | + "alpha": 0.55, | |
47 | + "lf0_base": 5.0, | |
48 | + "pitch_bias": 0, | |
49 | + "use_lpf": 1, | |
50 | + "speaker_attenuation": 1.0, | |
51 | + "dir": "m001", | |
52 | + "espeak_variant": "max"}, | |
53 | + {"id": "V2", | |
54 | + "name": "mei", | |
55 | + "lang":"ja", | |
56 | + "samp_rate": 48000, | |
57 | + "fperiod": 240, | |
58 | + "alpha": 0.55, | |
59 | + "lf0_base": 5.86, | |
60 | + "pitch_bias": -10, | |
61 | + "use_lpf": 1, | |
62 | + "speaker_attenuation": 0.5, | |
63 | + "dir": "mei_normal", | |
64 | + "espeak_variant": "f1"}, | |
65 | + {"id": "V3", | |
66 | + "name": "lite", | |
67 | + "lang":"ja", | |
68 | + "samp_rate": 16000, | |
69 | + "fperiod": 80, | |
70 | + "alpha": 0.42, | |
71 | + "lf0_base": 5.0, | |
72 | + "pitch_bias": 0, | |
73 | + "use_lpf": 0, | |
74 | + "speaker_attenuation": 1.0, | |
75 | + "dir": "voice", | |
76 | + "espeak_variant": "max"}, | |
77 | +] | |
78 | +default_jtalk_voice = _jtalk_voices[1] # V2 | |
79 | +voice_args = None | |
80 | + | |
81 | +class VoiceProperty(baseObject.AutoPropertyObject): | |
82 | + def __init__(self): | |
83 | + super(VoiceProperty,self).__init__() | |
84 | + | |
85 | +# if samp_rate==16000: normal speed = 80samples period | |
86 | +fperiod = 240 | |
87 | + | |
88 | +# gain control | |
89 | +max_level = 32000 | |
90 | +thres_level = 128 | |
91 | +thres2_level = 128 | |
92 | +speaker_attenuation = 1.0 | |
93 | + | |
94 | +logwrite = None | |
95 | +lastIndex = None | |
96 | +currIndex = None | |
97 | +lastIndex = None | |
98 | +player = None | |
99 | +currentEngine = 0 # 1:espeak 2:jtalk | |
100 | + | |
101 | +def isSpeaking(): | |
102 | + return _bgthread.isSpeaking | |
103 | + | |
104 | +def setSpeaking(b): | |
105 | + _bgthread.isSpeaking = b | |
106 | + | |
107 | +def _jtalk_speak(msg, index=None, prop=None): | |
108 | + if prop is None: return | |
109 | + global currIndex, buff | |
110 | + global currentEngine | |
111 | + currIndex = index | |
112 | + if prop.characterMode: | |
113 | + fperiod_current = voice_args['fperiod'] | |
114 | + else: | |
115 | + fperiod_current = fperiod | |
116 | + msg = unicode_normalize(msg) | |
117 | + msg = _nvdajp_predic.convert(msg) | |
118 | + lw = None | |
119 | + if DEBUG: lw = logwrite | |
120 | + setSpeaking(True) | |
121 | + currentEngine = 2 | |
122 | + if DEBUG: logwrite("p:%d i:%d msg:%s" % (prop.pitch, prop.inflection, msg)) | |
123 | + la = 0.020 * prop.inflection # 50 = original range | |
124 | + ls = 0.015 * (prop.pitch - 50.0 + voice_args['pitch_bias']) # 50 = no shift | |
125 | + lo = ls + voice_args['lf0_base'] * (1 - la) | |
126 | + if DEBUG: logwrite("lo:%f la:%f" % (lo, la)) | |
127 | + for m in string.split(msg): | |
128 | + try: | |
129 | + if DEBUG: logwrite("unicode (%s)" % m) | |
130 | + s = _jtalk_core.Mecab_text2mecab(m) | |
131 | + if DEBUG: logwrite("utf-8 (%s)" % s.decode('utf-8', 'ignore')) | |
132 | + if not isSpeaking(): _jtalk_core.libjt_refresh(); return | |
133 | + mf = _jtalk_core.MecabFeatures() | |
134 | + _jtalk_core.Mecab_analysis(s, mf, logwrite_=logwrite) | |
135 | + if DEBUG: _jtalk_core.Mecab_print(mf, logwrite) | |
136 | + _jtalk_core.Mecab_correctFeatures(mf) | |
137 | + if DEBUG: _jtalk_core.Mecab_print(mf, logwrite) | |
138 | + _jtalk_core.Mecab_utf8_to_cp932(mf) | |
139 | + if DEBUG: _jtalk_core.Mecab_print(mf, logwrite, CODE_='cp932') | |
140 | + if DEBUG: logwrite("Mecab_analysis done") | |
141 | + if not isSpeaking(): _jtalk_core.libjt_refresh(); return | |
142 | + _jtalk_core.libjt_synthesis(mf.feature, mf.size, | |
143 | + fperiod_ = fperiod_current, | |
144 | + feed_func_ = player.feed, # player.feed() is called inside | |
145 | + is_speaking_func_ = isSpeaking, | |
146 | + thres_ = thres_level, | |
147 | + thres2_ = thres2_level, | |
148 | + level_ = int(max_level * speaker_attenuation), | |
149 | + logwrite_ = lw, | |
150 | + lf0_offset_ = lo, | |
151 | + lf0_amp_ = la) | |
152 | + mf = None | |
153 | + if DEBUG: logwrite("libjt_synthesis done") | |
154 | + _jtalk_core.libjt_refresh() | |
155 | + except WindowsError: | |
156 | + if DEBUG: logwrite("WindowsError") | |
157 | + player.sync() | |
158 | + global lastIndex | |
159 | + lastIndex = currIndex | |
160 | + currIndex = None | |
161 | + setSpeaking(False) | |
162 | + currentEngine = 0 | |
163 | + | |
164 | +espeakMark = 10000 | |
165 | + | |
166 | +def _espeak_speak(msg, lang, index=None, prop=None): | |
167 | + global currentEngine, lastIndex, espeakMark | |
168 | + currentEngine = 1 | |
169 | + msg = unicode(msg) | |
170 | + msg.translate({ord(u'\01'):None,ord(u'<'):u'<',ord(u'>'):u'>'}) | |
171 | + msg = u"<voice xml:lang=\"%s\">%s</voice>" % (lang, msg) | |
172 | + msg += u"<mark name=\"%d\" />" % espeakMark | |
173 | + _espeak.speak(msg) | |
174 | + while currentEngine == 1 and _espeak.lastIndex != espeakMark: | |
175 | + time.sleep(0.1) | |
176 | + watchdog.alive() | |
177 | + time.sleep(0.4) | |
178 | + watchdog.alive() | |
179 | + lastIndex = index | |
180 | + currentEngine = 0 | |
181 | + espeakMark += 1 | |
182 | + | |
183 | +# call from BgThread | |
184 | +def _speak(arg): | |
185 | + msg, lang, index, prop = arg | |
186 | + if DEBUG: logwrite('[' + lang + ']' + msg) | |
187 | + if DEBUG: logwrite("_speak(%s)" % msg) | |
188 | + if lang == 'ja': | |
189 | + _jtalk_speak(msg, index, prop) | |
190 | + else: | |
191 | + _espeak_speak(msg, lang, index, prop) | |
192 | + | |
193 | +def speak(msg, lang, index=None, voiceProperty_=None): | |
194 | + msg = msg.strip() | |
195 | + if len(msg) == 0: return | |
196 | + if voiceProperty_ is None: return | |
197 | + arg = [msg, lang, index, copy.deepcopy(voiceProperty_)] | |
198 | + _bgthread.execWhenDone(_speak, arg, mustBeAsync=True) | |
199 | + | |
200 | +def stop(): | |
201 | + global currentEngine | |
202 | + if currentEngine == 1: | |
203 | + _espeak.stop() | |
204 | + currentEngine = 0 | |
205 | + return | |
206 | + # Kill all speech from now. | |
207 | + # We still want parameter changes to occur, so requeue them. | |
208 | + params = [] | |
209 | + stop_task_count = 0 # for log.info() | |
210 | + try: | |
211 | + while True: | |
212 | + item = _bgthread.bgQueue.get_nowait() # [func, args, kwargs] | |
213 | + if item[0] != _speak: | |
214 | + params.append(item) | |
215 | + else: | |
216 | + stop_task_count = stop_task_count + 1 | |
217 | + _bgthread.bgQueue.task_done() | |
218 | + except Queue.Empty: | |
219 | + # Let the exception break us out of this loop, as queue.empty() is not reliable anyway. | |
220 | + pass | |
221 | + for item in params: | |
222 | + _bgthread.bgQueue.put(item) | |
223 | + setSpeaking(False) | |
224 | + if DEBUG: logwrite("stop: %d task(s) stopping" % stop_task_count) | |
225 | + player.stop() | |
226 | + lastIndex = None | |
227 | + | |
228 | +def pause(switch): | |
229 | + if currentEngine == 1: | |
230 | + _espeak.pause(switch) | |
231 | + elif currentEngine == 2: | |
232 | + player.pause(switch) | |
233 | + | |
234 | +def initialize(voice = default_jtalk_voice): | |
235 | + _espeak.initialize() | |
236 | + _espeak.setVoiceByLanguage("en") | |
237 | + _espeak.setVoiceAndVariant(variant=voice["espeak_variant"]) | |
238 | + log.info("jtalk using eSpeak version %s" % _espeak.info()) | |
239 | + global player, logwrite, voice_args | |
240 | + global speaker_attenuation | |
241 | + voice_args = voice | |
242 | + speaker_attenuation = voice_args['speaker_attenuation'] | |
243 | + player = nvwave.WavePlayer(channels=1, samplesPerSec=voice_args['samp_rate'], bitsPerSample=16, outputDevice=config.conf["speech"]["outputDevice"]) | |
244 | + _bgthread.initialize() | |
245 | + | |
246 | + jt_dll = os.path.join(jtalk_dir, 'libopenjtalk.dll') | |
247 | + log.info('jt_dll %s' % jt_dll) | |
248 | + _jtalk_core.libjt_initialize(jt_dll, **voice_args) | |
249 | + voice_dir = os.path.join(jtalk_dir, voice_args['dir']) | |
250 | + if not os.path.isdir(voice_dir): | |
251 | + log.error('%s is not voice directory.' % voice_dir) | |
252 | + return | |
253 | + log.debug('loading %s' % voice_dir) | |
254 | + _jtalk_core.libjt_load(voice_dir) | |
255 | + logwrite = log.debug | |
256 | + _jtalk_core.Mecab_initialize(logwrite) | |
257 | + _nvdajp_predic.setup() | |
258 | + try: | |
259 | + logwrite(_jtalk_core.libjt_version()) | |
260 | + except: | |
261 | + logwrite("libopenjtalk version unavailable") | |
262 | + if DEBUG: logwrite("jtalk for NVDA started. voice:" + voice_args['dir']) | |
263 | + | |
264 | +def terminate(): | |
265 | + global player | |
266 | + stop() | |
267 | + _bgthread.terminate() | |
268 | + player.close() | |
269 | + player = None | |
270 | + _espeak.terminate() | |
271 | + | |
272 | +def get_rate(rateBoost): | |
273 | + f = fperiod | |
274 | + if not rateBoost: | |
275 | + f = fperiod / RATE_BOOST_MULTIPLIER | |
276 | + if voice_args['samp_rate'] == 16000: | |
277 | + return int(160 - 2 * f) | |
278 | + if voice_args['samp_rate'] == 48000: | |
279 | + return int((240 - f) / 1.5) | |
280 | + return 0 | |
281 | + | |
282 | +def set_rate(rate, rateBoost): | |
283 | + global fperiod | |
284 | + if voice_args['samp_rate'] == 16000: | |
285 | + fperiod = int(80 - int(rate) / 2) # 80..30 | |
286 | + if voice_args['samp_rate'] == 48000: | |
287 | + fperiod = int(240 - 1.5 * int(rate)) # 240..90 | |
288 | + if not rateBoost: | |
289 | + fperiod = int(fperiod * RATE_BOOST_MULTIPLIER) | |
290 | + | |
291 | +def set_volume(vol): | |
292 | + global max_level, thres_level, thres2_level | |
293 | + max_level = int(326.67 * int(vol) + 100) # 100..32767 | |
294 | + thres_level = 128 | |
295 | + thres2_level = 128 | |
296 | + |
@@ -0,0 +1,103 @@ | ||
1 | +# _nvdajp_predic.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +# A part of speech engine nvdajp_jtalk | |
4 | +# Copyright (C) 2010-2011 Takuya Nishimoto (nishimotz.com) | |
5 | + | |
6 | +import re | |
7 | + | |
8 | +predic = None | |
9 | + | |
10 | +def setup(): | |
11 | + global predic | |
12 | + if predic is None: | |
13 | + predic = load() | |
14 | + | |
15 | +def convert(msg): | |
16 | + for p in predic: | |
17 | + try: | |
18 | + msg = re.sub(p[0], p[1], msg) | |
19 | + except: | |
20 | + pass | |
21 | + msg = msg.lower() | |
22 | + return msg | |
23 | + | |
24 | +def load(): | |
25 | + return [ | |
26 | + [re.compile(u'^ー$'), u'チョーオン'], | |
27 | + [re.compile(u'^ン$'), u'ウン'], | |
28 | + [re.compile(u'\\sー$'), u' チョーオン'], | |
29 | + [re.compile(u'\\sン$'), u' ウン'], | |
30 | + | |
31 | + ## 人々 昔々 家々 山々 | |
32 | + [re.compile(u'(.)々'), u'\\1\\1'], | |
33 | + | |
34 | + ## isolated hiragana HA (mecab replaces to WA) | |
35 | + ## は | |
36 | + [re.compile(u'^は$'), u'ハ'], | |
37 | + [re.compile(u'\\sは$'), u' ハ'], | |
38 | + | |
39 | + ## 59 名 | |
40 | + [re.compile(u'(\\d) 名'), u'\\1名'], | |
41 | + ## 4行 ヨンコー -> ヨンギョー | |
42 | + [re.compile(u'(\\d)行'), u'\\1ギョー'], | |
43 | + ## 2 分前更新 | |
44 | + [re.compile(u'(\\d)+ 分前更新'), u'\\1分マエコーシン'], | |
45 | + | |
46 | + ## 1MB 10MB 1.2MB 0.5MB 321.0MB 123.45MB 2.7GB | |
47 | + ## 1 MB 10 MB 1.2 MB 0.5 MB 321.0 MB 123.45 MB 2.7 GB | |
48 | + [re.compile(u'(\\d+)\\s*KB'), u'\\1キロバイト'], | |
49 | + [re.compile(u'(\\d+)\\s*MB'), u'\\1メガバイト'], | |
50 | + [re.compile(u'(\\d+)\\s*GB'), u'\\1ギガバイト'], | |
51 | + [re.compile(u'(\\d+)\\s*MHz'), u'\\1メガヘルツ'], | |
52 | + [re.compile(u'(\\d+)\\s*GHz'), u'\\1ギガヘルツ'], | |
53 | + | |
54 | + ## 2013 年 1 月 2 日 | |
55 | + [re.compile(u'(\\d+)\\s+年\\s+(\\d+)\\s+月\\s+(\\d+)\\s+日'), u'\\1年\\2月\\3日'], | |
56 | + | |
57 | + ### zenkaku symbols convert | |
58 | + ## 2011.03.11 | |
59 | + ## 1,234円 | |
60 | + [re.compile(u'.'), u'.'], | |
61 | + [re.compile(u','), u','], | |
62 | + | |
63 | + ## 1,234 | |
64 | + ## 1,234,567 | |
65 | + ## 1,234,567,890 | |
66 | + ## 1,23 = ichi comma niju san | |
67 | + ## 1,0 = ichi comma zero | |
68 | + [re.compile(u'(\\d)\\,(\\d{3})'), u'\\1\\2'], | |
69 | + [re.compile(u'(\\d{2})\\,(\\d{3})'), u'\\1\\2'], | |
70 | + [re.compile(u'(\\d{3})\\,(\\d{3})'), u'\\1\\2'], | |
71 | + [re.compile(u'(\\d)\\,(\\d{1,2})'), u'\\1カンマ\\2'], | |
72 | + | |
73 | + [re.compile(u'(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})'), u'\\1テン\\2テン\\3テン\\4'], | |
74 | + [re.compile(u'(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})'), u'\\1テン\\2テン\\3'], | |
75 | + | |
76 | + # do not replace '0' after '.' to phonetic symbols (prepare) | |
77 | + [re.compile(u'\\.0'), u'.00'], | |
78 | + | |
79 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 0\\4 0\\5 0\\6 0\\7 0\\8 0\\9 '], | |
80 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 0\\4 0\\5 0\\6 0\\7 0\\8 '], | |
81 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 0\\4 0\\5 0\\6 0\\7 '], | |
82 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 0\\4 0\\5 0\\6 '], | |
83 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 0\\4 0\\5 '], | |
84 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 0\\4 '], | |
85 | + [re.compile(u'\\b0(\\d)(\\d)(\\d)'), u' 00 0\\1 0\\2 0\\3 '], | |
86 | + [re.compile(u'\\b0(\\d)(\\d)'), u' 00 0\\1 0\\2 '], | |
87 | + [re.compile(u'\\b0(\\d)'), u' 00 0\\1 '], | |
88 | + | |
89 | + [re.compile(u' 00'), u'ゼロ'], | |
90 | + [re.compile(u' 01'), u'イチ'], | |
91 | + [re.compile(u' 02'), u'ニー'], | |
92 | + [re.compile(u' 03'), u'サン'], | |
93 | + [re.compile(u' 04'), u'ヨン'], | |
94 | + [re.compile(u' 05'), u'ゴー'], | |
95 | + [re.compile(u' 06'), u'ロク'], | |
96 | + [re.compile(u' 07'), u'ナナ'], | |
97 | + [re.compile(u' 08'), u'ハチ'], | |
98 | + [re.compile(u' 09'), u'キュー'], | |
99 | + | |
100 | + # do not replace '0' after '.' to phonetic symbols (finalize) | |
101 | + [re.compile(u'\\.00'), u'.0'], | |
102 | + ] | |
103 | + |
@@ -0,0 +1,131 @@ | ||
1 | +# _nvdajp_spellchar.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#Copyright (C) 2010-2011 Takuya Nishimoto (nishimotz.com) | |
5 | +#This file is covered by the GNU General Public License. | |
6 | +#See the file COPYING for more details. | |
7 | + | |
8 | +# workaround for msspeech Haruka with "Use spelling functionality" | |
9 | + | |
10 | +import re | |
11 | +_dic = None | |
12 | + | |
13 | +def init(): | |
14 | + global _dic | |
15 | + if _dic : return | |
16 | + _dic = [ | |
17 | + ### zenkaku alphabet convert | |
18 | + [re.compile(u'A'), u'A'], | |
19 | + [re.compile(u'B'), u'B'], | |
20 | + [re.compile(u'C'), u'C'], | |
21 | + [re.compile(u'D'), u'D'], | |
22 | + [re.compile(u'E'), u'E'], | |
23 | + [re.compile(u'F'), u'F'], | |
24 | + [re.compile(u'G'), u'G'], | |
25 | + [re.compile(u'H'), u'H'], | |
26 | + [re.compile(u'I'), u'I'], | |
27 | + [re.compile(u'J'), u'J'], | |
28 | + [re.compile(u'K'), u'K'], | |
29 | + [re.compile(u'L'), u'L'], | |
30 | + [re.compile(u'M'), u'M'], | |
31 | + [re.compile(u'N'), u'N'], | |
32 | + [re.compile(u'O'), u'O'], | |
33 | + [re.compile(u'P'), u'P'], | |
34 | + [re.compile(u'Q'), u'Q'], | |
35 | + [re.compile(u'R'), u'R'], | |
36 | + [re.compile(u'S'), u'S'], | |
37 | + [re.compile(u'T'), u'T'], | |
38 | + [re.compile(u'U'), u'U'], | |
39 | + [re.compile(u'V'), u'V'], | |
40 | + [re.compile(u'W'), u'W'], | |
41 | + [re.compile(u'X'), u'X'], | |
42 | + [re.compile(u'Y'), u'Y'], | |
43 | + [re.compile(u'Z'), u'Z'], | |
44 | + | |
45 | + [re.compile(u'a'), u'a'], | |
46 | + [re.compile(u'b'), u'b'], | |
47 | + [re.compile(u'c'), u'c'], | |
48 | + [re.compile(u'd'), u'd'], | |
49 | + [re.compile(u'e'), u'e'], | |
50 | + [re.compile(u'f'), u'f'], | |
51 | + [re.compile(u'g'), u'g'], | |
52 | + [re.compile(u'h'), u'h'], | |
53 | + [re.compile(u'i'), u'i'], | |
54 | + [re.compile(u'j'), u'j'], | |
55 | + [re.compile(u'k'), u'k'], | |
56 | + [re.compile(u'l'), u'l'], | |
57 | + [re.compile(u'm'), u'm'], | |
58 | + [re.compile(u'n'), u'n'], | |
59 | + [re.compile(u'o'), u'o'], | |
60 | + [re.compile(u'p'), u'p'], | |
61 | + [re.compile(u'q'), u'q'], | |
62 | + [re.compile(u'r'), u'r'], | |
63 | + [re.compile(u's'), u's'], | |
64 | + [re.compile(u't'), u't'], | |
65 | + [re.compile(u'u'), u'u'], | |
66 | + [re.compile(u'v'), u'v'], | |
67 | + [re.compile(u'w'), u'w'], | |
68 | + [re.compile(u'x'), u'x'], | |
69 | + [re.compile(u'y'), u'y'], | |
70 | + [re.compile(u'z'), u'z'], | |
71 | + | |
72 | + ### zenkaku numbers convert | |
73 | + [re.compile(u'0'), u'0'], | |
74 | + [re.compile(u'1'), u'1'], | |
75 | + [re.compile(u'2'), u'2'], | |
76 | + [re.compile(u'3'), u'3'], | |
77 | + [re.compile(u'4'), u'4'], | |
78 | + [re.compile(u'5'), u'5'], | |
79 | + [re.compile(u'6'), u'6'], | |
80 | + [re.compile(u'7'), u'7'], | |
81 | + [re.compile(u'8'), u'8'], | |
82 | + [re.compile(u'9'), u'9'], | |
83 | + | |
84 | + [re.compile(u'0'), u'ゼロ '], | |
85 | + [re.compile(u'1'), u'イチ '], | |
86 | + [re.compile(u'2'), u'ニイ '], | |
87 | + [re.compile(u'3'), u'サン '], | |
88 | + [re.compile(u'4'), u'ヨン '], | |
89 | + [re.compile(u'5'), u'ゴオ '], | |
90 | + [re.compile(u'6'), u'ロク '], | |
91 | + [re.compile(u'7'), u'ナナ '], | |
92 | + [re.compile(u'8'), u'ハチ '], | |
93 | + [re.compile(u'9'), u'キュウ '], | |
94 | + | |
95 | + [re.compile(u'(a|A)'), u'エイ '], | |
96 | + [re.compile(u'(b|B)'), u'ビイー '], | |
97 | + [re.compile(u'(c|C)'), u'シイ '], | |
98 | + [re.compile(u'(d|D)'), u'ディイ '], | |
99 | + [re.compile(u'(e|E)'), u'イイー '], | |
100 | + [re.compile(u'(f|F)'), u'エフ '], | |
101 | + [re.compile(u'(g|G)'), u'ジイ '], | |
102 | + [re.compile(u'(h|H)'), u'エイチ '], | |
103 | + [re.compile(u'(i|I)'), u'アイ '], | |
104 | + [re.compile(u'(j|J)'), u'ジェイ '], | |
105 | + [re.compile(u'(k|K)'), u'ケイ '], | |
106 | + [re.compile(u'(l|L)'), u'エル '], | |
107 | + [re.compile(u'(m|M)'), u'エム '], | |
108 | + [re.compile(u'(n|N)'), u'エヌ '], | |
109 | + [re.compile(u'(o|O)'), u'オオ '], | |
110 | + [re.compile(u'(p|P)'), u'ピイイ '], | |
111 | + [re.compile(u'(q|Q)'), u'キュウ '], | |
112 | + [re.compile(u'(r|R)'), u'アール '], | |
113 | + [re.compile(u'(s|S)'), u'エス '], | |
114 | + [re.compile(u'(t|T)'), u'ティイ '], | |
115 | + [re.compile(u'(u|U)'), u'ユウ '], | |
116 | + [re.compile(u'(v|V)'), u'ブイ '], | |
117 | + [re.compile(u'(w|W)'), u'ダブリュウ '], | |
118 | + [re.compile(u'(x|X)'), u'エックス '], | |
119 | + [re.compile(u'(y|Y)'), u'ワイ '], | |
120 | + [re.compile(u'(z|Z)'), u'ゼッド '], | |
121 | + ] | |
122 | + | |
123 | +def convert(msg): | |
124 | + global _dic | |
125 | + if _dic is None: init() | |
126 | + for p in _dic: | |
127 | + try: | |
128 | + msg = re.sub(p[0], p[1], msg) | |
129 | + except: | |
130 | + pass | |
131 | + return msg |
@@ -0,0 +1,18 @@ | ||
1 | +# _nvdajp_unicode.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | + | |
4 | +from __future__ import unicode_literals | |
5 | +import unicodedata | |
6 | + | |
7 | +def unicode_normalize(s): | |
8 | + s = s.replace('\ufffd', '') # Unicode REPLACEMENT CHARACTER | |
9 | + s = s.replace('\u200e', '') # Unicode LEFT-TO-RIGHT MARK | |
10 | + s = s.replace('\u200f', '') # Unicode RIGHT-TO-LEFT MARK | |
11 | + # Mecab_text2mecab() で全角に変換され NFKC で戻せない文字 | |
12 | + s = s.replace('.', '.') | |
13 | + s = unicodedata.normalize('NFKC', s) | |
14 | + s = s.replace('\u2212', '-') # 0x2212 MUNUS SIGN to 0x002D HYPHEN-MINUS | |
15 | + s = s.replace('\u00a5', '\\') # 0x00A5 YEN SIGN | |
16 | + s = s.replace('\u301c', '~') # 0x301C WAVE DASH | |
17 | + return s | |
18 | + |
@@ -0,0 +1,429 @@ | ||
1 | +# coding: UTF-8 | |
2 | +#nvdajptext/mecab.py | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#This file is covered by the GNU General Public License. | |
5 | +#See the file COPYING for more details. | |
6 | +#Copyright (C) 2010-2012 Masataka.Shinke, Takuya Nishimoto | |
7 | + | |
8 | +CODE = 'utf-8' | |
9 | + | |
10 | +from ctypes import * | |
11 | +import codecs | |
12 | +import re | |
13 | +import string | |
14 | +import os | |
15 | +import struct | |
16 | +import unicodedata | |
17 | +import threading | |
18 | +import sys | |
19 | + | |
20 | +DEFAULT_JTALK_DIR = unicode(os.path.dirname(__file__), 'mbcs') | |
21 | +if hasattr(sys,'frozen'): | |
22 | + d = os.path.join(os.getcwdu(), 'synthDrivers', 'jtalk') | |
23 | + if os.path.isdir(d): | |
24 | + DEFAULT_JTALK_DIR = d | |
25 | + | |
26 | +c_double_p = POINTER(c_double) | |
27 | +c_double_p_p = POINTER(c_double_p) | |
28 | +c_short_p = POINTER(c_short) | |
29 | +c_char_p_p = POINTER(c_char_p) | |
30 | + | |
31 | +############################################## | |
32 | + | |
33 | +# http://mecab.sourceforge.net/libmecab.html | |
34 | +# c:/mecab/sdk/mecab.h | |
35 | +MECAB_NOR_NODE = 0 | |
36 | +MECAB_UNK_NODE = 1 | |
37 | +MECAB_BOS_NODE = 2 | |
38 | +MECAB_EOS_NODE = 3 | |
39 | +class mecab_token_t(Structure): | |
40 | + pass | |
41 | +mecab_token_t_ptr = POINTER(mecab_token_t) | |
42 | + | |
43 | +class mecab_path_t(Structure): | |
44 | + pass | |
45 | +mecab_path_t_ptr = POINTER(mecab_path_t) | |
46 | + | |
47 | +class mecab_node_t(Structure): | |
48 | + pass | |
49 | +mecab_node_t_ptr = POINTER(mecab_node_t) | |
50 | +mecab_node_t_ptr_ptr = POINTER(mecab_node_t_ptr) | |
51 | +mecab_node_t._fields_ = [ | |
52 | + ("prev", mecab_node_t_ptr), | |
53 | + ("next", mecab_node_t_ptr), | |
54 | + ("enext", mecab_node_t_ptr), | |
55 | + ("bnext", mecab_node_t_ptr), | |
56 | + ("rpath", mecab_path_t_ptr), | |
57 | + ("lpath", mecab_path_t_ptr), | |
58 | + # ("begin_node_list", mecab_node_t_ptr_ptr), | |
59 | + # ("end_node_list", mecab_node_t_ptr_ptr), | |
60 | + ("surface", c_char_p), | |
61 | + ("feature", c_char_p), | |
62 | + ("id", c_uint), | |
63 | + ("length", c_ushort), | |
64 | + ("rlength", c_ushort), | |
65 | + ("rcAttr", c_ushort), | |
66 | + ("lcAttr", c_ushort), | |
67 | + ("posid", c_ushort), | |
68 | + ("char_type", c_ubyte), | |
69 | + ("stat", c_ubyte), | |
70 | + ("isbest", c_ubyte), | |
71 | + # ("sentence_length", c_uint), | |
72 | + ("alpha", c_float), | |
73 | + ("beta", c_float), | |
74 | + ("prob", c_float), | |
75 | + ("wcost", c_short), | |
76 | + ("cost", c_long), | |
77 | + # ("token", mecab_token_t_ptr), | |
78 | + ] | |
79 | + | |
80 | +############################################ | |
81 | + | |
82 | +# typedef struct _Mecab{ | |
83 | +# char **feature; | |
84 | +# int size; | |
85 | +# mecab_t *mecab; | |
86 | +# } Mecab; | |
87 | + | |
88 | +FELEN = 1000 # string len | |
89 | +FECOUNT = 1000 | |
90 | +FEATURE = c_char * FELEN | |
91 | +FEATURE_ptr = POINTER(FEATURE) | |
92 | +FEATURE_ptr_array = FEATURE_ptr * FECOUNT | |
93 | +FEATURE_ptr_array_ptr = POINTER(FEATURE_ptr_array) | |
94 | + | |
95 | +mecab = None | |
96 | +libmc = None | |
97 | +lock = threading.Lock() | |
98 | + | |
99 | +mc_malloc = cdll.msvcrt.malloc | |
100 | +mc_malloc.restype = POINTER(c_ubyte) | |
101 | +mc_calloc = cdll.msvcrt.calloc | |
102 | +mc_calloc.restype = POINTER(c_ubyte) | |
103 | +mc_free = cdll.msvcrt.free | |
104 | + | |
105 | +class NonblockingMecabFeatures(object): | |
106 | + def __init__(self): | |
107 | + self.size = 0 | |
108 | + self.feature = FEATURE_ptr_array() | |
109 | + for i in xrange(0, FECOUNT): | |
110 | + buf = mc_malloc(FELEN) | |
111 | + self.feature[i] = cast(buf, FEATURE_ptr) | |
112 | + | |
113 | + def __del__(self): | |
114 | + for i in xrange(0, FECOUNT): | |
115 | + try: | |
116 | + mc_free(self.feature[i]) | |
117 | + except: | |
118 | + pass | |
119 | + | |
120 | +class MecabFeatures(NonblockingMecabFeatures): | |
121 | + def __init__(self): | |
122 | + global lock | |
123 | + lock.acquire() | |
124 | + super(MecabFeatures, self).__init__() | |
125 | + | |
126 | + def __del__(self): | |
127 | + global lock | |
128 | + super(MecabFeatures, self).__del__() | |
129 | + lock.release() | |
130 | + | |
131 | +predic = None | |
132 | + | |
133 | +def text2mecab_setup(): | |
134 | + global predic | |
135 | + if predic is None: | |
136 | + predic = [ | |
137 | + [re.compile(u" "), u" "], | |
138 | + [re.compile(u"!"), u"!"], | |
139 | + [re.compile(u"\""), u"”"], | |
140 | + [re.compile(u"#"), u"#"], | |
141 | + [re.compile(u"\\$"), u"$"], | |
142 | + [re.compile(u"%"), u"%"], | |
143 | + [re.compile(u"&"), u"&"], | |
144 | + [re.compile(u"'"), u"’"], | |
145 | + [re.compile(u"\\("), u"("], | |
146 | + [re.compile(u"\\)"), u")"], | |
147 | + [re.compile(u"\\*"), u"*"], | |
148 | + [re.compile(u"\\+"), u"+"], | |
149 | + [re.compile(u","), u","], | |
150 | + [re.compile(u"\\-"), u"−"], | |
151 | + [re.compile(u"\\."), u"."], | |
152 | + [re.compile(u"\\/"), u"/"], | |
153 | + [re.compile(u"0"), u"0"], | |
154 | + [re.compile(u"1"), u"1"], | |
155 | + [re.compile(u"2"), u"2"], | |
156 | + [re.compile(u"3"), u"3"], | |
157 | + [re.compile(u"4"), u"4"], | |
158 | + [re.compile(u"5"), u"5"], | |
159 | + [re.compile(u"6"), u"6"], | |
160 | + [re.compile(u"7"), u"7"], | |
161 | + [re.compile(u"8"), u"8"], | |
162 | + [re.compile(u"9"), u"9"], | |
163 | + [re.compile(u":"), u":"], | |
164 | + [re.compile(u";"), u";"], | |
165 | + [re.compile(u"<"), u"<"], | |
166 | + [re.compile(u"="), u"="], | |
167 | + [re.compile(u">"), u">"], | |
168 | + [re.compile(u"\?"), u"?"], | |
169 | + [re.compile(u"@"), u"@"], | |
170 | + [re.compile(u"A"), u"A"], | |
171 | + [re.compile(u"B"), u"B"], | |
172 | + [re.compile(u"C"), u"C"], | |
173 | + [re.compile(u"D"), u"D"], | |
174 | + [re.compile(u"E"), u"E"], | |
175 | + [re.compile(u"F"), u"F"], | |
176 | + [re.compile(u"G"), u"G"], | |
177 | + [re.compile(u"H"), u"H"], | |
178 | + [re.compile(u"I"), u"I"], | |
179 | + [re.compile(u"J"), u"J"], | |
180 | + [re.compile(u"K"), u"K"], | |
181 | + [re.compile(u"L"), u"L"], | |
182 | + [re.compile(u"M"), u"M"], | |
183 | + [re.compile(u"N"), u"N"], | |
184 | + [re.compile(u"O"), u"O"], | |
185 | + [re.compile(u"P"), u"P"], | |
186 | + [re.compile(u"Q"), u"Q"], | |
187 | + [re.compile(u"R"), u"R"], | |
188 | + [re.compile(u"S"), u"S"], | |
189 | + [re.compile(u"T"), u"T"], | |
190 | + [re.compile(u"U"), u"U"], | |
191 | + [re.compile(u"V"), u"V"], | |
192 | + [re.compile(u"W"), u"W"], | |
193 | + [re.compile(u"X"), u"X"], | |
194 | + [re.compile(u"Y"), u"Y"], | |
195 | + [re.compile(u"Z"), u"Z"], | |
196 | + [re.compile(u"\\["), u"["], | |
197 | + [re.compile(u"\\\\"), u"¥"], | |
198 | + [re.compile(u"\\]"), u"]"], | |
199 | + [re.compile(u"\\^"), u"^"], | |
200 | + [re.compile(u"_"), u"_"], | |
201 | + [re.compile(u"`"), u"‘"], | |
202 | + [re.compile(u"a"), u"a"], | |
203 | + [re.compile(u"b"), u"b"], | |
204 | + [re.compile(u"c"), u"c"], | |
205 | + [re.compile(u"d"), u"d"], | |
206 | + [re.compile(u"e"), u"e"], | |
207 | + [re.compile(u"f"), u"f"], | |
208 | + [re.compile(u"g"), u"g"], | |
209 | + [re.compile(u"h"), u"h"], | |
210 | + [re.compile(u"i"), u"i"], | |
211 | + [re.compile(u"j"), u"j"], | |
212 | + [re.compile(u"k"), u"k"], | |
213 | + [re.compile(u"l"), u"l"], | |
214 | + [re.compile(u"m"), u"m"], | |
215 | + [re.compile(u"n"), u"n"], | |
216 | + [re.compile(u"o"), u"o"], | |
217 | + [re.compile(u"p"), u"p"], | |
218 | + [re.compile(u"q"), u"q"], | |
219 | + [re.compile(u"r"), u"r"], | |
220 | + [re.compile(u"s"), u"s"], | |
221 | + [re.compile(u"t"), u"t"], | |
222 | + [re.compile(u"u"), u"u"], | |
223 | + [re.compile(u"v"), u"v"], | |
224 | + [re.compile(u"w"), u"w"], | |
225 | + [re.compile(u"x"), u"x"], | |
226 | + [re.compile(u"y"), u"y"], | |
227 | + [re.compile(u"z"), u"z"], | |
228 | + [re.compile(u"{"), u"{"], | |
229 | + [re.compile(u"\\|"), u"|"], | |
230 | + [re.compile(u"}"), u"}"], | |
231 | + [re.compile(u"~"), u"〜"], | |
232 | + ] | |
233 | + | |
234 | +def text2mecab_convert(s): | |
235 | + for p in predic: | |
236 | + try: | |
237 | + s = re.sub(p[0], p[1], s) | |
238 | + except: | |
239 | + pass | |
240 | + return s | |
241 | + | |
242 | +def Mecab_text2mecab(txt, CODE_=CODE): | |
243 | + text2mecab_setup() | |
244 | + txt = unicodedata.normalize('NFKC', txt) | |
245 | + txt = text2mecab_convert(txt) | |
246 | + return txt.encode(CODE_, 'ignore') | |
247 | + | |
248 | +def Mecab_initialize(logwrite_ = None, jtalk_dir = DEFAULT_JTALK_DIR): | |
249 | + #if logwrite_: logwrite_('mecab init begin') | |
250 | + mecab_dll = os.path.join(jtalk_dir, 'libmecab.dll') | |
251 | + global libmc | |
252 | + if libmc is None: | |
253 | + libmc = cdll.LoadLibrary(mecab_dll.encode('mbcs')) | |
254 | + libmc.mecab_version.restype = c_char_p | |
255 | + libmc.mecab_strerror.restype = c_char_p | |
256 | + libmc.mecab_sparse_tonode.restype = mecab_node_t_ptr | |
257 | + libmc.mecab_new.argtypes = [c_int, c_char_p_p] | |
258 | + global mecab | |
259 | + if mecab is None: | |
260 | + dic = os.path.join(jtalk_dir, 'dic') | |
261 | + if logwrite_: logwrite_('dic: %s' % dic) | |
262 | + f = open(os.path.join(dic, "DIC_VERSION")) | |
263 | + s = f.read().strip() | |
264 | + f.close() | |
265 | + logwrite_('mecab:' + libmc.mecab_version() + ' ' + s) | |
266 | + # check utf-8 dictionary | |
267 | + if not CODE in s: | |
268 | + raise RuntimeError('utf-8 dictionary for mecab required.') | |
269 | + mecabrc = os.path.join(jtalk_dir, 'mecabrc') | |
270 | + args = (c_char_p * 5)('mecab', '-d', dic.encode('utf-8'), '-r', mecabrc.encode('utf-8')) | |
271 | + mecab = libmc.mecab_new(5, args) | |
272 | + if logwrite_: | |
273 | + if not mecab: logwrite_('mecab_new failed.') | |
274 | + logwrite_(libmc.mecab_strerror(mecab)) | |
275 | + #if logwrite_: logwrite_('mecab init end') | |
276 | + | |
277 | +def Mecab_analysis(src, features, logwrite_ = None): | |
278 | + if not src: | |
279 | + if logwrite_: logwrite('src empty') | |
280 | + features.size = 0 | |
281 | + return | |
282 | + head = libmc.mecab_sparse_tonode(mecab, src) | |
283 | + if head is None: | |
284 | + if logwrite_: logwrite('mecab_sparse_tonode result empty') | |
285 | + features.size = 0 | |
286 | + return | |
287 | + features.size = 0 | |
288 | + | |
289 | + # make array of features | |
290 | + node = head | |
291 | + i = 0 | |
292 | + while node: | |
293 | + s = node[0].stat | |
294 | + if s != MECAB_BOS_NODE and s != MECAB_EOS_NODE: | |
295 | + c = node[0].length | |
296 | + s = string_at(node[0].surface, c) + "," + string_at(node[0].feature) | |
297 | + if logwrite_: logwrite_(s.decode(CODE, 'ignore')) | |
298 | + buf = create_string_buffer(s) | |
299 | + dst_ptr = features.feature[i] | |
300 | + src_ptr = byref(buf) | |
301 | + memmove(dst_ptr, src_ptr, len(s)+1) | |
302 | + i += 1 | |
303 | + node = node[0].next | |
304 | + features.size = i | |
305 | + if i > FECOUNT: | |
306 | + if logwrite_: logwrite('too many nodes') | |
307 | + return | |
308 | + return | |
309 | + | |
310 | +# for debug | |
311 | +def Mecab_print(mf, logwrite_ = None, CODE_ = CODE, output_header = True): | |
312 | + if logwrite_ is None: return | |
313 | + feature = mf.feature | |
314 | + size = mf.size | |
315 | + if feature is None or size is None: | |
316 | + if output_header: | |
317 | + logwrite_( "Mecab_print size: 0" ) | |
318 | + return | |
319 | + s2 = '' | |
320 | + if output_header: | |
321 | + s2 += "Mecab_print size: %d\n" % size | |
322 | + for i in xrange(0, size): | |
323 | + s = string_at(feature[i]) | |
324 | + if s: | |
325 | + if CODE_ is None: | |
326 | + s2 += "%d %s\n" % (i, s) | |
327 | + else: | |
328 | + s2 += "%d %s\n" % (i, s.decode(CODE_, 'ignore')) | |
329 | + else: | |
330 | + s2 += "[None]\n" | |
331 | + logwrite_(s2) | |
332 | + | |
333 | +def Mecab_getFeature(mf, pos, CODE_ = CODE): | |
334 | + s = string_at(mf.feature[pos]) | |
335 | + return s.decode(CODE_, 'ignore') | |
336 | + | |
337 | +def Mecab_setFeature(mf, pos, s, CODE_ = CODE): | |
338 | + s = s.encode(CODE_, 'ignore') | |
339 | + buf = create_string_buffer(s) | |
340 | + dst_ptr = mf.feature[pos] | |
341 | + src_ptr = byref(buf) | |
342 | + memmove(dst_ptr, src_ptr, len(s)+1) | |
343 | + | |
344 | +def getMoraCount(s): | |
345 | + # 1/3 => 3 | |
346 | + # */* => 0 | |
347 | + m = s.split('/') | |
348 | + if len(m) == 2: | |
349 | + m2 = m[1] | |
350 | + if m2 != '*': | |
351 | + return int(m2) | |
352 | + return 0 | |
353 | + | |
354 | +# PATTERN 1 | |
355 | +# before: | |
356 | +# 1 五絡脈病証,名詞,数,*,*,*,*,* | |
357 | +# | |
358 | +# after: | |
359 | +# 1 五絡脈病証,名詞,普通名詞,*,*,*,*,五絡脈病証,ゴミャクラクビョウショウ, | |
360 | +# ゴミャクラクビョーショー,1/9,C0 | |
361 | +# | |
362 | +# PATTERN 2 | |
363 | +# before: | |
364 | +# 0 ∫⣿♪ ,名詞,サ変接続,*,*,*,*,* | |
365 | +# | |
366 | +# after: | |
367 | +# 0 ∫⣿♪ ,名詞,サ変接続,*,*,*,*,∫♪ ,セキブンキゴーイチニーサンヨンゴーロクナナ | |
368 | +# ハチノテンオンプ,セキブンキゴーイチニーサンヨンゴーロクナナハチノテンオンプ,1/29,C0 | |
369 | +# | |
370 | +# PATTERN 3 | |
371 | +# before: | |
372 | +# 0 ま,接頭詞,名詞接続,*,*,*,*,ま,マ,マ,1/1,P2 | |
373 | +# 1 ー,名詞,一般,*,*,*,*,* | |
374 | +# | |
375 | +# after: | |
376 | +# 0 ま,接頭詞,名詞接続,*,*,*,*,まー,マー,マー,1/2,P2 | |
377 | +# 1 ー,名詞,一般,*,*,*,*,* | |
378 | +def Mecab_correctFeatures(mf, CODE_ = CODE): | |
379 | + for pos in xrange(0, mf.size): | |
380 | + ar = Mecab_getFeature(mf, pos, CODE_=CODE_).split(',') | |
381 | + need_fix = False | |
382 | + if ar[2] == u'数' and ar[7] == u'*': | |
383 | + need_fix = True | |
384 | + if ar[1] == u'名詞' and ar[2] == u'サ変接続' and ar[7] == u'*': | |
385 | + need_fix = True | |
386 | + if need_fix: | |
387 | + hyoki = ar[0] | |
388 | + yomi = '' | |
389 | + pron = '' | |
390 | + mora = 0 | |
391 | + nbmf = NonblockingMecabFeatures() | |
392 | + for c in hyoki: | |
393 | + Mecab_analysis(Mecab_text2mecab(c, CODE_=CODE_), nbmf) | |
394 | + for pos2 in xrange(0, nbmf.size): | |
395 | + ar2 = Mecab_getFeature(nbmf, pos2, CODE_=CODE_).split(',') | |
396 | + if len(ar2) > 10: | |
397 | + yomi += ar2[8] | |
398 | + pron += ar2[9] | |
399 | + mora += getMoraCount(ar2[10]) | |
400 | + nbmf = None | |
401 | + feature = u'{h},名詞,普通名詞,*,*,*,*,{h},{y},{p},1/{m},C0'.format(h=hyoki, y=yomi, p=pron, m=mora) | |
402 | + Mecab_setFeature(mf, pos, feature, CODE_=CODE_) | |
403 | + elif pos > 0 and ar[0] == u'ー' and ar[1] == u'名詞' and ar[2] == u'一般': | |
404 | + ar2 = Mecab_getFeature(mf, pos-1, CODE_=CODE_).split(',') | |
405 | + if len(ar2) > 10: | |
406 | + hyoki = ar2[0] + u'ー' | |
407 | + hin1 = ar2[1] | |
408 | + hin2 = ar2[2] | |
409 | + yomi = ar2[8] + u'ー' | |
410 | + pron = ar2[9] + u'ー' | |
411 | + mora = getMoraCount(ar2[10]) + 1 | |
412 | + feature = u'{h},{h1},{h2},*,*,*,*,{h},{y},{p},1/{m},C0'.format(h=hyoki, h1=hin1, h2=hin2, y=yomi, p=pron, m=mora) | |
413 | + Mecab_setFeature(mf, pos-1, feature, CODE_=CODE_) | |
414 | + elif pos >= 2: | |
415 | + ar3 = Mecab_getFeature(mf, pos-2, CODE_=CODE_).split(',') | |
416 | + if len(ar3) > 10 and ar3[1] != u'記号': | |
417 | + hyoki = ar3[0] + ar2[0] + u'ー' | |
418 | + hin1 = ar3[1] | |
419 | + hin2 = ar3[2] | |
420 | + yomi = ar3[8] + ar2[0] + u'ー' | |
421 | + pron = ar3[9] + ar2[0] + u'ー' | |
422 | + mora = getMoraCount(ar3[10]) + len(ar2[0]) + 1 | |
423 | + feature = u'{h},{h1},{h2},*,*,*,*,{h},{y},{p},1/{m},C0'.format(h=hyoki, h1=hin1, h2=hin2, y=yomi, p=pron, m=mora) | |
424 | + Mecab_setFeature(mf, pos-2, feature, CODE_=CODE_) | |
425 | + | |
426 | +def Mecab_utf8_to_cp932(mf): | |
427 | + for pos in xrange(0, mf.size): | |
428 | + s = Mecab_getFeature(mf, pos, CODE_ = 'utf-8') | |
429 | + Mecab_setFeature(mf, pos, s, CODE_ = 'cp932') |
@@ -0,0 +1,524 @@ | ||
1 | +# coding: UTF-8 | |
2 | +#translator1.py (Japanese Braille translator Phase 1) | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#Copyright (C) 2012 Masataka.Shinke, Takuya Nishimoto | |
5 | +#Copyright (C) 2013 Takuya Nishimoto (NVDA Japanese Team) | |
6 | +#This file is covered by the GNU General Public License. | |
7 | +#See the file COPYING for more details. | |
8 | + | |
9 | +from __future__ import unicode_literals | |
10 | +import unicodedata | |
11 | +import re | |
12 | + | |
13 | +kana1_dic = { | |
14 | + 'ア':'⠁', | |
15 | + 'イ':'⠃', | |
16 | + 'ウ':'⠉', | |
17 | + 'エ':'⠋', | |
18 | + 'オ':'⠊', | |
19 | + 'カ':'⠡', | |
20 | + 'キ':'⠣', | |
21 | + 'ク':'⠩', | |
22 | + 'ケ':'⠫', | |
23 | + 'コ':'⠪', | |
24 | + 'サ':'⠱', | |
25 | + 'シ':'⠳', | |
26 | + 'ス':'⠹', | |
27 | + 'セ':'⠻', | |
28 | + 'ソ':'⠺', | |
29 | + 'タ':'⠕', | |
30 | + 'チ':'⠗', | |
31 | + 'ツ':'⠝', | |
32 | + 'テ':'⠟', | |
33 | + 'ト':'⠞', | |
34 | + 'ナ':'⠅', | |
35 | + 'ニ':'⠇', | |
36 | + 'ヌ':'⠍', | |
37 | + 'ネ':'⠏', | |
38 | + 'ノ':'⠎', | |
39 | + 'ハ':'⠥', | |
40 | + 'ヒ':'⠧', | |
41 | + 'フ':'⠭', | |
42 | + 'ヘ':'⠯', | |
43 | + 'ホ':'⠮', | |
44 | + 'マ':'⠵', | |
45 | + 'ミ':'⠷', | |
46 | + 'ム':'⠽', | |
47 | + 'メ':'⠿', | |
48 | + 'モ':'⠾', | |
49 | + 'ヤ':'⠌', | |
50 | + 'ユ':'⠬', | |
51 | + 'ヨ':'⠜', | |
52 | + 'ラ':'⠑', | |
53 | + 'リ':'⠓', | |
54 | + 'ル':'⠙', | |
55 | + 'レ':'⠛', | |
56 | + 'ロ':'⠚', | |
57 | + 'ワ':'⠄', | |
58 | + 'ヰ':'⠆', | |
59 | + 'ヱ':'⠖', | |
60 | + 'ヲ':'⠔', | |
61 | + 'ン':'⠴', | |
62 | + 'ッ':'⠂', | |
63 | + 'ヴ':'⠐⠉', | |
64 | + 'ガ':'⠐⠡', | |
65 | + 'ギ':'⠐⠣', | |
66 | + 'グ':'⠐⠩', | |
67 | + 'ゲ':'⠐⠫', | |
68 | + 'ゴ':'⠐⠪', | |
69 | + 'ザ':'⠐⠱', | |
70 | + 'ジ':'⠐⠳', | |
71 | + 'ズ':'⠐⠹', | |
72 | + 'ゼ':'⠐⠻', | |
73 | + 'ゾ':'⠐⠺', | |
74 | + 'ダ':'⠐⠕', | |
75 | + 'ヂ':'⠐⠗', | |
76 | + 'ヅ':'⠐⠝', | |
77 | + 'デ':'⠐⠟', | |
78 | + 'ド':'⠐⠞', | |
79 | + 'バ':'⠐⠥', | |
80 | + 'ビ':'⠐⠧', | |
81 | + 'ブ':'⠐⠭', | |
82 | + 'ベ':'⠐⠯', | |
83 | + 'ボ':'⠐⠮', | |
84 | + 'パ':'⠠⠥', | |
85 | + 'ピ':'⠠⠧', | |
86 | + 'プ':'⠠⠭', | |
87 | + 'ペ':'⠠⠯', | |
88 | + 'ポ':'⠠⠮', | |
89 | + } | |
90 | +kana2_dic = { | |
91 | + 'イェ':'⠈⠋', | |
92 | + 'キャ':'⠈⠡', | |
93 | + 'キュ':'⠈⠩', | |
94 | + 'キェ':'⠈⠫', | |
95 | + 'キョ':'⠈⠪', | |
96 | + 'シャ':'⠈⠱', | |
97 | + 'スィ':'⠈⠳', | |
98 | + 'シュ':'⠈⠹', | |
99 | + 'シェ':'⠈⠻', | |
100 | + 'ショ':'⠈⠺', | |
101 | + 'チャ':'⠈⠕', | |
102 | + 'ティ':'⠈⠗', | |
103 | + 'チュ':'⠈⠝', | |
104 | + 'チェ':'⠈⠟', | |
105 | + 'チョ':'⠈⠞', | |
106 | + 'ニャ':'⠈⠅', | |
107 | + 'ニュ':'⠈⠍', | |
108 | + 'ニェ':'⠈⠏', | |
109 | + 'ニョ':'⠈⠎', | |
110 | + 'ヒャ':'⠈⠥', | |
111 | + 'ヒュ':'⠈⠭', | |
112 | + 'ヒェ':'⠈⠯', | |
113 | + 'ヒョ':'⠈⠮', | |
114 | + 'ミャ':'⠈⠵', | |
115 | + 'ミュ':'⠈⠽', | |
116 | + 'ミェ':'⠈⠿', | |
117 | + 'ミョ':'⠈⠾', | |
118 | + 'リャ':'⠈⠑', | |
119 | + 'リュ':'⠈⠙', | |
120 | + 'リェ':'⠈⠛', | |
121 | + 'リョ':'⠈⠚', | |
122 | + 'ギャ':'⠘⠡', | |
123 | + 'ギュ':'⠘⠩', | |
124 | + 'ギェ':'⠘⠫', | |
125 | + 'ギョ':'⠘⠪', | |
126 | + 'ジャ':'⠘⠱', | |
127 | + 'ズィ':'⠘⠳', | |
128 | + 'ジュ':'⠘⠹', | |
129 | + 'ジェ':'⠘⠻', | |
130 | + 'ジョ':'⠘⠺', | |
131 | + 'ヂャ':'⠘⠕', | |
132 | + 'ディ':'⠘⠗', | |
133 | + 'ヂュ':'⠘⠝', | |
134 | + 'ヂェ':'⠘⠟', | |
135 | + 'ヂョ':'⠘⠞', | |
136 | + 'ビャ':'⠘⠥', | |
137 | + 'ビュ':'⠘⠭', | |
138 | + 'ビェ':'⠘⠯', | |
139 | + 'ビョ':'⠘⠮', | |
140 | + 'テュ':'⠨⠝', | |
141 | + 'ピャ':'⠨⠥', | |
142 | + 'ピュ':'⠨⠭', | |
143 | + 'ピョ':'⠨⠮', | |
144 | + 'フュ':'⠨⠬', | |
145 | + 'フョ':'⠨⠜', | |
146 | + 'デュ':'⠸⠝', | |
147 | + 'ヴュ':'⠸⠬', | |
148 | + 'ヴョ':'⠸⠜', | |
149 | + 'ウァ':'⠢⠁', | |
150 | + 'ウィ':'⠢⠃', | |
151 | + 'ウェ':'⠢⠋', | |
152 | + 'ウォ':'⠢⠊', | |
153 | + 'クァ':'⠢⠡', | |
154 | + 'クィ':'⠢⠣', | |
155 | + 'クェ':'⠢⠫', | |
156 | + 'クォ':'⠢⠪', | |
157 | + 'ツァ':'⠢⠕', | |
158 | + 'ツィ':'⠢⠗', | |
159 | + 'トゥ':'⠢⠝', | |
160 | + 'ツェ':'⠢⠟', | |
161 | + 'ツォ':'⠢⠞', | |
162 | + 'ファ':'⠢⠥', | |
163 | + 'フィ':'⠢⠧', | |
164 | + 'フェ':'⠢⠯', | |
165 | + 'フォ':'⠢⠮', | |
166 | + 'グァ':'⠲⠡', | |
167 | + 'グィ':'⠲⠣', | |
168 | + 'グェ':'⠲⠫', | |
169 | + 'グォ':'⠲⠪', | |
170 | + 'ヅァ':'⠲⠕', | |
171 | + 'ヅィ':'⠲⠗', | |
172 | + 'ドゥ':'⠲⠝', | |
173 | + 'ヅェ':'⠲⠟', | |
174 | + 'ヅォ':'⠲⠞', | |
175 | + 'ヴァ':'⠲⠥', | |
176 | + 'ヴィ':'⠲⠧', | |
177 | + 'ヴェ':'⠲⠯', | |
178 | + 'ヴォ':'⠲⠮', | |
179 | + } | |
180 | +jp_symbol_dic = { | |
181 | + '+':'⠢', | |
182 | + '-':'⠤', | |
183 | + ':':'⠐⠂', | |
184 | + '\\':'⠫', # yen mark | |
185 | + '?':'⠢ ', # one space | |
186 | + '@':'⠪', | |
187 | + '<':'⠔⠔', | |
188 | + '>':'⠢⠢', | |
189 | + '=':'⠒⠒', | |
190 | + '#':'⠰⠩', | |
191 | + '$':'⠹', | |
192 | + '%':'⠰⠏', | |
193 | + '&':'⠰⠯', | |
194 | + '*':'⠰⠡', | |
195 | + ';':'⠆', | |
196 | + '|':'⠳', | |
197 | + '"':'⠶', | |
198 | + # "'":'⠄', | |
199 | + #'/':'⠌', | |
200 | + '.':'⠲', | |
201 | + '!':'⠖ ', # one space | |
202 | + '^':'⠘', | |
203 | + '`':'⠐⠑', | |
204 | + '_':'⠐⠤', | |
205 | + '~':'⠐⠉', | |
206 | + 'ー':'⠒', | |
207 | + '、':'⠰ ', # one space | |
208 | + '。':'⠲ ', # two spaces | |
209 | + '・':'⠐ ', # one space | |
210 | + '|':'⠶', | |
211 | + '_':'⠤', | |
212 | + '「':'⠤', | |
213 | + '」':'⠤', | |
214 | + '『':'⠰⠤', | |
215 | + '』':'⠤⠆', | |
216 | + '「':'⠤', | |
217 | + '」':'⠤', | |
218 | + '(':'⠶', | |
219 | + ')':'⠶', | |
220 | + '(':'⠶', | |
221 | + ')':'⠶', | |
222 | + '[':'⠐⠶', | |
223 | + ']':'⠶⠂', | |
224 | + '“':'⠐⠶', | |
225 | + '”':'⠶⠂', | |
226 | + '{':'⠐⠶', | |
227 | + '}':'⠶⠂', | |
228 | + '‘':'⠐⠶', | |
229 | + '’':'⠶⠂', | |
230 | + '〔':'⠐⠶', | |
231 | + '〕':'⠶⠂', | |
232 | + '〈':'⠐⠶', | |
233 | + '〉':'⠶⠂', | |
234 | + '《':'⠐⠶', | |
235 | + '》':'⠶⠂', | |
236 | + '【':'⠐⠶', | |
237 | + '】':'⠶⠂', | |
238 | + '〝':'⠐⠶', | |
239 | + '〟':'⠶⠂', | |
240 | + '☆':'⠰⠮⠂', | |
241 | + '★':'⠰⠮⠆', | |
242 | + '○':'⠠⠵⠂', | |
243 | + '●':'⠠⠵⠆', | |
244 | + '◎':'⠠⠵⠲', | |
245 | + '□':'⠠⠳⠂', | |
246 | + '■':'⠠⠳⠆', | |
247 | + '△':'⠠⠱⠂', | |
248 | + '▲':'⠠⠱⠆', | |
249 | + '▽':'⠰⠱⠂', | |
250 | + '×':'⠰⠡⠂', | |
251 | + '▼':'⠰⠱⠆', | |
252 | + '◇':'⠨⠧⠂', | |
253 | + '◆':'⠨⠧⠆', | |
254 | + '※':'⠔⠔ ', # 第1星印 35-35 (後ろを1マスあける) | |
255 | + '→':' ⠒⠒⠕ ', # 矢印 前後に1マスあける | |
256 | + '←':' ⠪⠒⠒ ', # 矢印 前後に1マスあける | |
257 | + } | |
258 | +info_symbol_dic = { | |
259 | + ',':'⠂', | |
260 | + '?':'⠐⠦', | |
261 | + '+':'⠬', | |
262 | + "'":'⠄', | |
263 | + '.':'⠲', | |
264 | + '!':'⠖', | |
265 | + '(':'⠦', | |
266 | + ')':'⠴', | |
267 | + '{':'⠣', | |
268 | + '}':'⠜', | |
269 | + '[':'⠷', | |
270 | + ']':'⠾', | |
271 | + '%': '⠻', | |
272 | + '&':'⠯', | |
273 | + '#':'⠩', | |
274 | + '*':'⠡', | |
275 | + } | |
276 | +num_dic = { | |
277 | + '0':'⠚', | |
278 | + '1':'⠁', | |
279 | + '2':'⠃', | |
280 | + '3':'⠉', | |
281 | + '4':'⠙', | |
282 | + '5':'⠑', | |
283 | + '6':'⠋', | |
284 | + '7':'⠛', | |
285 | + '8':'⠓', | |
286 | + '9':'⠊', | |
287 | + } | |
288 | +num_symbol_dic = { | |
289 | + '.':'⠂', | |
290 | + ',':'⠄', | |
291 | + } | |
292 | +alpha_dic = { | |
293 | + 'a':'⠁', | |
294 | + 'b':'⠃', | |
295 | + 'c':'⠉', | |
296 | + 'd':'⠙', | |
297 | + 'e':'⠑', | |
298 | + 'f':'⠋', | |
299 | + 'g':'⠛', | |
300 | + 'h':'⠓', | |
301 | + 'i':'⠊', | |
302 | + 'j':'⠚', | |
303 | + 'k':'⠅', | |
304 | + 'l':'⠇', | |
305 | + 'm':'⠍', | |
306 | + 'n':'⠝', | |
307 | + 'o':'⠕', | |
308 | + 'p':'⠏', | |
309 | + 'q':'⠟', | |
310 | + 'r':'⠗', | |
311 | + 's':'⠎', | |
312 | + 't':'⠞', | |
313 | + 'u':'⠥', | |
314 | + 'v':'⠧', | |
315 | + 'w':'⠺', | |
316 | + 'x':'⠭', | |
317 | + 'y':'⠽', | |
318 | + 'z':'⠵', | |
319 | + } | |
320 | +alpha_cap_dic = { | |
321 | + 'A':'⠁', | |
322 | + 'B':'⠃', | |
323 | + 'C':'⠉', | |
324 | + 'D':'⠙', | |
325 | + 'E':'⠑', | |
326 | + 'F':'⠋', | |
327 | + 'G':'⠛', | |
328 | + 'H':'⠓', | |
329 | + 'I':'⠊', | |
330 | + 'J':'⠚', | |
331 | + 'K':'⠅', | |
332 | + 'L':'⠇', | |
333 | + 'M':'⠍', | |
334 | + 'N':'⠝', | |
335 | + 'O':'⠕', | |
336 | + 'P':'⠏', | |
337 | + 'Q':'⠟', | |
338 | + 'R':'⠗', | |
339 | + 'S':'⠎', | |
340 | + 'T':'⠞', | |
341 | + 'U':'⠥', | |
342 | + 'V':'⠧', | |
343 | + 'W':'⠺', | |
344 | + 'X':'⠭', | |
345 | + 'Y':'⠽', | |
346 | + 'Z':'⠵', | |
347 | + } | |
348 | + | |
349 | +def is_ara(c): | |
350 | + # 数字の後につなぎ符が必要 | |
351 | + return c in 'アイウエオラリルレロ' | |
352 | + | |
353 | +def translateWithInPos(text): | |
354 | + retval = '' | |
355 | + pos = 0 | |
356 | + latin = False # 外字符モード | |
357 | + num = False # 数符モード | |
358 | + capital = False # 二重大文字符モード | |
359 | + quote_mode = False # 外国語引用符モード | |
360 | + info_mode = False # 情報処理点字モード | |
361 | + text = unicodedata.normalize('NFKC', text) | |
362 | + inPos = [] | |
363 | + | |
364 | + while pos < len(text): | |
365 | + #space | |
366 | + if text[pos] == ' ': | |
367 | + retval += ' ' | |
368 | + inPos.append(pos) | |
369 | + capital = latin = num = False | |
370 | + pos += 1 | |
371 | + #Numeric | |
372 | + elif text[pos] in num_dic: | |
373 | + latin = False | |
374 | + if not num: | |
375 | + retval += '⠼' | |
376 | + inPos.append(pos) | |
377 | + num = True | |
378 | + while text[pos] in num_dic: | |
379 | + retval += num_dic[text[pos]] | |
380 | + inPos.extend([pos] * len(num_dic[text[pos]])) | |
381 | + pos += 1 | |
382 | + if pos >= len(text): | |
383 | + break | |
384 | + # info symbol | |
385 | + elif info_mode and text[pos] in info_symbol_dic: | |
386 | + retval += info_symbol_dic[text[pos]] | |
387 | + inPos.extend([pos] * len(info_symbol_dic[text[pos]])) | |
388 | + num = capital = False | |
389 | + pos += 1 | |
390 | + #Numeric symbols | |
391 | + elif num and text[pos] in num_symbol_dic and \ | |
392 | + pos+1 < len(text) and text[pos+1].isdigit(): | |
393 | + retval += num_symbol_dic[text[pos]] | |
394 | + inPos.extend([pos] * len(num_symbol_dic[text[pos]])) | |
395 | + pos += 1 | |
396 | + # halfshape apostrophe symbol | |
397 | + elif text[pos] == "'": | |
398 | + if pos+1 < len(text) and text[pos+1].isdigit(): | |
399 | + retval += '⠼⠄' | |
400 | + inPos.extend([pos, pos]) | |
401 | + num = True | |
402 | + pos += 1 | |
403 | + # slash symbol | |
404 | + elif text[pos] == '/': | |
405 | + retval += '⠌' | |
406 | + inPos.append(pos) | |
407 | + num = capital = False | |
408 | + pos += 1 | |
409 | + #Japanese symbols | |
410 | + elif text[pos] in jp_symbol_dic: | |
411 | + retval += jp_symbol_dic[text[pos]] | |
412 | + inPos.extend([pos] * len(jp_symbol_dic[text[pos]])) | |
413 | + latin = num = False | |
414 | + pos += 1 | |
415 | + # lower/upper case alphabet | |
416 | + elif text[pos] in alpha_dic or text[pos] in alpha_cap_dic: | |
417 | + if not latin and not quote_mode: | |
418 | + retval += '⠰' | |
419 | + inPos.append(pos) | |
420 | + elif info_mode and pos >= 2 and \ | |
421 | + text[pos-2].isdigit() and \ | |
422 | + text[pos-1] == '.' and \ | |
423 | + text[pos] in 'abcdefghij': | |
424 | + # 情報処理で数字、ピリオドのあとにa~jが続くときは小文字フラグ | |
425 | + retval += '⠰' | |
426 | + inPos.append(pos) | |
427 | + latin = True | |
428 | + num = False | |
429 | + # 大文字または小文字が続く範囲の終点を tpos に格納 | |
430 | + tpos = pos | |
431 | + upper_count = lower_count = 0 | |
432 | + while tpos < len(text): | |
433 | + if text[tpos] in alpha_cap_dic: | |
434 | + upper_count += 1 | |
435 | + tpos += 1 | |
436 | + elif text[tpos] in alpha_dic: | |
437 | + lower_count += 1 | |
438 | + tpos += 1 | |
439 | + else: | |
440 | + break | |
441 | + # 大文字だけが2文字以上連続する場合は二重大文字符 | |
442 | + if upper_count > 1 and lower_count == 0: | |
443 | + retval += '⠠⠠' | |
444 | + inPos.extend([pos, pos]) | |
445 | + capital = True | |
446 | + else: | |
447 | + capital = False | |
448 | + # アルファベットの続く部分を変換 | |
449 | + while pos < tpos: | |
450 | + if not capital and text[pos] in alpha_cap_dic: | |
451 | + retval += '⠠' | |
452 | + inPos.append(pos) | |
453 | + retval += alpha_dic[text[pos].lower()] | |
454 | + inPos.append(pos) | |
455 | + pos += 1 | |
456 | + #Two kana characters | |
457 | + elif pos+1 < len(text) and text[pos:pos+2] in kana2_dic: | |
458 | + if latin: | |
459 | + retval += '⠤' | |
460 | + inPos.append(pos - 1) # つなぎ符は直前の文字に対応 | |
461 | + elif num and is_ara(text[pos:pos+1]): | |
462 | + retval += '⠤' | |
463 | + inPos.append(pos - 1) # つなぎ符は直前の文字に対応 | |
464 | + retval += kana2_dic[text[pos:pos+2]] | |
465 | + inPos.extend([pos] * len(kana2_dic[text[pos:pos+2]])) | |
466 | + latin = num = False | |
467 | + pos += 2 | |
468 | + #One kana character | |
469 | + elif text[pos] in kana1_dic: | |
470 | + if latin: | |
471 | + retval += '⠤' | |
472 | + inPos.append(pos - 1) # つなぎ符は直前の文字に対応 | |
473 | + elif num: | |
474 | + if is_ara(text[pos]): | |
475 | + retval += '⠤' | |
476 | + inPos.append(pos - 1) # つなぎ符は直前の文字に対応 | |
477 | + elif text[pos] == 'ワ' and pos+3 < len(text) and \ | |
478 | + is_ara(text[pos+1]) and is_ara(text[pos+2]) and is_ara(text[pos+3]): | |
479 | + retval += '⠤' | |
480 | + inPos.append(pos - 1) # つなぎ符は直前の文字に対応 | |
481 | + retval += kana1_dic[text[pos]] | |
482 | + inPos.extend([pos] * len(kana1_dic[text[pos]])) | |
483 | + latin = num = False | |
484 | + pos += 1 | |
485 | + #Braille should not be changed | |
486 | + elif 0x2800 <= ord(text[pos]) and ord(text[pos]) <= 0x28ff: | |
487 | + latin = False | |
488 | + #数字モード | |
489 | + if text[pos] == '⠼': | |
490 | + num = True | |
491 | + else: | |
492 | + num = False | |
493 | + #外国語引用符モード切替 | |
494 | + if not quote_mode and text[pos] == '⠦': | |
495 | + quote_mode = True | |
496 | + if quote_mode and text[pos] == '⠴': | |
497 | + quote_mode = False | |
498 | + #情報処理モード切替 | |
499 | + if text[pos] == '⠠' and pos+1 < len(text): | |
500 | + if text[pos+1] == '⠦': | |
501 | + info_mode = True | |
502 | + elif text[pos+1] == '⠴': | |
503 | + info_mode = False | |
504 | + | |
505 | + if ord(text[pos]) == 0x2800: | |
506 | + retval += ' ' # use 0x20 | |
507 | + inPos.append(pos) | |
508 | + else: | |
509 | + retval += text[pos] | |
510 | + inPos.append(pos) | |
511 | + pos += 1 | |
512 | + #Exception | |
513 | + else: | |
514 | + latin = num = False | |
515 | + retval += '□' | |
516 | + inPos.append(pos) | |
517 | + pos += 1 | |
518 | + # rstrip with inPos | |
519 | + outbuf = retval | |
520 | + if text[-1] != ' ': | |
521 | + while outbuf[-1:] == ' ': | |
522 | + outbuf = outbuf[:-1] | |
523 | + inPos.pop() | |
524 | + return (outbuf, inPos) |
@@ -0,0 +1,987 @@ | ||
1 | +# coding: UTF-8 | |
2 | +#translator2.py (Japanese Braille translator Phase 2) | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#Copyright (C) 2012-2013 Takuya Nishimoto (NVDA Japanese Team) | |
5 | +#This file is covered by the GNU General Public License. | |
6 | +#See the file COPYING for more details. | |
7 | + | |
8 | +from __future__ import unicode_literals | |
9 | +import os | |
10 | +import copy | |
11 | +from _nvdajp_unicode import unicode_normalize | |
12 | +from mecab import * | |
13 | +import translator1 | |
14 | + | |
15 | +_logwrite = None | |
16 | + | |
17 | +try: | |
18 | + from logHandler import log | |
19 | + _logwrite = log.debug | |
20 | +except: | |
21 | + def __print(s): print s | |
22 | + _logwrite = __print | |
23 | + | |
24 | +CONNECTED_MORPHS = { | |
25 | + 'について': [ | |
26 | + ['に', 'ニ', '0/1', None, None, '*'], | |
27 | + ['ついて', 'ツイテ', '1/3', '動詞', '*', '*'], | |
28 | + ], | |
29 | + 'により': [ | |
30 | + ['に', 'ニ', '0/1', None, None, '*'], | |
31 | + ['より', 'ヨリ', '0/2', '動詞', '*', '*'], | |
32 | + ], | |
33 | + 'による': [ | |
34 | + ['に', 'ニ', '0/1', None, None, '*'], | |
35 | + ['よる', 'ヨル', '0/2', '動詞', '*', '*'], | |
36 | + ], | |
37 | + 'において': [ | |
38 | + ['に', 'ニ', '0/1', None, None, '*'], | |
39 | + ['おいて', 'オイテ', '0/3', '動詞', '*', '*'], | |
40 | + ], | |
41 | + 'における': [ | |
42 | + ['に', 'ニ', '0/1', None, None, '*'], | |
43 | + ['おける', 'オケル', '0/3', '動詞', '*', '*'], | |
44 | + ], | |
45 | + 'によって': [ | |
46 | + ['に', 'ニ', '0/1', None, None, '*'], | |
47 | + ['よって', 'ヨッテ', '0/3', '動詞', '*', '*'], | |
48 | + ], | |
49 | + 'にとって': [ | |
50 | + ['に', 'ニ', '0/1', None, None, '*'], | |
51 | + ['とって', 'トッテ', '0/3', '動詞', '*', '*'], | |
52 | + ], | |
53 | + 'に対して': [ | |
54 | + ['に', 'ニ', '0/1', None, None, '*'], | |
55 | + ['対して', 'タイシテ', '1/4', '動詞', '*', '*'], | |
56 | + ], | |
57 | + 'に関して': [ | |
58 | + ['に', 'ニ', '0/1', None, None, '*'], | |
59 | + ['関して', 'カンシテ', '1/4', '動詞', '*', '*'], | |
60 | + ], | |
61 | + 'につき': [ | |
62 | + ['に', 'ニ', '0/1', None, None, '*'], | |
63 | + ['つき', 'ツキ', '1/2', '動詞', '*', '*'], | |
64 | + ], | |
65 | + 'という': [ | |
66 | + ['と', 'ト', '0/1', None, None, '*'], | |
67 | + ['いう', 'イウ', '0/2', '動詞', '*', '*'], | |
68 | + ], | |
69 | + 'どうして': [ | |
70 | + ['どう', 'ドー', '0/2', None, None, '*'], | |
71 | + ['して', 'シテ', '0/2', '動詞', '*', '*'], | |
72 | + ], | |
73 | + 'として': [ | |
74 | + ['と', 'ト', '1/1', None, None, '*'], | |
75 | + ['して', 'シテ', '0/2', '動詞', '*', '*'], | |
76 | + ], | |
77 | + 'なくなる': [ | |
78 | + ['なく', 'ナク', '2/2', None, None, None], | |
79 | + ['なる', 'ナル', '1/2', '動詞', '自立', None], | |
80 | + ], | |
81 | +} | |
82 | + | |
83 | +class MecabMorph(object): | |
84 | + __slots__ = ('hyouki', 'nhyouki', 'hinshi1', 'hinshi2', 'hinshi3', 'hinshi4', | |
85 | + 'type1', 'type2', 'kihon', | |
86 | + 'kana', 'yomi', 'accent', 'output', 'sepflag') | |
87 | + | |
88 | + def __init__(self): | |
89 | + self.hyouki = '' # 表記 | |
90 | + self.nhyouki = '' # Unicode 正規化された表記 | |
91 | + self.hinshi1 = '' | |
92 | + self.hinshi2 = '' | |
93 | + self.hinshi3 = '' | |
94 | + self.hinshi4 = '' | |
95 | + self.type1 = '' | |
96 | + self.type2 = '' | |
97 | + self.kihon = '' | |
98 | + self.kana = '' | |
99 | + self.yomi = '' | |
100 | + self.accent = '' | |
101 | + self.output = '' | |
102 | + self.sepflag = False # この後でマスアケをするか? | |
103 | + | |
104 | + # 付属語 | |
105 | + def is_substantive_word(self): | |
106 | + if self.hinshi1 == '記号': return False | |
107 | + if self.hinshi2 == '接頭': return True | |
108 | + if self.hinshi2 == '接尾': return True | |
109 | + if self.hinshi1 == '助動詞' and self.hyouki == 'ない': return False | |
110 | + if self.hinshi1 == '名詞' and self.hyouki == 'の': return True | |
111 | + if self.hinshi1 == '形容詞' and self.hyouki == 'なく': return True | |
112 | + if self.hinshi1 in ('助動詞', '助詞'): return True | |
113 | + return False | |
114 | + | |
115 | + # 自立語 | |
116 | + def is_independent_word(self): | |
117 | + if self.hinshi1 == '記号': return False | |
118 | + return not self.is_substantive_word() | |
119 | + | |
120 | + def write(self, logwrite): | |
121 | + logwrite("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d" % | |
122 | + (self.hyouki, self.nhyouki, | |
123 | + self.hinshi1, self.hinshi2, self.hinshi3, self.hinshi4, | |
124 | + self.type1, self.type2, self.kihon, | |
125 | + self.kana, self.yomi, self.accent, self.output, self.sepflag)) | |
126 | + | |
127 | +def update_phonetic_symbols(mo): | |
128 | + for p in range(0, len(mo.yomi)): | |
129 | + # 点訳のてびき第3版 第2章 その1 1 5 | |
130 | + # 5、長音の書き表し方 (1), (2) | |
131 | + # before: ああ,ああ,感動詞,*,*,*,アア,アー,1/2,アー,0 | |
132 | + # after: ああ,ああ,感動詞,*,*,*,アア,アー,1/2,アア,0 | |
133 | + if mo.yomi[p] == 'ー' and mo.kana[p] in 'アイエ': | |
134 | + mo.output = mo.output[:p] + mo.kana[p] + mo.output[p+1:] | |
135 | + | |
136 | + # 点訳のてびき第3版 第2章 その1 1 6 | |
137 | + # 6、「ジ ズ ジャ ジュ ジョ」と「ヂ ヅ ヂャ ヂョ」の使い分け | |
138 | + # before: 綴る,綴る,動詞,自立,*,*,ツヅル,ツズル,0/3,ツズル,0 | |
139 | + # after: 綴る,綴る,動詞,自立,*,*,ツヅル,ツズル,0/3,ツヅル,0 | |
140 | + if (mo.yomi[p] == 'ジ' and mo.kana[p] == 'ヂ') or ( | |
141 | + mo.yomi[p] == 'ズ' and mo.kana[p] == 'ヅ'): | |
142 | + mo.output = mo.output[:p] + mo.kana[p] + mo.output[p+1:] | |
143 | + | |
144 | +def mecab_to_morphs(mf): | |
145 | + li = [] | |
146 | + if mf is None or mf.feature is None or mf.size is None: | |
147 | + return li | |
148 | + for i in xrange(0, mf.size): | |
149 | + s = string_at(mf.feature[i]) | |
150 | + if s: | |
151 | + s = s.decode(CODE, 'ignore') | |
152 | + ar = s.split(",") | |
153 | + mo = MecabMorph() | |
154 | + mo.hyouki = ar[0] | |
155 | + mo.nhyouki = unicode_normalize(ar[0]) | |
156 | + mo.hinshi1 = ar[1] | |
157 | + mo.hinshi2 = ar[2] | |
158 | + if len(ar) > 3: | |
159 | + mo.hinshi3 = ar[3] | |
160 | + mo.hinshi4 = ar[4] | |
161 | + if len(ar) > 5: | |
162 | + mo.type1 = ar[5] | |
163 | + if len(ar) > 6: | |
164 | + mo.type2 = ar[6] | |
165 | + if len(ar) > 7: | |
166 | + mo.kihon = ar[7] | |
167 | + if len(ar) > 9: | |
168 | + mo.kana = ar[8] | |
169 | + mo.yomi = ar[9] | |
170 | + mo.accent = ar[10] | |
171 | + if len(ar) > 12: | |
172 | + # Mecab辞書の拡張フィールドの点訳表記があれば使用する | |
173 | + mo.output = ar[12] | |
174 | + else: | |
175 | + mo.output = ar[9] | |
176 | + update_phonetic_symbols(mo) | |
177 | + mo.sepflag = False | |
178 | + li.append(mo) | |
179 | + return li | |
180 | + | |
181 | +def replace_morphs(li, dic): | |
182 | + new_li = [] | |
183 | + for mo in li: | |
184 | + if mo.hyouki in dic.keys(): | |
185 | + new_morphs = dic[mo.hyouki] | |
186 | + for i in new_morphs: | |
187 | + m = copy.deepcopy(mo) | |
188 | + m.hyouki = m.nhyouki = i[0] # に | |
189 | + if i[3]: m.hinshi1 = i[3] | |
190 | + if i[4]: m.hinshi2 = i[4] | |
191 | + if i[5]: m.hinshi3 = i[5] | |
192 | + m.output = m.kana = m.yomi = i[1] # ニ | |
193 | + m.accent = i[2] # 0/1 | |
194 | + new_li.append(m) | |
195 | + else: | |
196 | + new_li.append(mo) | |
197 | + return new_li | |
198 | + | |
199 | +RE_KANSUJI = re.compile('^[一二三四五六七八九〇零十拾百千壱二参]+$') | |
200 | + | |
201 | +# http://programminblog.blogspot.jp/2010/11/python.html | |
202 | +def kansuji2arabic(text): | |
203 | + if not RE_KANSUJI.match(text): | |
204 | + return None | |
205 | + result = 0 | |
206 | + digit = 1 | |
207 | + numgroup = 1 | |
208 | + kanindex = len(text) | |
209 | + while kanindex > 0: | |
210 | + c = text[(kanindex - 1):kanindex] | |
211 | + c1 = text[kanindex:(kanindex + 1)] | |
212 | + kanindex -= 1 | |
213 | + if c in '〇零': | |
214 | + digit *= 10 | |
215 | + elif c in '十拾': | |
216 | + digit = 10 | |
217 | + elif c == '百': | |
218 | + if digit == 10 and c1 and c1 in '十拾': | |
219 | + result += digit * numgroup | |
220 | + digit = 100 | |
221 | + elif c == '千': | |
222 | + if (digit == 10 and c1 and c1 in '十拾') or \ | |
223 | + (digit == 100 and c1 and c1 in '百'): | |
224 | + result += digit * numgroup | |
225 | + digit = 1000 | |
226 | + else: | |
227 | + if c in '壱一': | |
228 | + result += digit * numgroup | |
229 | + elif c in '二弐': | |
230 | + result += 2 * digit * numgroup | |
231 | + elif c in '三参': | |
232 | + result += 3 * digit * numgroup | |
233 | + elif c in '四': | |
234 | + result += 4 * digit * numgroup | |
235 | + elif c in '五': | |
236 | + result += 5 * digit * numgroup | |
237 | + elif c in '六': | |
238 | + result += 6 * digit * numgroup | |
239 | + elif c in '七': | |
240 | + result += 7 * digit * numgroup | |
241 | + elif c in '八': | |
242 | + result += 8 * digit * numgroup | |
243 | + elif c in '九': | |
244 | + result += 9 * digit * numgroup | |
245 | + digit *= 10 | |
246 | + if (digit == 10 and text[:1] in '十拾') or \ | |
247 | + (digit == 100 and text[:1] in '百') or \ | |
248 | + (digit == 1000 and text[:1] in '千'): | |
249 | + result += digit * numgroup | |
250 | + text = '%d' % result | |
251 | + return text | |
252 | + | |
253 | +def rewrite_number(li): | |
254 | + new_li = [] | |
255 | + for mo in li: | |
256 | + m = copy.deepcopy(mo) | |
257 | + if m.hinshi2 != '固有名詞': | |
258 | + ret = kansuji2arabic(m.hyouki) | |
259 | + if ret: | |
260 | + m.output = ret | |
261 | + new_li.append(m) | |
262 | + return new_li | |
263 | + | |
264 | +def concatinate_morphs(li): | |
265 | + mo = copy.deepcopy(li[0]) | |
266 | + s = '' | |
267 | + y = '' | |
268 | + for i in li: | |
269 | + s += i.hyouki | |
270 | + y += i.yomi | |
271 | + mo.hyouki = mo.nhyouki = s | |
272 | + mo.yomi = mo.kana = mo.output = y | |
273 | + return mo | |
274 | + | |
275 | +def replace_digit_morphs(li): | |
276 | + # handle digit number kanji characters | |
277 | + # input: | |
278 | + # 十,名詞,数 | |
279 | + # 七,名詞,数 | |
280 | + # output: | |
281 | + # 十七,名詞,数 | |
282 | + # input: | |
283 | + # 二,名詞,数 | |
284 | + # 十,名詞,数 | |
285 | + # 五,名詞,数 | |
286 | + # output: | |
287 | + # 二十五,名詞,数 | |
288 | + # input: | |
289 | + # 三,名詞,数,*,*,*,*,三,サン,サン,0/2,C3 | |
290 | + # 兆,名詞,数,*,*,*,*,兆,チョウ,チョー,1/2,C3 | |
291 | + # 二,名詞,数,*,*,*,*,二,ニ,ニ,1/1,C3 | |
292 | + # 千,名詞,数,*,*,*,*,千,セン,セン,1/2,C3 | |
293 | + # 四,名詞,数,*,*,*,*,四,ヨン,ヨン,1/2,C1 | |
294 | + # 百,名詞,数,*,*,*,*,百,ヒャク,ヒャク,2/2,C3 | |
295 | + # 万,名詞,数,*,*,*,*,万,マン,マン,1/2,C3 | |
296 | + # output: | |
297 | + # 三,三,名詞,数,*,*,サン,サン,,サン,0 | |
298 | + # 兆,兆,名詞,数,*,*,チョー,チョー,,チョー,0 | |
299 | + # 二千四百,二千四百,名詞,数,*,*,ニセンヨンヒャク,ニセンヨンヒャク,,ニセンヨンヒャク,0 | |
300 | + # 万,万,名詞,数,*,*,マン,マン,,マン,0 | |
301 | + # (correct: 3チョー 2400マン) | |
302 | + new_li = [] | |
303 | + num_morphs = [] | |
304 | + for mo in li: | |
305 | + if mo.hinshi2 == '数' and mo.hyouki == ',': | |
306 | + # カンマ | |
307 | + m = copy.deepcopy(mo) | |
308 | + m.yomi = m.output = ',' | |
309 | + num_morphs.append(m) | |
310 | + elif mo.hinshi2 == '数' and not mo.output.isdigit() and \ | |
311 | + not mo.hyouki in ('・', '万', '億', '兆', '京', '.'): | |
312 | + # 漢数字の結合 | |
313 | + num_morphs.append(mo) | |
314 | + elif mo.hinshi2 == '数' and mo.hyouki in '0123456789': | |
315 | + # 算用数字の結合 | |
316 | + m = copy.deepcopy(mo) | |
317 | + y = unicode_normalize(m.hyouki) | |
318 | + m.output = m.hyouki = m.nhyouki = m.yomi = y | |
319 | + num_morphs.append(m) | |
320 | + else: | |
321 | + if num_morphs: | |
322 | + new_li.append(concatinate_morphs(num_morphs)) | |
323 | + num_morphs = [] | |
324 | + new_li.append(mo) | |
325 | + if num_morphs: | |
326 | + new_li.append(concatinate_morphs(num_morphs)) | |
327 | + return new_li | |
328 | + | |
329 | +RE_ALPHA = re.compile('^[A-Za-z]+$') | |
330 | + | |
331 | +def is_alpha(s): | |
332 | + return RE_ALPHA.match(s) | |
333 | + | |
334 | +RE_ASCII_SYMBOLS = re.compile('^[\,\.\:\;\!\?\@\#\\\$\%\&\*\|\+\-\/\=\<\>\"\'\^\`\_\~]+$') | |
335 | + | |
336 | +def replace_alphabet_morphs(li): | |
337 | + # アルファベットまたは記号だけで表記されている語を結合する | |
338 | + # 情報処理点字の部分文字列になる記号を前後にまとめる | |
339 | + # input: | |
340 | + # B,B,記号,アルファベット,*,*,ビー,ビー,1/2,B | |
341 | + # asi,asi,名詞,一般,*,*,アシー,アシー,0/3,asi | |
342 | + # c,c,記号,アルファベット,*,*,シー,シー,1/2,c | |
343 | + # output: | |
344 | + # Basic,Basic,名詞,アルファベット,*,*,ビーアシーシー,ビーアシーシー,1/2,Basic | |
345 | + new_li = [] | |
346 | + alp_morphs = [] | |
347 | + for pos in range(len(li)): | |
348 | + mo = li[pos] | |
349 | + if pos < len(li) - 1: | |
350 | + next_mo = li[pos + 1] | |
351 | + else: | |
352 | + next_mo = None | |
353 | + if is_alpha(mo.nhyouki): | |
354 | + alp_morphs.append(mo) | |
355 | + elif mo.nhyouki in r',+@/#$%&*;<': | |
356 | + alp_morphs.append(mo) | |
357 | + elif mo.nhyouki == '\\': | |
358 | + alp_morphs.append(mo) | |
359 | + elif mo.nhyouki[0] in r',+@/#$%&*;' and \ | |
360 | + RE_ASCII_SYMBOLS.match(mo.nhyouki): | |
361 | + alp_morphs.append(mo) | |
362 | + elif alp_morphs and mo.nhyouki in ',.' and \ | |
363 | + ((next_mo and next_mo.nhyouki == ' ') or \ | |
364 | + (next_mo and next_mo.hinshi1 in ('助詞', '助動詞')) or \ | |
365 | + (not next_mo)): | |
366 | + alp_morphs.append(mo) | |
367 | + elif alp_morphs and mo.nhyouki == ' ' and \ | |
368 | + next_mo and is_alpha(next_mo.nhyouki): | |
369 | + alp_morphs.append(mo) | |
370 | + elif alp_morphs and mo.nhyouki.isdigit(): | |
371 | + alp_morphs.append(mo) | |
372 | + elif alp_morphs and mo.nhyouki in ',.:;!?@#\\$%&*|+-/=<>"\'^`_~{}[]': | |
373 | + alp_morphs.append(mo) | |
374 | + else: | |
375 | + if alp_morphs: | |
376 | + m = concatinate_morphs(alp_morphs) | |
377 | + m.hinshi1 = '名詞' | |
378 | + m.hinshi2 = 'アルファベット' | |
379 | + m.nhyouki = m.output = unicode_normalize(m.nhyouki) | |
380 | + new_li.append(m) | |
381 | + alp_morphs = [] | |
382 | + new_li.append(mo) | |
383 | + if alp_morphs: | |
384 | + m = concatinate_morphs(alp_morphs) | |
385 | + m.hinshi1 = '名詞' | |
386 | + m.hinshi2 = 'アルファベット' | |
387 | + m.nhyouki = m.output = unicode_normalize(m.nhyouki) | |
388 | + new_li.append(m) | |
389 | + return new_li | |
390 | + | |
391 | +# 日付の和語読み処理 | |
392 | +# すでに output 属性に半角数字が格納されている前提 | |
393 | + | |
394 | +# 後続する '日' と形態素を結合する | |
395 | +WAGO_DIC = { | |
396 | + '1': 'ツイタチ', | |
397 | + '2': 'フツカ', | |
398 | + '3': 'ミッカ', | |
399 | + '4': 'ヨッカ', | |
400 | + '5': 'イツカ', | |
401 | + '6': 'ムイカ', | |
402 | + '7': 'ナノカ', | |
403 | + '8': 'ヨーカ', | |
404 | + '9': 'ココノカ', | |
405 | + '10': 'トオカ', | |
406 | + '20': 'ハツカ', | |
407 | +} | |
408 | + | |
409 | +def fix_japanese_date_morphs(li): | |
410 | + new_li = [] | |
411 | + for i in xrange(0, len(li)): | |
412 | + prev_mo = li[i-1] if i-1>=0 else None | |
413 | + mo = li[i] | |
414 | + if mo.hyouki == '日' and mo.hinshi3 == '助数詞' and prev_mo is not None: | |
415 | + if prev_mo.hyouki in ('14', '24', '十四', '一四', '二四', '二十四'): | |
416 | + li[i].output = 'カ' | |
417 | + new_li.append(li[i]) | |
418 | + elif prev_mo.output in WAGO_DIC: | |
419 | + m = copy.deepcopy(mo) | |
420 | + m.output = WAGO_DIC[prev_mo.output] | |
421 | + m.hyouki = m.nhyouki = m.kana = m.yomi = m.output | |
422 | + m.hinshi2 = '日付' | |
423 | + m.hinshi3 = '*' | |
424 | + # FIXME: m.accent | |
425 | + new_li.pop() | |
426 | + new_li.append(m) | |
427 | + else: | |
428 | + new_li.append(li[i]) | |
429 | + else: | |
430 | + new_li.append(li[i]) | |
431 | + return new_li | |
432 | + | |
433 | +def should_separate(prev2_mo, prev_mo, mo, next_mo): | |
434 | + if mo.hyouki == 'ー': return False | |
435 | + if prev_mo.hyouki == 'ー': return False | |
436 | + if mo.hyouki in 'ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ': return False | |
437 | + | |
438 | + # )( -> あける | |
439 | + # )陽が -> あける | |
440 | + # '02 -> あけない | |
441 | + if prev_mo.hinshi2 == '括弧閉' and prev_mo.nhyouki != "’": | |
442 | + if mo.hinshi2 == '括弧開': return True | |
443 | + if mo.hinshi1 == '名詞': return True | |
444 | + | |
445 | + # 東京/都 千代田/区 | |
446 | + if prev_mo.hinshi2 == '接尾' and prev_mo.hinshi3 == '地域' and \ | |
447 | + mo.hinshi2 == '固有名詞' and mo.hinshi3 == '地域': | |
448 | + return True | |
449 | + # 東京/都 交通/局 | |
450 | + if prev_mo.hinshi2 == '接尾' and prev_mo.hinshi3 == '地域' and \ | |
451 | + mo.hinshi1 == '名詞' and mo.hinshi2 == '一般': | |
452 | + return True | |
453 | + # 永田町 1 | |
454 | + if prev_mo.hinshi2 == '固有名詞' and prev_mo.hinshi3 == '地域' and \ | |
455 | + mo.hinshi2 == '数': | |
456 | + return True | |
457 | + | |
458 | + # 晴れ/所に より | |
459 | + if prev_mo.hinshi1 == '名詞' and mo.hyouki == '所により': | |
460 | + return True | |
461 | + | |
462 | + # 一時/雨 | |
463 | + if prev_mo.hyouki == '一時' and mo.hyouki == '雨': | |
464 | + return True | |
465 | + | |
466 | + # 数字の前のマスアケ | |
467 | + if prev_mo.nhyouki in ('零下', '西暦', 'ボーイング', 'ベスト', 'ルイ', '先', '振替', 'No.', '一人当り') \ | |
468 | + and mo.output.isdigit(): | |
469 | + return True | |
470 | + | |
471 | + # 1月/1日 | |
472 | + if prev_mo.nhyouki[0].isdigit() and prev_mo.nhyouki[-1] == '月' and mo.output.isdigit(): | |
473 | + return True | |
474 | + # 0/4月 -> 04月 | |
475 | + if prev_mo.output.isdigit() and mo.nhyouki[0].isdigit(): | |
476 | + return False | |
477 | + | |
478 | + # アラビア数字のあとに単位がきたら続ける | |
479 | + # 三十,三十,名詞,数,*,*,30,30,1/4,30,1 | |
480 | + # センチメートル,センチメートル,名詞,一般,*,*,センチメートル,センチメートル,4/7,センチメートル,0 | |
481 | + if prev_mo.output.isdigit(): | |
482 | + if mo.hinshi3 == '助数詞': return False | |
483 | + if mo.hyouki == 'センチメートル': return False | |
484 | + if mo.nhyouki == '#': return False | |
485 | + | |
486 | + # 数% | |
487 | + if prev_mo.hyouki == '数' and prev_mo.yomi == 'スー' and mo.hyouki == '%': | |
488 | + return False | |
489 | + | |
490 | + # 三,三,名詞,数,*,*,サン,サン,0/2,3,0 | |
491 | + # 兆,兆,名詞,数,*,*,チョウ,チョー,1/2,チョー,1 | |
492 | + # 二千四百,二千四百,名詞,数,*,*,ニセンヨンヒャク,ニセンヨンヒャク,1/1,2400,0 | |
493 | + # 万,万,名詞,数,*,*,マン,マン,1/2,マン,0 | |
494 | + if prev_mo.hyouki in ('億', '兆', '京') and mo.output.isdigit(): | |
495 | + return True | |
496 | + | |
497 | + # ち,ち,名詞,一般,*,*,チ,チ,0/1,チ,0 | |
498 | + # ゅうりっぷ,ゅうりっぷ,名詞,一般,*,*,,,,ュウリップ,0 | |
499 | + if mo.hyouki[0] in 'ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ': return False | |
500 | + | |
501 | + # 外国語引用符、マスアケ、助詞、助動詞 | |
502 | + if prev_mo.output and prev_mo.output.endswith('⠴') and mo.hinshi1 in ('助詞', '助動詞'): return True | |
503 | + | |
504 | + if prev_mo.hinshi1 == '名詞' and prev_mo.hinshi2 == '接尾': | |
505 | + # 助数詞のあとにアラビア数字が来たらマスアケ | |
506 | + # case 1: | |
507 | + # 零,零,名詞,数,*,*,0,0,1/2,0,0 | |
508 | + # 時,時,名詞,接尾,助数詞,*,ジ,ジ,1/1,ジ,1 | |
509 | + # 十五,十五,名詞,数,*,*,15,15,1/3,15,0 | |
510 | + # 分,分,名詞,接尾,助数詞,*,フン,フン,1/2,フン,0 | |
511 | + # case 2: | |
512 | + # 一,一,名詞,数,*,*,イチ,イチ,2/2,1,0 | |
513 | + # 人,人,名詞,接尾,助数詞,*,ニン,ニン,1/2,ニン,0 | |
514 | + # 当り,当り,名詞,接尾,一般,*,アタリ,アタリ,1/3,アタリ,1 | |
515 | + # 1,1,名詞,数,*,*,イチ,イチ,2/2,1,0 | |
516 | + # 0,0,名詞,数,*,*,ゼロ,ゼロ,1/2,0,0 | |
517 | + # 個,個,名詞,接尾,助数詞,*,コ,コ,1/1,コ,0 | |
518 | + if mo.output.isdigit(): return True | |
519 | + if mo.hinshi1 == '動詞' and mo.hinshi2 == '非自立': return False | |
520 | + | |
521 | + # アルファベットの後の助詞、助動詞 | |
522 | + # CD,CD,名詞,一般,*,*,シーディー,シーディー,3/4,シーディー,0 | |
523 | + # を,を,助詞,格助詞,一般,*,ヲ,ヲ,0/1,ヲ,0 | |
524 | + if is_alpha(prev_mo.nhyouki) and mo.hinshi1 in ('助詞', '助動詞'): | |
525 | + return True | |
526 | + | |
527 | + # ピリオドの後の助詞 | |
528 | + if prev_mo.nhyouki.endswith('.') and mo.hinshi1 == '助詞': | |
529 | + return True | |
530 | + | |
531 | + # ナンバーマークの後の助詞 | |
532 | + if prev_mo.nhyouki == '#' and mo.hinshi1 == '助詞': | |
533 | + return True | |
534 | + | |
535 | + # カナ名詞の後のアルファベット名詞 | |
536 | + if prev_mo.hinshi1 == '名詞' and is_alpha(mo.nhyouki): | |
537 | + return False | |
538 | + | |
539 | + # (あける) | |
540 | + # 映画,映画,名詞,一般,*,*,エイガ,エイガ,0/3,エイガ,1 | |
541 | + # 「,「,記号,括弧開,*,*,「,「,*/*,「,0 | |
542 | + # (あけない) | |
543 | + # 機関,名詞,一般,*,*,*,*,機関,キカン,キカン,1/3,C1 | |
544 | + # (,記号,括弧開,*,*,*,*,(,(,(,*/*,* | |
545 | + if prev_mo.hinshi1 == '名詞' and mo.hinshi2 == '括弧開' and mo.nhyouki != '(': return True | |
546 | + | |
547 | + # 間違い,間違い,名詞,ナイ形容詞語幹,*,*,マチガイ,マチガイ,3/4,マチガイ,1 | |
548 | + # なし,なし,助動詞,*,*,*,ナシ,ナシ,0/2,ナシ,0 | |
549 | + # | |
550 | + # 味気,味気,名詞,ナイ形容詞語幹,*,*,アジケ,アジケ,0/3,アジケ,0 | |
551 | + # ない,ない,助動詞,*,*,*,ナイ,ナイ,1/2,ナイ,0 | |
552 | + # | |
553 | + # 良く,形容詞,自立,*,*,形容詞・アウオ段,連用テ接続,良い,ヨク,ヨク,1/2,C3 | |
554 | + # ない,助動詞,*,*,*,特殊・ナイ,基本形,ない,ナイ,ナイ,1/2,動詞%F3@0/形容詞%F2@1 | |
555 | + # | |
556 | + # で,で,助動詞,*,*,*,デ,デ,1/1,デ,0 | |
557 | + # は,は,助詞,係助詞,*,*,ハ,ワ,0/1,ワ,1 | |
558 | + # なく,なく,助動詞,*,*,*,ナク,ナク,0/2,ナク,1 | |
559 | + # | |
560 | + # 「問題ない」の「ない」は「点訳のてびき」では形容詞だがMecabでは助動詞 | |
561 | + if mo.hinshi1 == '形容詞' and mo.kihon in ('ない', '無い'): | |
562 | + # 形容詞「ない」は区切る | |
563 | + # ただし前の語と複合している場合は前に続ける | |
564 | + if prev_mo.kihon in ('隈', '心置き', '満遍'): | |
565 | + return False | |
566 | + return True | |
567 | + if mo.hinshi1 == '助動詞' and mo.kihon in ('ない', '無い'): | |
568 | + if prev_mo.hinshi1 == '助詞' and prev_mo.kihon == 'は': | |
569 | + return True | |
570 | + if prev_mo.hinshi1 == '形容詞' and prev_mo.kihon == '良い': | |
571 | + return True | |
572 | + if prev_mo.hinshi1 == '名詞' and prev_mo.hinshi2 == 'ナイ形容詞語幹' and \ | |
573 | + prev_mo.kihon in ('問題', '間違い'): | |
574 | + return True | |
575 | + if prev_mo.hinshi2 == '副助詞': # じゃない | |
576 | + return True | |
577 | + if prev_mo.hinshi1 == '動詞' and prev_mo.hinshi2 == '非自立' and \ | |
578 | + prev_mo.kihon in ('てる'): # てない | |
579 | + return True | |
580 | + if prev_mo.hinshi1 == '助動詞' and \ | |
581 | + prev_mo.kihon in ('だ'): # でない | |
582 | + return True | |
583 | + return False | |
584 | + | |
585 | + # お,黙り,なさい | |
586 | + # 「お」がついて名詞化した語に「なさい・なさる」が続く場合は区切ってよい | |
587 | + if prev2_mo and prev2_mo.hinshi1 == '接頭詞' and prev2_mo.hyouki == 'お' and \ | |
588 | + prev_mo.hinshi1 == '動詞' and prev_mo.type2 == '連用形' and \ | |
589 | + mo.kihon == 'なさる': | |
590 | + return True | |
591 | + | |
592 | + # 労,せ,ず | |
593 | + if prev_mo.hinshi1 == '名詞' and mo.hyouki == 'せ' and mo.kihon == 'する': | |
594 | + return False | |
595 | + | |
596 | + # 不幸,に,し,て | |
597 | + # 今,に,し,て | |
598 | + # 居,ながら,に,し,て | |
599 | + # 労,せ,ず,し,て | |
600 | + # 若く,し,て | |
601 | + # 私,を,し,て | |
602 | + # 「して」が文語的表現の助詞である場合は前に続けて書く | |
603 | + if mo.hyouki == 'し' and mo.kihon == 'する': | |
604 | + if prev_mo.hyouki == 'ず' and prev_mo.hinshi1 == '助動詞': | |
605 | + return False | |
606 | + if prev_mo.hinshi1 == '形容詞' and prev_mo.type2 == '連用テ接続': | |
607 | + return False | |
608 | + if prev_mo.hinshi2 == '接続助詞': | |
609 | + return False | |
610 | + if prev_mo.type1 == '文語・ベシ': | |
611 | + return False | |
612 | + if next_mo and next_mo.hyouki == 'て': | |
613 | + if prev_mo.hyouki == 'に' and prev_mo.hinshi1 == '助詞': | |
614 | + return False | |
615 | + if prev2_mo and prev2_mo.hyouki == '私' and prev_mo.hyouki == 'を': | |
616 | + return False | |
617 | + | |
618 | + # 「・・ですこと」の「こと」は接尾語なので前に続ける | |
619 | + if prev_mo.hyouki == 'です' and mo.hyouki == 'こと': | |
620 | + return False | |
621 | + | |
622 | + # 「この程」「この度」 | |
623 | + # 「そのくせ」 | |
624 | + # 後ろの語と結びついて1語になっている場合は続ける | |
625 | + if prev_mo.hyouki == 'この' and mo.hyouki in ('程', '度'): | |
626 | + return False | |
627 | + if prev_mo.hyouki == 'その' and mo.hyouki in ('くせ', 'うち', 'まま'): | |
628 | + return False | |
629 | + if prev_mo.hyouki == 'わが' and mo.hyouki == 'まま': | |
630 | + return False | |
631 | + | |
632 | + if prev_mo.hinshi1 == '名詞' and mo.hinshi1 == '名詞': | |
633 | + if mo.hinshi2 == '数': return False | |
634 | + # 人名 | |
635 | + if prev_mo.hinshi4 in ('姓', '名') and mo.hinshi2 == '接尾' and mo.hinshi3 == '人名': return True | |
636 | + # 複合名詞内部の2拍以下は切らない | |
637 | + if not prev_mo.hinshi2 in ('数', 'アルファベット') and not mo.hinshi2 in ('数', 'アルファベット'): | |
638 | + if len(prev_mo.yomi) <= 2 and len(mo.yomi) >= 3: return False | |
639 | + if len(prev_mo.yomi) >= 3 and len(mo.yomi) <= 2: return False | |
640 | + if mo.hinshi2 != '接尾': return True | |
641 | + | |
642 | + if prev_mo.hinshi1 == '形容詞' and mo.hyouki == 'ん': return False # いいんですけど | |
643 | + | |
644 | + if prev_mo.hinshi1 == '動詞' and prev_mo.hyouki == '見': return False # 見/まごう | |
645 | + if prev_mo.hinshi1 == '動詞' and prev_mo.hinshi2 == '自立': | |
646 | + if mo.hyouki == 'および': return True | |
647 | + if mo.hinshi1 == '動詞' and mo.hinshi2 == '非自立': return False | |
648 | + | |
649 | + # その,その,連体詞,*,*,*,ソノ,ソノ,0/2,ソノ,1 | |
650 | + # よう,よう,名詞,非自立,助動詞語幹,*,ヨウ,ヨー,1/2,ヨー,0 | |
651 | + if prev_mo.hinshi1 == '連体詞' and mo.hinshi3 == '助動詞語幹': return False | |
652 | + | |
653 | + if prev_mo.hinshi1 == '接頭詞' and prev_mo.hyouki == '超' and mo.hinshi1 == '名詞': return True | |
654 | + | |
655 | + # お兄さん, お姉さん | |
656 | + if prev_mo.hinshi1 == '接頭詞' and prev_mo.hyouki == 'お': return False | |
657 | + # 新/東京/名所 | |
658 | + if prev_mo.hinshi1 == '接頭詞' and prev_mo.hinshi2 == '名詞接続' and \ | |
659 | + mo.hinshi1 == '名詞' and mo.hinshi2 == '固有名詞': | |
660 | + return True | |
661 | + if prev_mo.hinshi1 == '接頭詞' and mo.hinshi1 == '名詞': return False | |
662 | + | |
663 | + if prev_mo.hinshi1 == '助動詞' and prev_mo.hyouki == 'で' and mo.hinshi1 == '助動詞': return True | |
664 | + | |
665 | + if prev_mo.hinshi1 == '助詞' and mo.hyouki == 'よう': return False # のように | |
666 | + if prev_mo.hinshi1 == '助詞' and mo.hinshi1 == '接頭詞': return True | |
667 | + | |
668 | + if prev_mo.is_substantive_word() and mo.is_independent_word(): return True | |
669 | + if prev_mo.is_independent_word() and mo.is_independent_word(): return True | |
670 | + return False | |
671 | + | |
672 | +def morphs_to_string(li, inbuf, logwrite): | |
673 | + outbuf = '' | |
674 | + inpos2 = [] | |
675 | + p = 0 | |
676 | + for i in range(0, len(li)): | |
677 | + if not li[i].output: | |
678 | + continue | |
679 | + out = li[i].output | |
680 | + outlen = len(out) | |
681 | + outbuf += out | |
682 | + hyolen = len(li[i].hyouki) | |
683 | + if hyolen == outlen: | |
684 | + inpos2.extend(range(p, p + outlen)) | |
685 | + elif out[:2] == '⠠⠦' and out[-2:] == '⠠⠴': | |
686 | + # 情報処理用点字の内側 | |
687 | + c = outlen - 4 | |
688 | + inpos2.extend([p] * 2) | |
689 | + inpos2.extend(range(p, p + c)) | |
690 | + inpos2.extend([p + c - 1] * 2) | |
691 | + elif out[:1] == '⠦' and out[-1:] == '⠴': | |
692 | + # 外国語引用符の内側 | |
693 | + c = outlen - 2 | |
694 | + inpos2.extend([p]) | |
695 | + inpos2.extend(range(p, p + c)) | |
696 | + inpos2.extend([p + c - 1]) | |
697 | + else: | |
698 | + # 表記と出力の文字数が変化する場合 | |
699 | + for x in range(outlen): | |
700 | + inpos2.append(p + int(float(x) * hyolen / outlen)) | |
701 | + p += hyolen | |
702 | + if li[i].sepflag: | |
703 | + outbuf += ' ' | |
704 | + if p > 0: | |
705 | + inpos2.append(p - 1) # マスアケは直前の文字に対応 | |
706 | + else: | |
707 | + inpos2.append(p) | |
708 | + # rstrip with inpos2 | |
709 | + if inbuf[-1] != ' ': | |
710 | + while outbuf[-1:] == ' ': | |
711 | + outbuf = outbuf[:-1] | |
712 | + inpos2.pop() | |
713 | + return (outbuf, inpos2) | |
714 | + | |
715 | +RE_MB_ALPHA_NUM_SPACE = re.compile('^[0-9A-Za-z 0-9A-Za-z ]+$') | |
716 | +RE_ASCII_CHARS = re.compile('^[A-Za-z0-9\.\,\-\+\:\/\~\?\&\%\#\*\$\; ]+$') | |
717 | +RE_INFOMATION = re.compile('^[A-Za-z0-9\+\@\/\#\$\%\&\*\;\.\<\>\-\_\{\}\[\] ]+$') | |
718 | +RE_GAIJI = re.compile('^[A-Za-z][A-Za-z0-9\,\.\+\- ]+$') | |
719 | +RE_KATAKANA = re.compile('^[ァ-ヾ]+$') | |
720 | +RE_HIRAGANA = re.compile('^[ぁ-ゞ]+$') | |
721 | + | |
722 | +def japanese_braille_separate(inbuf, logwrite): | |
723 | + text = inbuf | |
724 | + if RE_MB_ALPHA_NUM_SPACE.match(text): | |
725 | + outbuf = unicode_normalize(text) | |
726 | + inpos2 = range(len(outbuf)) | |
727 | + return (outbuf, inpos2) | |
728 | + | |
729 | + # 'あ゛ー' Unicode 正規化されて空白が入るので事前に補正する | |
730 | + text = text.replace('あ゛', 'あ') | |
731 | + text = text.replace('ヱ゛', 'ヴェ') | |
732 | + text = text.replace('ヲ゛', 'ヴォ') | |
733 | + text = text.replace('ワ゛', 'ヴァ') | |
734 | + | |
735 | + # 'ふにゃ~' | |
736 | + text = text.replace('ゃ~', 'ゃー') | |
737 | + | |
738 | + text = Mecab_text2mecab(text) | |
739 | + mf = MecabFeatures() | |
740 | + Mecab_analysis(text, mf) | |
741 | + Mecab_correctFeatures(mf) | |
742 | + Mecab_print(mf, logwrite, output_header = False) | |
743 | + li = mecab_to_morphs(mf) | |
744 | + mf = None | |
745 | + | |
746 | + for mo in li: | |
747 | + if mo.hinshi1 == '空白': | |
748 | + mo.output = ' ' | |
749 | + elif mo.hinshi2 == '数' and mo.nhyouki.isdigit(): | |
750 | + # digit numbers (not kanji characters) | |
751 | + mo.output = mo.nhyouki | |
752 | + | |
753 | + li = replace_morphs(li, CONNECTED_MORPHS) | |
754 | + li = replace_digit_morphs(li) | |
755 | + li = rewrite_number(li) | |
756 | + | |
757 | + # before: う,う,助動詞,*,*,*,ウ,ウ,0/1,ウ,0 | |
758 | + # after: う,う,助動詞,*,*,*,ウ,ウ,0/1,ー,0 | |
759 | + for mo in li: | |
760 | + if mo.hyouki == 'う' and mo.hinshi1 == '助動詞': | |
761 | + mo.output = 'ー' | |
762 | + | |
763 | + # before: a,a,記号,アルファベット,*,*,エイ,エイ,1/2,エイ,0 | |
764 | + # after: a,a,記号,アルファベット,*,*,エイ,エイ,1/2,a,0 | |
765 | + for mo in li: | |
766 | + if mo.hinshi2 == 'アルファベット': | |
767 | + mo.output = mo.nhyouki | |
768 | + | |
769 | + li = replace_alphabet_morphs(li) | |
770 | + | |
771 | + for mo in li: | |
772 | + if mo.hyouki == '〝': | |
773 | + mo.hinshi1 = '記号' | |
774 | + mo.hinshi2 = '括弧開' | |
775 | + if mo.hyouki == '〟': | |
776 | + mo.hinshi1 = '記号' | |
777 | + mo.hinshi2 = '括弧閉' | |
778 | + | |
779 | + for mo in li: | |
780 | + if mo.hinshi2 in ('括弧開', '括弧閉'): | |
781 | + mo.output = mo.nhyouki | |
782 | + | |
783 | + # before: , ,記号,空白,*,*, , ,*/*, ,0 | |
784 | + # after: , ,記号,空白,*,*, , ,*/*, ,0 | |
785 | + for mo in li: | |
786 | + if mo.hyouki == ' ': # full shape space | |
787 | + mo.output = ' ' | |
788 | + | |
789 | + # 数字の前の全角アポストロフィを半角にする | |
790 | + # before: | |
791 | + # ’,’,記号,括弧閉,*,*,’,’,*/*,’,0 | |
792 | + # 0,0,名詞,数,*,*,ゼロ,ゼロ,1/2,0,0 | |
793 | + # after: | |
794 | + # ’,’,記号,括弧閉,*,*,’,’,*/*,',0 | |
795 | + # 0,0,名詞,数,*,*,ゼロ,ゼロ,1/2,0,0 | |
796 | + for pos in range(0, len(li) - 1): | |
797 | + if li[pos].hyouki == '’' and li[pos+1].hinshi2 == '数': | |
798 | + li[pos].output = "'" | |
799 | + | |
800 | + # 算用数字ではさまれた読点と中点を数符にする | |
801 | + # before: | |
802 | + # 二,二,名詞,数,*,*,2,2,1/2,2,0 | |
803 | + # 、,、,記号,読点,*,*,、,、,*/*,、,0 | |
804 | + # 三,三,名詞,数,*,*,3,3,1/2,3,0 | |
805 | + # after: | |
806 | + # 二,二,名詞,数,*,*,2,2,1/2,2,0 | |
807 | + # 、,、,記号,読点,*,*,、,、,*/*,⠼,0 | |
808 | + # 三,三,名詞,数,*,*,3,3,1/2,3,0 | |
809 | + for pos in range(1, len(li) - 1): | |
810 | + if li[pos-1].output.isdigit() and \ | |
811 | + li[pos].hyouki in ('、', '・') and \ | |
812 | + li[pos+1].output.isdigit(): | |
813 | + li[pos].output = '⠼' | |
814 | + | |
815 | + # 記号を Unicode 正規化 | |
816 | + for mo in li: | |
817 | + if mo.hinshi1 == '記号' and mo.hinshi2 == '一般': | |
818 | + mo.output = mo.nhyouki | |
819 | + if mo.hyouki == '.' and mo.hinshi1 == '名詞' and mo.hinshi2 == '数': | |
820 | + mo.output = '.' | |
821 | + if mo.hyouki == ',' and mo.hinshi1 == '名詞' and mo.hinshi2 == '数': | |
822 | + mo.output = ',' | |
823 | + if mo.hinshi1 == '記号' and mo.hinshi2 == '句点' and mo.nhyouki == '.': | |
824 | + mo.output = '.' | |
825 | + if mo.hinshi1 == '記号' and mo.hinshi2 == '読点' and mo.nhyouki == ',': | |
826 | + mo.output = ',' | |
827 | + | |
828 | + # before: ab,ab,名詞,一般,*,*,アブ,アブ,1/2,アブ,0 | |
829 | + # after: ab,ab,名詞,一般,*,*,アブ,アブ,1/2,ab,0 | |
830 | + # before: No.,No.,接頭詞,数接続,*,*,ナンバー,ナンバー,1/4,ナンバー,0 | |
831 | + # after: No.,No.,接頭詞,数接続,*,*,ナンバー,ナンバー,1/4,No.,0 | |
832 | + for mo in li: | |
833 | + if RE_ASCII_CHARS.match(mo.nhyouki): | |
834 | + mo.output = mo.nhyouki | |
835 | + | |
836 | + # before: ヒロイノ,ヒロイノ,名詞,一般,*,*,,,,,0 | |
837 | + # after: ヒロイノ,ヒロイノ,名詞,一般,*,*,,,,ヒロイノ,0 | |
838 | + # before: ィ,ィ,名詞,一般,*,*,,,,,0 | |
839 | + # after: ィ,ィ,名詞,一般,*,*,,,,ィ,0 | |
840 | + # before: ぁ,ぁ,名詞,一般,*,*,,,,,0 | |
841 | + # after: ぁ,ぁ,名詞,一般,*,*,,,,ァ,0 | |
842 | + for mo in li: | |
843 | + if not mo.output and mo.nhyouki != 'ー': | |
844 | + if RE_KATAKANA.match(mo.nhyouki): | |
845 | + mo.output = mo.nhyouki | |
846 | + elif RE_HIRAGANA.match(mo.nhyouki): | |
847 | + mo.output = ''.join([unichr(ord(c) + 0x60) for c in mo.nhyouki]) | |
848 | + | |
849 | + # 単語が小文字カタカナのみであれば修正 | |
850 | + # 表記は修正せず should_separate() で小文字として判定される | |
851 | + for mo in li: | |
852 | + if mo.output == 'ァ': mo.output = 'ア' | |
853 | + if mo.output == 'ィ': mo.output = 'イ' | |
854 | + if mo.output == 'ゥ': mo.output = 'ウ' | |
855 | + if mo.output == 'ェ': mo.output = 'エ' | |
856 | + if mo.output == 'ォ': mo.output = 'オ' | |
857 | + if mo.output == 'ッ': mo.output = 'ツ' | |
858 | + if mo.output == 'ャ': mo.output = 'ヤ' | |
859 | + if mo.output == 'ュ': mo.output = 'ユ' | |
860 | + if mo.output == 'ョ': mo.output = 'ヨ' | |
861 | + if mo.output == 'ヮ': mo.output = 'ワ' | |
862 | + if mo.output == 'ヵ': mo.output = 'カ' | |
863 | + if mo.output == 'ヶ': mo.output = 'ケ' | |
864 | + | |
865 | + for mo in li: | |
866 | + # 情報処理点字の開始記号と終了記号 | |
867 | + if RE_INFOMATION.match(mo.nhyouki) and \ | |
868 | + ('@' in mo.nhyouki) or ('://' in mo.nhyouki) or ('\\' in mo.nhyouki): | |
869 | + mo.output = '⠠⠦' + mo.nhyouki + '⠠⠴' | |
870 | + # 外国語引用符 | |
871 | + # 空白をはさまない1単語は外国語引用符ではなく外字符で | |
872 | + elif RE_GAIJI.match(mo.nhyouki) and \ | |
873 | + (' ' in mo.nhyouki) or ('.' in mo.nhyouki and len(mo.nhyouki) > 3): | |
874 | + mo.output = '⠦' + mo.nhyouki + '⠴' | |
875 | + | |
876 | + for mo in li: | |
877 | + # 情報処理点字でも外国語引用符でもなく output が & を含む場合は前後をあける | |
878 | + if not mo.output.startswith('⠠⠦') and not mo.output.startswith('⠦'): | |
879 | + # & | |
880 | + if mo.output == '&': | |
881 | + continue | |
882 | + # &xx | |
883 | + elif mo.output.startswith('&'): | |
884 | + mo.output = mo.output.replace('&', '& ') | |
885 | + # xx& | |
886 | + elif mo.output.endswith('&'): | |
887 | + mo.output = mo.output.replace('&', ' &') | |
888 | + # xx&xx | |
889 | + else: | |
890 | + mo.output = mo.output.replace('&', ' & ') | |
891 | + | |
892 | + # 日付の和語読み処理 | |
893 | + li = fix_japanese_date_morphs(li) | |
894 | + | |
895 | + # 分かち書き判定 | |
896 | + for i in xrange(1, len(li)): | |
897 | + prev2_mo = li[i-2] if i-2 >= 0 else None | |
898 | + prev_mo = li[i-1] | |
899 | + next_mo = li[i+1] if i+1 < len(li) else None | |
900 | + li[i-1].sepflag = should_separate(prev2_mo, prev_mo, li[i], next_mo) | |
901 | + | |
902 | + for mo in li: | |
903 | + mo.write(logwrite) | |
904 | + logwrite('') | |
905 | + | |
906 | + outbuf, inpos2 = morphs_to_string(li, inbuf, logwrite) | |
907 | + return (outbuf, inpos2) | |
908 | + | |
909 | +mecab_initialized = False | |
910 | + | |
911 | +def initialize(jtalk_dir=None, logwrite=_logwrite): | |
912 | + global mecab_initialized | |
913 | + if jtalk_dir: | |
914 | + Mecab_initialize(logwrite, jtalk_dir) | |
915 | + else: | |
916 | + Mecab_initialize(logwrite) | |
917 | + if logwrite: logwrite("initialize() done.") | |
918 | + mecab_initialized = True | |
919 | + | |
920 | +def terminate(): | |
921 | + global _logwrite | |
922 | + if _logwrite: _logwrite("terminate() done.") | |
923 | + global mecab_initialized | |
924 | + mecab_initialized = False | |
925 | + | |
926 | +def translateWithInPos2(inbuf, logwrite=_logwrite): | |
927 | + if not mecab_initialized: | |
928 | + initialize() | |
929 | + outbuf, inpos2 = japanese_braille_separate(inbuf, logwrite) | |
930 | + result, inpos1 = translator1.translateWithInPos(outbuf) | |
931 | + result = result.replace('□', ' ') | |
932 | + return (outbuf, result, inpos1, inpos2) | |
933 | + | |
934 | +# for brailleViewer | |
935 | +def getReadingAndBraille(text, logwrite=_logwrite): | |
936 | + return translateWithInPos2(text, logwrite=logwrite)[0:2] | |
937 | + | |
938 | +# returns '\u2801\u2802\u2803\u2804\u2805\u2806\u2807' | |
939 | +def japaneseToUnicodeBraille(text, logwrite=_logwrite): | |
940 | + return translateWithInPos2(text, logwrite=logwrite)[0] | |
941 | + | |
942 | +def makeOutPos(inPos, inlen, outlen): | |
943 | + # make outPos | |
944 | + outPos = [-1] * inlen | |
945 | + for p in range(outlen): | |
946 | + if inPos[p] < len(outPos) and (outPos[ inPos[p] ] == -1 or inPos[p] == 0): | |
947 | + outPos[ inPos[p] ] = p | |
948 | + # fill skipped outPos | |
949 | + prev = 0 | |
950 | + for p in range(inlen): | |
951 | + if outPos[p] == -1: | |
952 | + outPos[p] = prev | |
953 | + else: | |
954 | + prev = outPos[p] | |
955 | + return outPos | |
956 | + | |
957 | +def mergePositionMap(inpos1, inpos2, outlen, inlen): | |
958 | + inPos = [0] * outlen | |
959 | + for p in range(outlen): | |
960 | + inPos[p] = inpos2[ inpos1[p] ] | |
961 | + outPos = makeOutPos(inPos, inlen, outlen) | |
962 | + return inPos, outPos | |
963 | + | |
964 | +# louis-compatible method | |
965 | +# tableList, typeform are not supported. | |
966 | +# mode=dotsIO is default. | |
967 | +def translate(inbuf, cursorPos=0, logwrite=_logwrite, unicodeIO=False): | |
968 | + """Translate a string of characters, providing position information. | |
969 | + @param inbuf: The string to translate. | |
970 | + @type inbuf: str | |
971 | + @param cursorPos: The position of the cursor in inbuf. | |
972 | + @type cursorPos: int | |
973 | + @return: A tuple of: | |
974 | + the translated string, | |
975 | + a list of input positions for each position in the output, | |
976 | + a list of output positions for each position in the input, and | |
977 | + the position of the cursor in the output. | |
978 | + @rtype: (str, list of int, list of int, int) | |
979 | + @raise RuntimeError: If a complete translation could not be done. | |
980 | + """ | |
981 | + sp, outbuf, inpos1, inpos2 = translateWithInPos2(inbuf, logwrite=logwrite) | |
982 | + if not unicodeIO: | |
983 | + pat = outbuf.replace(' ', '\u2800') | |
984 | + outbuf = ''.join([unichr((ord(c) - 0x2800) + 0x8000) for c in pat]) | |
985 | + inPos, outPos = mergePositionMap(inpos1, inpos2, len(outbuf), len(inbuf)) | |
986 | + cursorPos = outPos[cursorPos] | |
987 | + return (outbuf, inPos, outPos, cursorPos) |
@@ -0,0 +1,157 @@ | ||
1 | +#synthDrivers/nvdajp_jtalk.py | |
2 | +# -*- coding: utf-8 -*- | |
3 | +#A part of NonVisual Desktop Access (NVDA) | |
4 | +#Copyright (C) 2006-2010 NVDA Contributors <http://www.nvda-project.org/> | |
5 | +#This file is covered by the GNU General Public License. | |
6 | +#See the file COPYING for more details. | |
7 | +# | |
8 | +# nvdajp_jtalk (based on Open JTalk and libopenjtalk) | |
9 | +# Copyright (C) 2010-2011 Takuya Nishimoto (nishimotz.com) | |
10 | +# Copyright (C) 2013 Masamitsu Misono (043.jp) | |
11 | + | |
12 | +from synthDriverHandler import SynthDriver,VoiceInfo,BooleanSynthSetting | |
13 | +from collections import OrderedDict | |
14 | +from logHandler import log | |
15 | +import speech | |
16 | +import synthDriverHandler | |
17 | +import languageHandler | |
18 | +from jtalk import _nvdajp_jtalk | |
19 | +from jtalk._nvdajp_jtalk import VoiceProperty | |
20 | + | |
21 | +class SynthDriver(SynthDriver): | |
22 | + """A Japanese synth driver for NVDAjp. | |
23 | + """ | |
24 | + name = "nvdajp_jtalk" | |
25 | + description = "JTalk" | |
26 | + supportedSettings=( | |
27 | + SynthDriver.VoiceSetting(), | |
28 | + SynthDriver.RateSetting(), | |
29 | + BooleanSynthSetting("rateBoost",_("Rate boos&t")), | |
30 | + SynthDriver.PitchSetting(), | |
31 | + SynthDriver.InflectionSetting(), | |
32 | + SynthDriver.VolumeSetting() | |
33 | + ) | |
34 | + | |
35 | + @classmethod | |
36 | + def check(cls): | |
37 | + return True | |
38 | + | |
39 | + def __init__(self): | |
40 | + self.voice_id = 'V2' | |
41 | + self._volume = 100 | |
42 | + self._pitch = 50 | |
43 | + self._inflection = 50 | |
44 | + self._rateBoost = False | |
45 | + _nvdajp_jtalk.initialize() | |
46 | + self.rate = 50 | |
47 | + | |
48 | + def speak(self,speechSequence): | |
49 | + finalIndex = None | |
50 | + spellState = False | |
51 | + defaultLanguage = languageHandler.getLanguage() | |
52 | + if defaultLanguage[:2] == 'ja': defaultLanguage = 'ja' | |
53 | + lang = defaultLanguage | |
54 | + currentLang = lang | |
55 | + for item in speechSequence: | |
56 | + if isinstance(item,basestring): | |
57 | + p = VoiceProperty() | |
58 | + p.pitch = self._pitch | |
59 | + p.inflection = self._inflection | |
60 | + p.characterMode = spellState | |
61 | + _nvdajp_jtalk.speak(unicode(item), currentLang, index=finalIndex, voiceProperty_=p) | |
62 | + elif isinstance(item,speech.IndexCommand): | |
63 | + finalIndex = item.index | |
64 | + elif isinstance(item,speech.CharacterModeCommand): | |
65 | + if item.state: | |
66 | + spellState = True | |
67 | + else: | |
68 | + spellState = True | |
69 | + elif isinstance(item,speech.LangChangeCommand): | |
70 | + lang = (item.lang if item.lang else defaultLanguage).replace('_','-') | |
71 | + if lang[:2] == 'ja': lang = 'ja' | |
72 | + currentLang = lang | |
73 | + elif isinstance(item,speech.SpeechCommand): | |
74 | + log.debugWarning("Unsupported speech command: %s"%item) | |
75 | + else: | |
76 | + log.error("Unknown speech: %s"%item) | |
77 | + | |
78 | + def cancel(self): | |
79 | + _nvdajp_jtalk.stop() | |
80 | + | |
81 | + def pause(self,switch): | |
82 | + _nvdajp_jtalk.pause(switch) | |
83 | + | |
84 | + def isSpeaking(self): | |
85 | + return _nvdajp_jtalk.isSpeaking() | |
86 | + | |
87 | + def _get_rateBoost(self): | |
88 | + return self._rateBoost | |
89 | + | |
90 | + def _set_rateBoost(self, enable): | |
91 | + if enable == self._rateBoost: | |
92 | + return | |
93 | + rate = self.rate | |
94 | + self._rateBoost = enable | |
95 | + self.rate = rate | |
96 | + | |
97 | + def terminate(self): | |
98 | + _nvdajp_jtalk.terminate() | |
99 | + | |
100 | + # The current rate; ranges between 0 and 100 | |
101 | + def _get_rate(self): | |
102 | + return _nvdajp_jtalk.get_rate(self._rateBoost) | |
103 | + | |
104 | + def _set_rate(self,rate): | |
105 | + _nvdajp_jtalk.set_rate(int(rate), self._rateBoost) | |
106 | + | |
107 | + def _get_pitch(self): | |
108 | + return self._pitch | |
109 | + | |
110 | + def _set_pitch(self,pitch): | |
111 | + self._pitch = int(pitch) | |
112 | + | |
113 | + def _get_volume(self): | |
114 | + return self._volume | |
115 | + | |
116 | + def _set_volume(self,volume_): | |
117 | + self._volume = int(volume_) | |
118 | + _nvdajp_jtalk.set_volume(self._volume) | |
119 | + return | |
120 | + | |
121 | + def _get_inflection(self): | |
122 | + return self._inflection | |
123 | + | |
124 | + def _set_inflection(self,val): | |
125 | + self._inflection = int(val) | |
126 | + | |
127 | + def _getAvailableVoices(self): | |
128 | + log.debug("_getAvailableVoices called") | |
129 | + voices = OrderedDict() | |
130 | + for v in _nvdajp_jtalk._jtalk_voices: | |
131 | + voices[v['id']] = VoiceInfo(v['id'], v['name'], v['lang']) | |
132 | + return voices | |
133 | + | |
134 | + def _get_voice(self): | |
135 | + log.debug("_get_voice called") | |
136 | + return self.voice_id | |
137 | + | |
138 | + def _set_voice(self, identifier): | |
139 | + log.debug("_set_voice %s" % (identifier)) | |
140 | + rate = _nvdajp_jtalk.get_rate(self._rateBoost) | |
141 | + for v in _nvdajp_jtalk._jtalk_voices: | |
142 | + if v['id'] == identifier: | |
143 | + if self.voice_id != identifier: | |
144 | + self.voice_id = identifier | |
145 | + _nvdajp_jtalk.terminate() | |
146 | + _nvdajp_jtalk.initialize(v) | |
147 | + _nvdajp_jtalk.set_rate(rate,self._rateBoost) | |
148 | + _nvdajp_jtalk.set_volume(self._volume) | |
149 | + return | |
150 | + return | |
151 | + | |
152 | + def _get_lastIndex(self): | |
153 | + if _nvdajp_jtalk.lastIndex is None: | |
154 | + #log.debug("_get_lastIndex returns None") | |
155 | + return None | |
156 | + #log.debug("_get_lastIndex returns %d" % _nvdajp_jtalk.lastIndex) | |
157 | + return _nvdajp_jtalk.lastIndex |