* Remove broken Vocab pickling

This commit is contained in:
Matthew Honnibal 2016-02-06 14:08:47 +01:00
parent e66d45bf66
commit dcb401f3e1

View File

@ -110,20 +110,21 @@ cdef class Vocab:
# TODO: This is hopelessly broken. The state is transferred as just
# a temp directory! We then fail to clean this up. This method therefore
# only pretends to work. What we need to do is form an archive file.
tmp_dir = tempfile.mkdtemp()
lex_loc = path.join(tmp_dir, 'lexemes.bin')
str_loc = path.join(tmp_dir, 'strings.json')
vec_loc = path.join(tmp_dir, 'vec.bin')
raise NotImplementedError
#tmp_dir = tempfile.mkdtemp()
#lex_loc = path.join(tmp_dir, 'lexemes.bin')
#str_loc = path.join(tmp_dir, 'strings.json')
#vec_loc = path.join(tmp_dir, 'vec.bin')
self.dump(lex_loc)
with io.open(str_loc, 'w', encoding='utf8') as file_:
self.strings.dump(file_)
#self.dump(lex_loc)
#with io.open(str_loc, 'w', encoding='utf8') as file_:
# self.strings.dump(file_)
self.dump_vectors(vec_loc)
state = (str_loc, lex_loc, vec_loc, self.morphology, self.get_lex_attr,
self.serializer_freqs, self.data_dir)
return (unpickle_vocab, state, None, None)
#self.dump_vectors(vec_loc)
#
#state = (str_loc, lex_loc, vec_loc, self.morphology, self.get_lex_attr,
# self.serializer_freqs, self.data_dir)
#return (unpickle_vocab, state, None, None)
cdef const LexemeC* get(self, Pool mem, unicode string) except NULL:
'''Get a pointer to a LexemeC from the lexicon, creating a new Lexeme