Update punctuationManager.py
This commit is contained in:
parent
13a184cc31
commit
d3f46fe3cf
@ -15,9 +15,11 @@ class punctuationManager():
|
|||||||
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation +"§"), ' ')
|
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation +"§"), ' ')
|
||||||
# replace with None:
|
# replace with None:
|
||||||
# dot, comma, grave, apostrophe
|
# dot, comma, grave, apostrophe
|
||||||
for char in [ord('.'),ord(','),ord('`'),ord("'")]:
|
#for char in [ord('`'),ord("'")]:
|
||||||
self.allPunctNone[char] = None
|
# self.allPunctNone[char] = None
|
||||||
|
# dont restore the following (for announce correct pause)
|
||||||
|
for char in [ord('.'), ord(','), ord(';'), ord(':'), ord('?'), ord('!'), ord('-')]:
|
||||||
|
self.allPunctNone[char] = chr(char)
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def removeUnused(self, text, currLevel = ''):
|
def removeUnused(self, text, currLevel = ''):
|
||||||
@ -60,9 +62,9 @@ class punctuationManager():
|
|||||||
if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']:
|
if not ignorePunctuation and 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()]
|
currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()]
|
||||||
else:
|
else:
|
||||||
currPunctLevel = string.punctuation
|
currPunctLevel = string.punctuation +'§'
|
||||||
resultText = self.usePunctuationDict(resultText, self.env['punctuation']['PUNCTDICT'], currPunctLevel)
|
resultText = self.usePunctuationDict(resultText, self.env['punctuation']['PUNCTDICT'], currPunctLevel)
|
||||||
#resultText = self.removeUnused(resultText, currPunctLevel)
|
resultText = self.removeUnused(resultText, currPunctLevel)
|
||||||
return resultText
|
return resultText
|
||||||
|
|
||||||
def cyclePunctuation(self):
|
def cyclePunctuation(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user