The fix for hopefully not reading all spaces broke review by character. Hopefully fix that.
This commit is contained in:
parent
e2fb28d92f
commit
d935ef2e3c
@ -101,7 +101,7 @@ class outputManager():
|
||||
cleanText = self.env['runtime']['textManager'].replaceHeadLines(cleanText)
|
||||
cleanText = self.env['runtime']['punctuationManager'].proceedPunctuation(cleanText, ignorePunctuation)
|
||||
cleanText = re.sub(' +$', ' ', cleanText)
|
||||
self.env['runtime']['speechDriver'].speak(cleanText)
|
||||
self.env['runtime']['speechDriver'].speak(cleanText, True, ignorePunctuation)
|
||||
self.env['runtime']['debug'].writeDebugOut("Speak: "+ cleanText, debug.debugLevel.INFO)
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut("\"speak\" in outputManager.speakText ", debug.debugLevel.ERROR)
|
||||
|
@ -65,15 +65,16 @@ class punctuationManager():
|
||||
def isPuctuation(self, char):
|
||||
return char in self.env['punctuation']['PUNCTDICT']
|
||||
def proceedPunctuation(self, text, ignorePunctuation=False):
|
||||
if ignorePunctuation:
|
||||
return text
|
||||
resultText = text
|
||||
resultText = self.useCustomDict(resultText, self.env['punctuation']['CUSTOMDICT'])
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
|
||||
resultText = self.useCustomDict(resultText, self.env['punctuation']['EMOTICONDICT'], ' ')
|
||||
currPunctLevel = ''
|
||||
if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']:
|
||||
if self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']:
|
||||
currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()]
|
||||
elif not ignorePunctuation:
|
||||
# Only use fallback punctuation if ignorePunctuation is False
|
||||
else:
|
||||
currPunctLevel = string.punctuation +' §'
|
||||
resultText = self.usePunctuationDict(resultText, self.env['punctuation']['PUNCTDICT'], currPunctLevel)
|
||||
resultText = self.removeUnused(resultText, currPunctLevel)
|
||||
|
@ -24,7 +24,7 @@ class speechDriver():
|
||||
self.cancel()
|
||||
self._isInitialized = False
|
||||
|
||||
def speak(self,text, queueable=True):
|
||||
def speak(self,text, queueable=True, ignorePunctuation=False):
|
||||
if not self._isInitialized:
|
||||
return
|
||||
if not queueable:
|
||||
|
@ -22,7 +22,7 @@ class driver(speechDriver):
|
||||
self._isInitialized = False
|
||||
print('Speech Debug Driver: Shutdown')
|
||||
|
||||
def speak(self,text, queueable=True):
|
||||
def speak(self,text, queueable=True, ignorePunctuation=False):
|
||||
if not self._isInitialized:
|
||||
return
|
||||
if not queueable:
|
||||
|
@ -52,7 +52,7 @@ class driver(speechDriver):
|
||||
self.cancel()
|
||||
self.textQueue.put(-1)
|
||||
|
||||
def speak(self,text, queueable=True):
|
||||
def speak(self,text, queueable=True, ignorePunctuation=False):
|
||||
if not self._isInitialized:
|
||||
return
|
||||
if not queueable:
|
||||
|
@ -37,7 +37,7 @@ class driver(speechDriver):
|
||||
pass
|
||||
self._isInitialized = False
|
||||
|
||||
def speak(self,text, queueable=True):
|
||||
def speak(self,text, queueable=True, ignorePunctuation=False):
|
||||
if not queueable:
|
||||
self.cancel()
|
||||
if not self._isInitialized:
|
||||
@ -66,6 +66,9 @@ class driver(speechDriver):
|
||||
self.env['runtime']['debug'].writeDebugOut('speechDriver setVoice:' + str(e),debug.debugLevel.ERROR)
|
||||
|
||||
try:
|
||||
if ignorePunctuation:
|
||||
self._sd.set_punctuation(self._punct.ALL)
|
||||
else:
|
||||
self._sd.set_punctuation(self._punct.NONE)
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut('speechDriver set_punctuation:' + str(e),debug.debugLevel.ERROR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user