• R/O
  • HTTP
  • SSH
  • HTTPS

nvdajpmiscdep: コミット

miscdep for NVDA Japanese


コミットメタ情報

リビジョン759830bf8152a4d71dd6cc6a0497e07fc4ed9dd0 (tree)
日時2014-01-05 10:00:06
作者Takuya Nishimoto <nishimotz@gmai...>
コミッターTakuya Nishimoto

ログメッセージ

fixed help message. use xrange rather than range.

変更サマリ

差分

--- a/jptools/jpBrailleRunner.py
+++ b/jptools/jpBrailleRunner.py
@@ -215,7 +215,7 @@ if __name__ == '__main__':
215215 action="store_true",
216216 dest="verbose",
217217 default="False",
218- help="pass2 only timeit")
218+ help="pass2 with verbose mode")
219219 parser.add_option("-m", "--makedoc",
220220 action="store_true",
221221 dest="make_doc",
--- a/source/synthDrivers/jtalk/translator2.py
+++ b/source/synthDrivers/jtalk/translator2.py
@@ -125,7 +125,7 @@ class MecabMorph(object):
125125 self.kana, self.yomi, self.accent, self.output, self.sepflag))
126126
127127 def update_phonetic_symbols(mo):
128- for p in range(0, len(mo.yomi)):
128+ for p in xrange(0, len(mo.yomi)):
129129 # 点訳のてびき第3版 第2章 その1 1 5
130130 # 5、長音の書き表し方 (1), (2)
131131 # before: ああ,ああ,感動詞,*,*,*,アア,アー,1/2,アー,0
@@ -344,7 +344,7 @@ def replace_alphabet_morphs(li):
344344 # Basic,Basic,名詞,アルファベット,*,*,ビーアシーシー,ビーアシーシー,1/2,Basic
345345 new_li = []
346346 alp_morphs = []
347- for pos in range(len(li)):
347+ for pos in xrange(len(li)):
348348 mo = li[pos]
349349 if pos < len(li) - 1:
350350 next_mo = li[pos + 1]
@@ -673,7 +673,7 @@ def morphs_to_string(li, inbuf, logwrite):
673673 outbuf = ''
674674 inpos2 = []
675675 p = 0
676- for i in range(0, len(li)):
676+ for i in xrange(0, len(li)):
677677 if not li[i].output:
678678 continue
679679 out = li[i].output
@@ -681,22 +681,22 @@ def morphs_to_string(li, inbuf, logwrite):
681681 outbuf += out
682682 hyolen = len(li[i].hyouki)
683683 if hyolen == outlen:
684- inpos2.extend(range(p, p + outlen))
684+ inpos2.extend(xrange(p, p + outlen))
685685 elif out[:2] == '⠠⠦' and out[-2:] == '⠠⠴':
686686 # 情報処理用点字の内側
687687 c = outlen - 4
688688 inpos2.extend([p] * 2)
689- inpos2.extend(range(p, p + c))
689+ inpos2.extend(xrange(p, p + c))
690690 inpos2.extend([p + c - 1] * 2)
691691 elif out[:1] == '⠦' and out[-1:] == '⠴':
692692 # 外国語引用符の内側
693693 c = outlen - 2
694694 inpos2.extend([p])
695- inpos2.extend(range(p, p + c))
695+ inpos2.extend(xrange(p, p + c))
696696 inpos2.extend([p + c - 1])
697697 else:
698698 # 表記と出力の文字数が変化する場合
699- for x in range(outlen):
699+ for x in xrange(outlen):
700700 inpos2.append(p + int(float(x) * hyolen / outlen))
701701 p += hyolen
702702 if li[i].sepflag:
@@ -723,7 +723,7 @@ def japanese_braille_separate(inbuf, logwrite):
723723 text = inbuf
724724 if RE_MB_ALPHA_NUM_SPACE.match(text):
725725 outbuf = unicode_normalize(text)
726- inpos2 = range(len(outbuf))
726+ inpos2 = xrange(len(outbuf))
727727 return (outbuf, inpos2)
728728
729729 # 'あ゛ー' Unicode 正規化されて空白が入るので事前に補正する
@@ -793,7 +793,7 @@ def japanese_braille_separate(inbuf, logwrite):
793793 # after:
794794 # ’,’,記号,括弧閉,*,*,’,’,*/*,',0
795795 # 0,0,名詞,数,*,*,ゼロ,ゼロ,1/2,0,0
796- for pos in range(0, len(li) - 1):
796+ for pos in xrange(0, len(li) - 1):
797797 if li[pos].hyouki == '’' and li[pos+1].hinshi2 == '数':
798798 li[pos].output = "'"
799799
@@ -806,7 +806,7 @@ def japanese_braille_separate(inbuf, logwrite):
806806 # 二,二,名詞,数,*,*,2,2,1/2,2,0
807807 # 、,、,記号,読点,*,*,、,、,*/*,⠼,0
808808 # 三,三,名詞,数,*,*,3,3,1/2,3,0
809- for pos in range(1, len(li) - 1):
809+ for pos in xrange(1, len(li) - 1):
810810 if li[pos-1].output.isdigit() and \
811811 li[pos].hyouki in ('、', '・') and \
812812 li[pos+1].output.isdigit():
@@ -947,7 +947,7 @@ def makeOutPos(inPos, inlen, outlen):
947947 outPos[ inPos[p] ] = p
948948 # fill skipped outPos
949949 prev = 0
950- for p in range(inlen):
950+ for p in xrange(inlen):
951951 if outPos[p] == -1:
952952 outPos[p] = prev
953953 else:
@@ -956,7 +956,7 @@ def makeOutPos(inPos, inlen, outlen):
956956
957957 def mergePositionMap(inpos1, inpos2, outlen, inlen):
958958 inPos = [0] * outlen
959- for p in range(outlen):
959+ for p in xrange(outlen):
960960 inPos[p] = inpos2[ inpos1[p] ]
961961 outPos = makeOutPos(inPos, inlen, outlen)
962962 return inPos, outPos
旧リポジトリブラウザで表示