From f6209f8b4c634e3a3060c312ce25dfc73c10c49d Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 2 Oct 2016 21:44:07 +0200 Subject: [PATCH] replace any nonused punctuation with space but grave, apostrophe, dot and comma in punctuationmanager --- src/fenrir-package/core/punctuationManager.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/fenrir-package/core/punctuationManager.py b/src/fenrir-package/core/punctuationManager.py index 191ce920..522c70e0 100644 --- a/src/fenrir-package/core/punctuationManager.py +++ b/src/fenrir-package/core/punctuationManager.py @@ -12,13 +12,11 @@ class punctuationManager(): pass def initialize(self, environment): self.env = environment - self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), None) - # replace colon with space - self.allPunctNone[58] = ' ' - # replace minus with space - self.allPunctNone[45] = ' ' - # replace underscore with space - self.allPunctNone[95] = ' ' + self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), ' ') + # replace with space: + # dot, comma, grave, apostrophe + for char in [ord('.'),ord(','),ord('`'),ord("'")]: + self.allPunctNone[char] = None self.punctuation = { 'levels':{ 'NONE': '',