Skip to content

Commit

Permalink
adding dtype to save/load
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimieMurdock committed Apr 26, 2016
1 parent db1c944 commit ce39c73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vsm/corpus/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ def load(file=None, corpus_dir=None,
arrays_in = np.load(file)

c = Corpus([], remove_empty=False)
c.dtype = arrays_in['dtype']
c.corpus = arrays_in['corpus']
c.words = arrays_in['words']
c.context_types = arrays_in['context_types'].tolist()
Expand Down Expand Up @@ -636,6 +637,7 @@ def save(self, file):
arrays_out['words'] = self.words
arrays_out['context_types'] = np.asarray(self.context_types)
arrays_out['stopped_words'] = np.asarray(self.stopped_words)
arrays_out['dtype'] = str(self.dtype)

for i,t in enumerate(self.context_data):
key = 'context_data_' + self.context_types[i]
Expand Down

0 comments on commit ce39c73

Please sign in to comment.