ignore white space

pull/39/head
Sun Junyi 12 years ago
parent 45591bb9ab
commit 012fddf13f

@ -169,7 +169,7 @@ def cut(sentence,cut_all=False):
tmp = re_skip.split(blk) tmp = re_skip.split(blk)
for x in tmp: for x in tmp:
if re_skip.match(x): if re_skip.match(x):
if x!=' ': if x.strip(' ')!='':
yield x yield x
else: else:
for xx in x: for xx in x:

@ -136,7 +136,8 @@ def cut(sentence):
tmp = re_skip.split(blk) tmp = re_skip.split(blk)
for x in tmp: for x in tmp:
if re_skip.match(x): if re_skip.match(x):
yield pair(x,'') if x.strip(' ')!='':
yield pair(x,'')
else: else:
for xx in x: for xx in x:
if re_num.match(xx): if re_num.match(xx):

Loading…
Cancel
Save