From fe264e8d96f1173eca930154e5ee0c6655ed6663 Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 18 Oct 2016 14:03:10 +0200 Subject: [PATCH] tell the TTS system the pause without messinng config files --- config/punctuation/default.conf | 10 +++++----- config/settings/settings.conf | 1 + config/settings/settings.conf.storm | 1 + src/fenrir/core/punctuationManager.py | 7 ++++++- src/fenrir/core/settings.py | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/config/punctuation/default.conf b/config/punctuation/default.conf index 11fff1ab..44d5590e 100644 --- a/config/punctuation/default.conf +++ b/config/punctuation/default.conf @@ -15,13 +15,13 @@ all:===:!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ @:===:at \:===:backslash |:===:bar -!:===:bang! +!:===:bang ^:===:carrot -::===:colon: -,:===:comma, +::===:colon +,:===:comma -:===:dash $:===:dollar -.:===:dot. +.:===:dot >:===:greater `:===:grave #:===:hash @@ -36,7 +36,7 @@ $:===:dollar ):===:right paren }:===:right brace ]:===:right bracket -;:===:semicolon; +;:===:semicolon /:===:slash *:===:star ~:===:tilde diff --git a/config/settings/settings.conf b/config/settings/settings.conf index cd44ed61..5a8a6f4b 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -99,6 +99,7 @@ doubleTapTimeout=0.2 debugLevel=0 punctuationProfile=default punctuationLevel=some +respectPunctuationPause=True numberOfClipboards=10 emoticons=True # define the current fenrir key diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 1a8f1a0f..f166faa7 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -50,6 +50,7 @@ doubleTapTimeout=0.2 debugLevel=0 punctuationProfile=default punctuationLevel=some +respectPunctuationPause=True numberOfClipboards=10 emoticons=True fenrirKeys=KEY_KP0 diff --git a/src/fenrir/core/punctuationManager.py b/src/fenrir/core/punctuationManager.py index 9e979aea..f2ab3da8 100644 --- a/src/fenrir/core/punctuationManager.py +++ b/src/fenrir/core/punctuationManager.py @@ -43,7 +43,12 @@ class punctuationManager(): if punctuationDict and punctuation and punctuation != '': for key,item in punctuationDict.items(): if key in punctuation: - resultText = resultText.replace(str(key),' ' +str(item) +' ') + if self.env['runtime']['settingsManager'].getSetting('general', 'respectPunctuationPause') and \ + len(key) == 1 and \ + key in string.punctuation: + resultText = resultText.replace(str(key),' ' +str(item) + str(key) + ' ') + else: + resultText = resultText.replace(str(key),' ' +str(item) + ' ') return resultText def proceedPunctuation(self, text, ignorePunctuation=False): diff --git a/src/fenrir/core/settings.py b/src/fenrir/core/settings.py index 59293c89..7a8906cc 100644 --- a/src/fenrir/core/settings.py +++ b/src/fenrir/core/settings.py @@ -43,6 +43,7 @@ settings = { 'debugLevel': debug.debugLevel.DEACTIVE, 'punctuationProfile':'default', 'punctuationLevel': 'some', + 'respectPunctuationPause':True, 'numberOfClipboards': 10, 'emoticons': True, 'fenrirKeys': ['KEY_KP0','KEY_META'],