Skip to content

Commit

Permalink
Fix python 3 compatibility for gensim.corpora.UciCorpus.save_corpus (
Browse files Browse the repository at this point in the history
  • Loading branch information
darindf authored and menshikh-iv committed Feb 5, 2018
1 parent 1b1f90c commit 17c47ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gensim/corpora/ucicorpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def save_corpus(fname, corpus, id2word=None, progress_cnt=10000, metadata=False)
id2word = utils.dict_from_corpus(corpus)
num_terms = len(id2word)
else:
num_terms = 1 + max([-1] + id2word.keys())
num_terms = 1 + max([-1] + list(id2word))

# write out vocabulary
fname_vocab = utils.smart_extension(fname, '.vocab')
Expand Down

0 comments on commit 17c47ee

Please sign in to comment.