Skip to content

Commit

Permalink
Fix blank string error
Browse files Browse the repository at this point in the history
Committer: Tom Grek <tom.grek@gmail.com>
  • Loading branch information
venus committed May 31, 2019
1 parent 5f9f1b9 commit 4909e1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zincbase/utils/string_utils.py
Expand Up @@ -34,8 +34,12 @@ def cleanse(line):
return line[0].lower() + line[1:]

def clean_punctuation(line):
if not line:
return line
if line[0] in '.,()-:;':
line = line[1:]
if not line:
return line
if line[-1] in '.,()-:;':
line = line[:-1]
return line.strip()

0 comments on commit 4909e1d

Please sign in to comment.