Skip to content
Snippets Groups Projects
Commit 4890337e authored by ilor's avatar ilor
Browse files

fix corpus-get with no sentence range

parent 7a9e4bc3
No related merge requests found
...@@ -111,7 +111,7 @@ def go(): ...@@ -111,7 +111,7 @@ def go():
return return
else: else:
selection.update(izip(parse_range_info(arg), repeat(()))) selection.update(izip(parse_range_info(arg), repeat(())))
maxsel = max(selection.keys()) maxsel = max(selection.keys()) if selection.keys() != [] else None
if selection == {}: if selection == {}:
if options.chunks: if options.chunks:
for chunk in chunks(reader): for chunk in chunks(reader):
...@@ -129,7 +129,7 @@ def go(): ...@@ -129,7 +129,7 @@ def go():
else: else:
write_selected_sentences(chunk.sentences(), writer, selection[cid]) write_selected_sentences(chunk.sentences(), writer, selection[cid])
cid += 1 cid += 1
if cid > maxsel: break if maxsel is not None and cid > maxsel: break
else: else:
write_selected_sentences(sentences(reader), writer, selection, maxsel) write_selected_sentences(sentences(reader), writer, selection, maxsel)
......
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