Skip to content

Commit

Permalink
Use regexp in norm_spaces to multiple kinds of spaces are normalized (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Mar 25, 2021
1 parent 16787f4 commit ac00454
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions folia/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ def parsetime(s):


def norm_spaces(s):
r"""Normalize spaces, splits on whitespace (\t\s) and rejoins (faster than a s/\s+// regexp)"""
return ' '.join(s.split())
r"""Normalize spaces, splits on whitespace (\t\s) and rejoins"""
return " ".join(re.split(r"\s+",s))


def postprocess_spaces(s):
Expand Down

0 comments on commit ac00454

Please sign in to comment.