From cad0ab4a9f79cfa2b70052dbfaeadacfe15228a3 Mon Sep 17 00:00:00 2001 From: Takuya Nishimoto Date: Sun, 30 Mar 2014 22:56:24 -0700 Subject: [PATCH] added nabcc test cases from nvdajp-ti31182 --- jptools/jpBrailleRunner.py | 7 ++++++ jptools/nabccHarness.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 jptools/nabccHarness.py diff --git a/jptools/jpBrailleRunner.py b/jptools/jpBrailleRunner.py index ed80364..77be5db 100644 --- a/jptools/jpBrailleRunner.py +++ b/jptools/jpBrailleRunner.py @@ -20,12 +20,15 @@ jtalk_dir = os.path.normpath( ) sys.path.append(jtalk_dir) from harness import tests +from nabccHarness import tests as nabcc_tests +tests.extend(nabcc_tests) import translator1 import translator2 import jtalkDir dic_dir = os.path.join(jtalk_dir, 'dic') user_dics = jtalkDir.user_dics + def __write(file, s=""): file.write(s.encode('utf-8', 'ignore')) @@ -63,6 +66,8 @@ def pass1(): with open(outfile, 'w') as f: count = 0 for t in tests: + if t.has_key('mode') and t['mode'] == 'NABCC': + continue if t.has_key('output'): result, inpos1 = translator1.translateWithInPos(t['input']) if t.has_key('inpos1'): @@ -199,6 +204,8 @@ NVDA 日本語版 点訳テストケース """ + timestamp + u""" __writeln(f, u"- 点字: " + t['output'].replace(' ', u'□')) if t.has_key('output'): __writeln(f, u"- ドット番号: " + dot_numbers(t['output'])) + if t.has_key('mode'): + __writeln(f, u"- モード: " + t['mode']) if t.has_key('comment'): __writeln(f, u"- コメント: " + t['comment']) __writeln(f, u"-") diff --git a/jptools/nabccHarness.py b/jptools/nabccHarness.py new file mode 100644 index 0000000..f8b0f47 --- /dev/null +++ b/jptools/nabccHarness.py @@ -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': '⡘⡈⠼⡳⠳⠌⠡', + }, + ] -- 2.11.0