Commit 6a9b4247 authored by delanoe's avatar delanoe

[FIX] BUG if query is more than authorized max.

parent dcbcbef5
......@@ -33,7 +33,7 @@ class IsidoreCrawler(Crawler):
return (bool2sparql(query, count=count, offset=offset, limit=limit))
def _get(self, query, offset=0, limit=100, lang=None):
def _get(self, query, offset=0, limit=None, lang=None):
'''Parameters to download data'''
isidore(query, count=False, offset=offset, limit=limit)
......@@ -53,9 +53,9 @@ class IsidoreCrawler(Crawler):
self.status.append("fetching results")
corpus = []
limit = 100
limit = 1000
self.query_max = self.scan_results(query)
#print("self.query_max : %s" % self.query_max)
print("self.query_max : %s" % self.query_max)
if self.query_max > QUERY_SIZE_N_MAX:
msg = "Invalid sample size N = %i (max = %i)" % ( self.query_max
......@@ -64,11 +64,9 @@ class IsidoreCrawler(Crawler):
print("WARNING (scrap: ISIDORE d/l ): " , msg)
self.query_max = QUERY_SIZE_N_MAX
#for page in range(1, trunc(self.query_max / 100) + 2):
for offset in range(0, self.query_max, limit):
print("Downloading result %s to %s" % (offset, self.query_max))
#for doc in self._get(query, count=False, offset=offset, limit=limit) :
for doc in isidore(query, offset=offset, limit=limit) :
corpus.append(doc)
......
......@@ -804,7 +804,7 @@
$('#submit_thing').prop('disabled', false);
$("#submit_thing").html("Processing a sample file")
$("#submit_thing").on("click", function(){
saveALL(pubmedquery, N, "/moissonneurs/isidore/save/");
save(pubmedquery, N, "/moissonneurs/isidore/save/");
//$("#submit_thing").onclick()
})}
}
......
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