OSDN Git Service
(root)
/
nvdajp
/
nvdajpmiscdep.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1cf57b8
)
ti34542 fix JTalk issue with non-Japanese language environment
author
Takuya Nishimoto
<nishimotz@gmail.com>
Mon, 27 Oct 2014 06:25:30 +0000
(15:25 +0900)
committer
Takuya Nishimoto
<nishimotz@gmail.com>
Mon, 27 Oct 2014 06:25:30 +0000
(15:25 +0900)
source/synthDrivers/nvdajp_jtalk.py
patch
|
blob
|
history
diff --git
a/source/synthDrivers/nvdajp_jtalk.py
b/source/synthDrivers/nvdajp_jtalk.py
index
1a455ac
..
25a5f6b
100644
(file)
--- a/
source/synthDrivers/nvdajp_jtalk.py
+++ b/
source/synthDrivers/nvdajp_jtalk.py
@@
-16,6
+16,7
@@
import synthDriverHandler
import languageHandler
\r
from jtalk import jtalkDriver
\r
from jtalk.jtalkDriver import VoiceProperty
\r
import languageHandler
\r
from jtalk import jtalkDriver
\r
from jtalk.jtalkDriver import VoiceProperty
\r
+from jtalk._nvdajp_espeak import isJapaneseLang
\r
\r
class SynthDriver(SynthDriver):
\r
"""A Japanese synth driver for NVDAjp.
\r
\r
class SynthDriver(SynthDriver):
\r
"""A Japanese synth driver for NVDAjp.
\r
@@
-57,7
+58,15
@@
class SynthDriver(SynthDriver):
p.pitch = self._pitch
\r
p.inflection = self._inflection
\r
p.characterMode = spellState
\r
p.pitch = self._pitch
\r
p.inflection = self._inflection
\r
p.characterMode = spellState
\r
- jtalkDriver.speak(unicode(item), currentLang, index=finalIndex, voiceProperty_=p)
\r
+ msg = unicode(item)
\r
+ isMsgJp = isJapaneseLang(msg)
\r
+ lang = currentLang
\r
+ if isMsgJp:
\r
+ lang = 'ja'
\r
+ elif defaultLanguage != 'ja' and not isMsgJp:
\r
+ lang = defaultLanguage
\r
+ log.debug("lang:%s idx:%s pit:%d inf:%d chr:%d (%s)" % (lang, str(finalIndex), p.pitch, p.inflection, p.characterMode, msg))
\r
+ jtalkDriver.speak(msg, lang, index=finalIndex, voiceProperty_=p)
\r
elif isinstance(item,speech.IndexCommand):
\r
finalIndex = item.index
\r
elif isinstance(item,speech.CharacterModeCommand):
\r
elif isinstance(item,speech.IndexCommand):
\r
finalIndex = item.index
\r
elif isinstance(item,speech.CharacterModeCommand):
\r