Tíquete #34639

既定の言語が日本語でない環境で文字説明モードにならない

: 2014-11-24 15:04 Última Atualização: 2015-01-29 18:20

Relator:
Dono:
Estado:
Aberto [Owner assigned]
Componente:
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Nenhum
Arquivo:
Nenhum

Details

#34542 に関連する修正をした 2014.4jp-beta-14112x で以下を確認しました:

  • 英語環境の Windows 10 TP
  • NVDA の言語設定が「既定の言語」
  • notepad に書かれた日本語文字列の前後で左右の矢印キーによるキャレット移動
  • 「説明モード」「読み方モード」のいずれにおいても「読み方モード」の動作しかしていない
  • 説明モードでは「にちようびのにち」のような読み上げが期待される

現在文字の説明を2回押すと「にちようびのにち」のような説明の読み上げはできます。

Ticket History (3/5 Histories)

2014-11-24 15:04 Updated by: nishimoto
  • New Ticket "既定の言語が日本語でない環境で文字説明モードにならない" created
2015-01-06 11:15 Updated by: nishimoto
Comentário

本件に関連しそうですが、本家 2015.1 で以下の変更があります:

http://community.nvda-project.org/ticket/4210

音声設定のオプション Trust voice's language for processing symbols and characters が追加。

以下、関連するソースの差分:

diff --git a/source/config/__init__.py b/source/config/__init__.py
index 941b24c..1f28f8b 100644
--- a/source/config/__init__.py
+++ b/source/config/__init__.py
@@ -69,6 +69,7 @@ confspec = ConfigObj(StringIO(
 	# The synthesiser to use
 	synth = string(default=auto)
 	symbolLevel = integer(default=100)
+	trustVoiceLanguage = boolean(default=true)
 	beepSpeechModePitch = integer(default=10000,min=50,max=11025)
 	outputDevice = string(default=default)
 	autoLanguageSwitching = boolean(default=true)
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
index 6d4b4c0..be054cb 100644
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -492,6 +492,11 @@ class VoiceSettingsDialog(SettingsDialog):
 		self.symbolLevelList.SetSelection(characterProcessing.CONFIGURABLE_SPEECH_SYMBOL_LEVELS.index(curLevel))
 		sizer.Add(self.symbolLevelList)
 		settingsSizer.Add(sizer,border=10,flag=wx.BOTTOM)
+		# Translators: This is the label for a checkbox in the
+		# voice settings dialog (if checked, text will be read using the voice for the language of the text).
+		self.trustVoiceLanguageCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Trust voice's language when processing characters and symbols"))
+		self.trustVoiceLanguageCheckbox.SetValue(config.conf["speech"]["trustVoiceLanguage"])
+		settingsSizer.Add(self.trustVoiceLanguageCheckbox,border=10,flag=wx.BOTTOM)
 		# Translators: This is a label for a setting in voice settings (an edit box to change voice pitch for capital letters; the higher the value, the pitch will be higher).
 		capPitchChangeLabel=wx.StaticText(self,-1,label=_("Capital pitch change percentage"))
 		settingsSizer.Add(capPitchChangeLabel)
@@ -579,6 +584,7 @@ class VoiceSettingsDialog(SettingsDialog):
 		config.conf["speech"]["autoLanguageSwitching"]=self.autoLanguageSwitchingCheckbox.IsChecked()
 		config.conf["speech"]["autoDialectSwitching"]=self.autoDialectSwitchingCheckbox.IsChecked()
 		config.conf["speech"]["symbolLevel"]=characterProcessing.CONFIGURABLE_SPEECH_SYMBOL_LEVELS[self.symbolLevelList.GetSelection()]
+		config.conf["speech"]["trustVoiceLanguage"]=self.trustVoiceLanguageCheckbox.IsChecked()
 		capPitchChange=self.capPitchChangeEdit.Value
 		try:
 			capPitchChange=int(capPitchChange)
diff --git a/source/speech.py b/source/speech.py
index a201cd4..105b784 100755
--- a/source/speech.py
+++ b/source/speech.py
@@ -123,7 +123,7 @@ def speakMessage(text,index=None):
 
 def getCurrentLanguage():
 	try:
-		language=getSynth().language if config.conf['speech']['autoLanguageSwitching'] else None
+		language=getSynth().language if config.conf['speech']['trustVoiceLanguage'] else None
 	except NotImplementedError:
 		language=None
 	if language:
2015-01-11 20:18 Updated by: nishimoto
  • Tipo Update from Bugs to Feature Requests
Comentário

本家の speech.getCurrentLanguage() に関連するリファクタリング:

Updating 6984a34..adb87a5
Fast-forward
 source/globalCommands.py | 7 ++-----
 source/nvdajp_dic.py     | 5 ++++-
 2 files changed, 6 insertions(+), 6 deletions(-)

この jpbeta ブランチで、Windows 7 日本語版の環境のまま、NVDA の一般設定「言語 : 英語 en」にして、JTalk の挙動をいくつかの設定の組み合わせで確認しました(後述)。

私がこのチケットの最初に書いた Windows 10 TP 英語版での状況は、Trust voice's languge : disabled の場合と同じのようです。

(日本語版の表記「記号と文字の説明に音声の言語を使用」チェックなし)

「日」を「ひ」と読むのは、テキスト解析されて読み付与された読み方で、「にち」「にちようびのにち」は NVDA 日本語版の文字説明辞書が使われています。

現状の仕様は、文字説明モードの機能は以下のいずれかの場合に有効、と説明すればよさそうです:

  • Windows の言語が日本語で NVDA の言語が「既定の言語」の場合
  • Windows の言語に関わらず NVDA の言語が「日本語」の場合
  • Windows の言語が日本語でなく、NVDA の言語が「既定の言語」「日本語」のいずれの言語でもないが、音声エンジンが JTalk で音声設定「記号と文字の説明に音声の言語を使用」がチェックの場合

文字説明モードの機能には、半角でピッチを上げる、カタカナでピッチを下げる、といった処理も含まれており、日本語に依存しています。

日本語以外の言語での文字説明モードについて、安易に仕様を変更する前に、方針の整理が必要と思います。

なお、同じようなことを eSpeak (日本語の簡易読み上げが可能な NVDA 日本語版の eSpeak で設定が english Max の場合)で確認すると、どのように設定しても文字説明モードは利用できず、「日」の文字は eSpeak 内蔵の中国語文字テーブル?と思われる読み上げになります。

チケットの種類を「バグ」から「機能リクエスト」に変更して、いったんマイルストーンを解除します。

General Settings > Language : 英語, en
Synthesizer: JTalk

Voice Settings
Automatic language switching : disabled
Automatic dialect switching : disabled
Trust voice's languge : disabled

日
up/down arrow key: ひ
character description mode enabled + left/right arrow key : ひ
character description mode disabled + left/right arrow key : ひ

====

General Settings > Language : 英語, en
Synthesizer: JTalk

Voice Settings
Automatic language switching : enabled
Automatic dialect switching : disabled
Trust voice's languge : disabled

日
up/down arrow key: ひ
character description mode enabled + left/right arrow key : ひ
character description mode disabled + left/right arrow key : ひ

====

General Settings > Language : 英語, en
Synthesizer: JTalk

Voice Settings
Automatic language switching : disabled
Automatic dialect switching : disabled
Trust voice's languge : enabled

日
up/down arrow key: ひ
character description mode enabled + left/right arrow key : にちようびのにち
character description mode disabled + left/right arrow key : にち

====

General Settings > Language : 英語, en
Synthesizer: JTalk

Voice Settings
Automatic language switching : enabled
Automatic dialect switching : disabled
Trust voice's languge : enabled

日
up/down arrow key: ひ
character description mode enabled + left/right arrow key : にちようびのにち
character description mode disabled + left/right arrow key : にち

2015-01-11 20:30 Updated by: nishimoto
Comentário

「記号と文字の説明に音声の言語を使用」への音声エンジンの対応状況の例:

  • SAPI4 ドライバーと SAPI4 版 ProTALKER :対応していない(NVDAの言語が英語だと文字説明モード不可)
  • SAPI5 ドライバーと SAPI5 版ドキュメントトーカ(太郎):対応している(NVDAの言語が英語でも文字説明モード利用可能)

音声ドライバーの _getAvailableVoices() が VoiceInfo(ID,name,language) を返しており、この language が ja や ja_JP であることが条件のようです。

2015-01-29 18:20 Updated by: nishimoto
  • Componente Update from (Nenhum) to コア機能
  • Dono Update from (Nenhum) to nishimoto
  • Marco Update from 2015.1jp (fechado) to (Nenhum)
Comentário

#34812 「レビュー内の現在の文字を通知」2回押しの場合だけかな文字とアルファベットのフォネティック読み

上記に関する作業を行っているスナップショット jpbeta150129 で本件を再確認しています。

Windows 10 最新の TP 英語環境、JTalk で試したところ、説明モードと読み方モードの切り替えは、 デフォルトの言語が英語であっても日本語の文字に関してはきちんと動作するようです。

ただし音声エンジン eSpeak の場合は、 日本語文字の文字説明で「の」を「エヌ、オー」と読んでしまうような動作です。

前回の更新でマイルストーンを解除すると書いたのに、解除できていなかったので、 あらためて解除します。

Attachment File List

No attachments

Editar

Please login to add comment to this ticket » Login