)\r
sys.path.append(jtalk_dir)\r
from harness import tests\r
+from nabccHarness import tests as nabcc_tests\r
+tests.extend(nabcc_tests)\r
import translator1\r
import translator2\r
import jtalkDir\r
dic_dir = os.path.join(jtalk_dir, 'dic')\r
user_dics = jtalkDir.user_dics\r
\r
+\r
def __write(file, s=""):\r
file.write(s.encode('utf-8', 'ignore'))\r
\r
with open(outfile, 'w') as f:\r
count = 0\r
for t in tests:\r
+ if t.has_key('mode') and t['mode'] == 'NABCC':\r
+ continue\r
if t.has_key('output'):\r
result, inpos1 = translator1.translateWithInPos(t['input'])\r
if t.has_key('inpos1'):\r
__writeln(f, u"- 点字: " + t['output'].replace(' ', u'□'))\r
if t.has_key('output'):\r
__writeln(f, u"- ドット番号: " + dot_numbers(t['output']))\r
+ if t.has_key('mode'):\r
+ __writeln(f, u"- モード: " + t['mode'])\r
if t.has_key('comment'):\r
__writeln(f, u"- コメント: " + t['comment'])\r
__writeln(f, u"-")\r
--- /dev/null
+# -*- coding: utf-8 -*-
+#jptools/harness.py
+#A part of NonVisual Desktop Access (NVDA)
+#This file is covered by the GNU General Public License.
+#See the file COPYING for more details.
+#Copyright (C) 2014 Takuya Nishimoto
+#
+# For output field, blank should be 0x20 (not 0x2800).
+# output の空白は 0x2800 ではなく 0x20 を使います
+
+from __future__ import unicode_literals
+
+tests = [
+ { 'note': '+ 日本語点字とNABCCの併用モード +' },
+ {
+ 'mode': 'NABCC',
+ 'input': 'abcdefghijklmnopqrstuvwxyz',
+ 'output': '⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞⠥⠧⠺⠭⠽⠵',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': '1234567890',
+ 'output': '⠂⠆⠒⠲⠢⠖⠶⠦⠔⠴',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ 'output': '⡁⡃⡉⡙⡑⡋⡛⡓⡊⡚⡅⡇⡍⡝⡕⡏⡟⡗⡎⡞⡥⡧⡺⡭⡽⡵',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': ',;:.!"',
+ 'output': '⠠⠰⠱⠨⠮⠐',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': "'()-",
+ 'output': '⠄⠷⠾⠤',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': '_<=>%+~`',
+ 'output': '⠸⠣⠿⠜⠩⠬⠘⠈',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': '&$?{[}]',
+ 'output': '⠯⠫⠹⠪⡪⠻⡻',
+ },
+ {
+ 'mode': 'NABCC',
+ 'input': '^@#\\|/*',
+ 'output': '⡘⡈⠼⡳⠳⠌⠡',
+ },
+ ]