diff --git a/src/fenrir/core/headLineManager.py b/src/fenrir/core/headLineManager.py index d04dc68d..0fa44703 100644 --- a/src/fenrir/core/headLineManager.py +++ b/src/fenrir/core/headLineManager.py @@ -30,10 +30,11 @@ class headLineManager(): newText += text[lastPos:span[0]] numberOfChars = len(text[span[0]:span[1]]) name = text[span[0]:span[1]][:2] - if name.strip(name[0]) == '': - newText += ' ' + str(numberOfChars) + ' ' + name[0] + ' ' + print(self.env['runtime']['punctuationManager'].proceedPunctuation(name, True)) + if name[0] == name[1]: + newText += ' ' + str(numberOfChars) + ' ' + self.env['runtime']['punctuationManager'].proceedPunctuation(name[0], True) + ' ' else: - newText += ' ' + str(int(numberOfChars / 2)) + ' ' + name + ' ' + newText += ' ' + str(int(numberOfChars / 2)) + ' ' + self.env['runtime']['punctuationManager'].proceedPunctuation(name, True) + ' ' lastPos = span[1] if lastPos != 0: newText += ' ' @@ -44,10 +45,10 @@ class headLineManager(): result += text[lastPos:span[0]] numberOfChars = len(newText[span[0]:span[1]]) name = newText[span[0]:span[1]][:2] - if name.strip(name[0]) == '': - result += ' ' + str(numberOfChars) + ' ' + name[0] + ' ' + if name[0] == name[1]: + result += ' ' + str(numberOfChars) + ' ' + self.env['runtime']['punctuationManager'].proceedPunctuation(name[0], True) + ' ' else: - result += ' ' + str(int(numberOfChars / 2)) + ' ' + name + ' ' + result += ' ' + str(int(numberOfChars / 2)) + ' ' + self.env['runtime']['punctuationManager'].proceedPunctuation(name, True) + ' ' lastPos = span[1] if lastPos != 0: result += ' ' diff --git a/src/fenrir/core/punctuationManager.py b/src/fenrir/core/punctuationManager.py index f10dca30..61f2f2ee 100644 --- a/src/fenrir/core/punctuationManager.py +++ b/src/fenrir/core/punctuationManager.py @@ -49,7 +49,7 @@ class punctuationManager(): if key in punctuation and key not in ' ': if self.env['runtime']['settingsManager'].getSetting('general', 'respectPunctuationPause') and \ len(key) == 1 and \ - key in ",.;:?!-": + key in ",.;:?!": resultText = resultText.replace(str(key),' ' +str(item) + str(key) + ' ') else: resultText = resultText.replace(str(key),' ' +str(item) + ' ')