OSDN Git Service

added nabcc test cases from nvdajp-ti31182
authorTakuya Nishimoto <nishimotz@gmail.com>
Mon, 31 Mar 2014 05:56:24 +0000 (22:56 -0700)
committerTakuya Nishimoto <nishimotz@gmail.com>
Mon, 31 Mar 2014 05:56:24 +0000 (22:56 -0700)
jptools/jpBrailleRunner.py
jptools/nabccHarness.py [new file with mode: 0644]

index ed80364..77be5db 100644 (file)
@@ -20,12 +20,15 @@ jtalk_dir = os.path.normpath(
        )\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
@@ -63,6 +66,8 @@ def pass1():
        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
@@ -199,6 +204,8 @@ NVDA 日本語版 点訳テストケース """ + timestamp + u"""
                                __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
diff --git a/jptools/nabccHarness.py b/jptools/nabccHarness.py
new file mode 100644 (file)
index 0000000..f8b0f47
--- /dev/null
@@ -0,0 +1,55 @@
+# -*- 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': '⡘⡈⠼⡳⠳⠌⠡',
+               },
+       ]