Fix conllu2json converter to output all sentences (#4656)

Make sure that the last batch of sentences is output if n_sents > 1.
This commit is contained in:
adrianeboyd 2019-11-15 17:08:32 +01:00 committed by Ines Montani
parent d64cfce546
commit bdfb696677

View File

@ -34,6 +34,9 @@ def conllu2json(input_data, n_sents=10, use_morphology=False, lang=None, **_):
doc = create_doc(sentences, i) doc = create_doc(sentences, i)
docs.append(doc) docs.append(doc)
sentences = [] sentences = []
if sentences:
doc = create_doc(sentences, i)
docs.append(doc)
return docs return docs