From 4890337e57173fb800861bea18d9f75750f44a5c Mon Sep 17 00:00:00 2001
From: ilor <kailoran@gmail.com>
Date: Tue, 7 Jun 2011 13:53:20 +0200
Subject: [PATCH] fix corpus-get with no sentence range

---
 corpus2tools/corpus-get | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/corpus2tools/corpus-get b/corpus2tools/corpus-get
index 98a5af0..8344d6b 100755
--- a/corpus2tools/corpus-get
+++ b/corpus2tools/corpus-get
@@ -111,7 +111,7 @@ def go():
 				return
 		else:
 			selection.update(izip(parse_range_info(arg), repeat(())))
-	maxsel = max(selection.keys())
+	maxsel = max(selection.keys()) if selection.keys() != [] else None
 	if selection == {}:
 		if options.chunks:
 			for chunk in chunks(reader):
@@ -129,7 +129,7 @@ def go():
 					else:
 						write_selected_sentences(chunk.sentences(), writer, selection[cid])
 				cid += 1
-				if cid > maxsel: break
+				if maxsel is not None and cid > maxsel: break
 		else:
 			write_selected_sentences(sentences(reader), writer, selection, maxsel)
 
-- 
GitLab