ignore " " and "_" in --restriction

This commit is contained in:
Mattias Andrée 2012-11-07 04:26:21 +01:00
parent 4dcbee5dc9
commit fcc9b8edcd
2 changed files with 2 additions and 2 deletions

View file

@ -607,7 +607,7 @@ class PonysayTool():
for c in 'ABCDEFGHIJKLMN OPQRSTUVWXYZ':
test = test.replace(c, '')
if (len(test) == 0) and (len(key) > 0):
data.append((key, makeset(value)))
data.append((key, makeset(value.replace(' ', ''))))
everything.append(ponyfile[:-5], data)
import cPickle
with open(ponydir + 'metadata', 'wb') as file:

View file

@ -631,7 +631,7 @@ class Ponysay():
table = [(get_test(cell[:cell.index('=')],
cell[cell.index('=') + 1:]
)
for cell in clause.lower().split('+'))
for cell in clause.lower().replace('_', '').replace(' ', '').split('+'))
for clause in restriction
]