From 0ee990eb623695bb65e6cb74f1b765cd4fbd8e47 Mon Sep 17 00:00:00 2001 From: chrys Date: Thu, 29 Sep 2016 20:35:53 +0200 Subject: [PATCH] fix punctuation inside of a word seperate the word --- src/fenrir-package/core/punctuationManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fenrir-package/core/punctuationManager.py b/src/fenrir-package/core/punctuationManager.py index 8cf1f637..1e65c8bd 100644 --- a/src/fenrir-package/core/punctuationManager.py +++ b/src/fenrir-package/core/punctuationManager.py @@ -12,6 +12,7 @@ class punctuationManager(): pass def initialize(self, environment): self.env = environment + self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), None) self.punctuation = { 'currLevel':'3', 'levels':{ @@ -60,7 +61,8 @@ class punctuationManager(): def shutdown(self): pass def removeUnused(self, text): - return text.translate(text.maketrans(string.punctuation, ' '*len(string.punctuation))) + return text.translate(self.allPunctNone) + def useCustomDict(self, text, customDict): resultText = str(text) if customDict: