1 # jtalkPredicTest.py
\r
2 # -*- coding: utf-8 -*-
\r
4 from __future__ import unicode_literals, print_function
\r
7 sys.path.append(r'..\source\synthDrivers\jtalk')
\r
8 from _jtalk_core import *
\r
9 from _nvdajp_unicode import unicode_normalize
\r
10 import _nvdajp_predic
\r
17 ['0123345', ' ゼロ イチ ニー サン サン ヨン ゴー '],
\r
27 ['2 分前更新', '2分マエコーシン'],
\r
29 ['10MB', '10メガバイト'],
\r
30 ['1.2MB', '1.2メガバイト'],
\r
31 ['0.5MB', '0.5メガバイト'],
\r
32 ['321.1MB', '321.1メガバイト'],
\r
33 ['123.45MB', '123.45メガバイト'],
\r
34 ['2.7GB', '2.7ギガバイト'],
\r
35 ['10KB', '10キロバイト'],
\r
37 ['10 MB', '10メガバイト'],
\r
38 ['1.2 MB', '1.2メガバイト'],
\r
39 ['0.5 MB', '0.5メガバイト'],
\r
40 ['321.0 MB', '321.0メガバイト'],
\r
41 ['123.45 MB', '123.45メガバイト'],
\r
42 ['2.7 GB', '2.7ギガバイト'],
\r
43 ['10 KB', '10キロバイト'],
\r
44 ['12.01 KB', '12.01キロバイト'],
\r
47 ['01234', ' ゼロ イチ ニー サン ヨン '],
\r
50 ['2011.03.11', '2011テン ゼロ サン テン11'],
\r
51 ['2011.11.11', '2011テン11テン11'],
\r
52 ['7.0.1', '7テン0テン1'],
\r
53 ['7.0.10', '7テン0テン10'],
\r
54 ['1.2.3', '1テン2テン3'],
\r
55 ['7.01.45', '7テン ゼロ イチ テン45'],
\r
56 ['7.1.45', '7テン1テン45'],
\r
57 ['7.01.01', '7テン ゼロ イチ テン ゼロ イチ '],
\r
58 ['7.1.01', '7テン1テン ゼロ イチ '],
\r
59 ['0.0.0.1', '0テン0テン0テン1'],
\r
60 ['1,234円', '1234円'],
\r
62 ['134,554', '134554'],
\r
63 ['2013年2月10日', '2013年2月10日'],
\r
64 ['2013年2月10日', '2013年2月10日'], # remove U+200E LEFT-TO-RIGHT MARK
\r
65 ['2013年2月10日、23:45:19', '2013年2月10日、23:45:19'], # remove U+200E U+200F
\r
69 print(s.encode('utf-8', 'ignore'))
\r
71 if __name__ == '__main__':
\r
72 _nvdajp_predic.setup()
\r
75 msg = unicode_normalize(msg)
\r
76 s = _nvdajp_predic.convert(msg)
\r
78 _print('expected:%s result:%s' % (item[1], s))
\r