From 3ef411435c7c4e9b32ad6ecbd13cfb604eea1646 Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 20 Oct 2017 21:02:45 +0200 Subject: [PATCH] add space for emoji dict --- src/fenrir/core/punctuationManager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fenrir/core/punctuationManager.py b/src/fenrir/core/punctuationManager.py index bacbe0b8..f10dca30 100644 --- a/src/fenrir/core/punctuationManager.py +++ b/src/fenrir/core/punctuationManager.py @@ -32,11 +32,11 @@ class punctuationManager(): pass return text.translate(currAllPunctNone) - def useCustomDict(self, text, customDict): + def useCustomDict(self, text, customDict, seperator=''): resultText = str(text) if customDict: for key,item in customDict.items(): - resultText = resultText.replace(str(key),str(item)) + resultText = resultText.replace(str(key),seperator + str(item) + seperator) return resultText def usePunctuationDict(self, text, punctuationDict, punctuation): @@ -59,7 +59,7 @@ class punctuationManager(): 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']) + 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']: currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()]