From db6c21625d6aadba8374393c84d0589480f1797f Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 18 Oct 2016 10:28:48 +0200 Subject: [PATCH] announce capitals in phonetic --- src/fenrir/core/outputManager.py | 4 +++- src/fenrir/utils/char_utils.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fenrir/core/outputManager.py b/src/fenrir/core/outputManager.py index 3998fe92..016563fc 100644 --- a/src/fenrir/core/outputManager.py +++ b/src/fenrir/core/outputManager.py @@ -28,7 +28,9 @@ class outputManager(): if self.playSoundIcon(soundIcon, interrupt): self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO) return - toAnnounceCapital = announceCapital and len(text.strip(' \n\t')) == 1 and text.strip(' \n\t').isupper() + if text.strip(string.whitespace) == '': + return + toAnnounceCapital = announceCapital and text[0].isupper() if toAnnounceCapital: if self.playSoundIcon('capital', False): toAnnounceCapital = False diff --git a/src/fenrir/utils/char_utils.py b/src/fenrir/utils/char_utils.py index 344df9ff..8ff8f0d4 100644 --- a/src/fenrir/utils/char_utils.py +++ b/src/fenrir/utils/char_utils.py @@ -85,6 +85,10 @@ def getPhonetic(currChar): "Y":"yankee", "Z":"zulu" } try: - return phoneticsDict[currChar.upper()] + phonChar = phoneticsDict[currChar.upper()] + if currChar.isupper(): + phonChar = phonChar[0].upper() + phonChar[1:] + return phonChar except: return currChar +