Fix string serialisation

This commit is contained in:
Matthew Honnibal 2017-05-31 13:43:44 +02:00
parent e9419072e7
commit b1469d3360
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ from .symbols import NAMES as SYMBOLS_BY_INT
from .typedefs cimport hash_t from .typedefs cimport hash_t
from . import util from . import util
from .compat import json_dumps
cpdef hash_t hash_string(unicode string) except 0: cpdef hash_t hash_string(unicode string) except 0:
@ -201,7 +202,7 @@ cdef class StringStore:
path = util.ensure_path(path) path = util.ensure_path(path)
strings = list(self) strings = list(self)
with path.open('w') as file_: with path.open('w') as file_:
ujson.dump(strings, file_) file_.write(json_dumps(strings))
def from_disk(self, path): def from_disk(self, path):
"""Loads state from a directory. Modifies the object in place and """Loads state from a directory. Modifies the object in place and