Unverified Commit 99a54ac5 authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge pull request #1233 from searchivarius/master

Fix to prevent crashing on assert len(tokens_b)>=1
parents 439b37b4 eab980fd
......@@ -329,7 +329,8 @@ def main():
doc = []
else:
tokens = tokenizer.tokenize(line)
doc.append(tokens)
if tokens:
doc.append(tokens)
if doc:
docs.add_document(doc) # If the last doc didn't end on a newline, make sure it still gets added
if len(docs) <= 1:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment