Commit c2294270 authored by Romain Loth's avatar Romain Loth

list_map: small check if ngram extraction failed

parent 7ef4a298
...@@ -100,6 +100,9 @@ def do_maplist(corpus, ...@@ -100,6 +100,9 @@ def do_maplist(corpus,
scored_ngrams = query.all() scored_ngrams = query.all()
n_ngrams = len(scored_ngrams) n_ngrams = len(scored_ngrams)
if n_ngrams == 0:
raise ValueError("No ngrams in cooc table ?")
# results, with same structure as quotas # results, with same structure as quotas
chosen_ngrams = { chosen_ngrams = {
'topgen':{'monograms':[], 'multigrams':[]}, 'topgen':{'monograms':[], 'multigrams':[]},
......
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