commit 185c3325b665b94e4e61a0f30475144b3dc064f2
parent f7a23b5e62feb205040a319a29e357d13d439369
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Mon, 22 Jan 2018 23:24:35 +0100
add tentative exclusion of empty chunks
there is a log file containing tracebacks caused by something like this
but I don't know which input triggers it...
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/verse.py b/verse.py
@@ -123,6 +123,8 @@ class Verse:
len(normalize(w, rm_all=True)) == 0))) for (b, x) in pre_chunks]
self.chunks = []
for (b, chunk) in pre_chunks:
+ if len(chunk) == 0:
+ continue # no empty chunks
self.chunks.append([{'original': y, 'text': normalize(y, rm_apostrophe=True)}
for y in chunk])
if not b: