replace any nonused punctuation with space but grave, apostrophe, dot and comma in punctuationmanager
This commit is contained in:
parent
d63b21a50f
commit
f6209f8b4c
@ -12,13 +12,11 @@ class punctuationManager():
|
|||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), None)
|
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), ' ')
|
||||||
# replace colon with space
|
# replace with space:
|
||||||
self.allPunctNone[58] = ' '
|
# dot, comma, grave, apostrophe
|
||||||
# replace minus with space
|
for char in [ord('.'),ord(','),ord('`'),ord("'")]:
|
||||||
self.allPunctNone[45] = ' '
|
self.allPunctNone[char] = None
|
||||||
# replace underscore with space
|
|
||||||
self.allPunctNone[95] = ' '
|
|
||||||
self.punctuation = {
|
self.punctuation = {
|
||||||
'levels':{
|
'levels':{
|
||||||
'NONE': '',
|
'NONE': '',
|
||||||
|
Loading…
Reference in New Issue
Block a user