OSDN Git Service

ti31182 work in progress
authorTakuya Nishimoto <nishimotz@gmail.com>
Mon, 9 Jun 2014 05:27:55 +0000 (14:27 +0900)
committerTakuya Nishimoto <nishimotz@gmail.com>
Mon, 9 Jun 2014 05:27:55 +0000 (14:27 +0900)
source/synthDrivers/jtalk/translator2.py

index 02499bf..0b58ba6 100644 (file)
@@ -1032,12 +1032,12 @@ def translateWithInPos2(inbuf, logwrite=_logwrite, nabcc=False):
        return (outbuf, result, inpos1, inpos2)\r
 \r
 # for brailleViewer\r
-def getReadingAndBraille(text, logwrite=_logwrite):\r
-       return translateWithInPos2(text, logwrite=logwrite)[0:2]\r
+def getReadingAndBraille(text, logwrite=_logwrite, nabcc=False):\r
+       return translateWithInPos2(text, logwrite=logwrite, nabcc=nabcc)[0:2]\r
 \r
 # returns '\u2801\u2802\u2803\u2804\u2805\u2806\u2807'\r
-def japaneseToUnicodeBraille(text, logwrite=_logwrite):\r
-       return translateWithInPos2(text, logwrite=logwrite)[0]\r
+def japaneseToUnicodeBraille(text, logwrite=_logwrite, nabcc=False):\r
+       return translateWithInPos2(text, logwrite=logwrite, nabcc=nabcc)[0]\r
 \r
 def makeOutPos(inPos, inlen, outlen):\r
        # make outPos\r
@@ -1064,7 +1064,7 @@ def mergePositionMap(inpos1, inpos2, outlen, inlen):
 # louis-compatible method\r
 # tableList, typeform are not supported.\r
 # mode=dotsIO is default.\r
-def translate(inbuf, cursorPos=0, logwrite=_logwrite, unicodeIO=False):\r
+def translate(inbuf, cursorPos=0, logwrite=_logwrite, unicodeIO=False, nabcc=False):\r
        """Translate a string of characters, providing position information.\r
        @param inbuf: The string to translate.\r
        @type inbuf: str\r
@@ -1078,7 +1078,7 @@ def translate(inbuf, cursorPos=0, logwrite=_logwrite, unicodeIO=False):
        @rtype: (str, list of int, list of int, int)\r
        @raise RuntimeError: If a complete translation could not be done.\r
        """\r
-       sp, outbuf, inpos1, inpos2 = translateWithInPos2(inbuf, logwrite=logwrite)\r
+       sp, outbuf, inpos1, inpos2 = translateWithInPos2(inbuf, logwrite=logwrite, nabcc=nabcc)\r
        if not unicodeIO:\r
                pat = outbuf.replace(' ', '\u2800')\r
                outbuf = ''.join([unichr((ord(c) - 0x2800) + 0x8000) for c in pat])\r