mirror of https://github.com/explosion/spaCy.git
* const added to Lexicon interface. Seems to work.
This commit is contained in:
parent
d70d31aa45
commit
7e04c22f8f
|
@ -296,8 +296,10 @@ cdef class Lexicon:
|
||||||
def __setitem__(self, unicode uni_string, dict props):
|
def __setitem__(self, unicode uni_string, dict props):
|
||||||
cdef UniStr s
|
cdef UniStr s
|
||||||
slice_unicode(&s, uni_string, 0, len(uni_string))
|
slice_unicode(&s, uni_string, 0, len(uni_string))
|
||||||
cdef const Lexeme* lex = self.get(&s)
|
# Cast through the const here, since we're allowed to change our own
|
||||||
self.lexemes[lex.id][0] = lexeme_init(lex.id, s.chars[:s.n], s.key, self.strings, props)
|
# Lexemes.
|
||||||
|
lex = <Lexeme*><void*>self.get(&s)
|
||||||
|
lex[0] = lexeme_init(lex.id, s.chars[:s.n], s.key, self.strings, props)
|
||||||
|
|
||||||
def dump(self, loc):
|
def dump(self, loc):
|
||||||
if path.exists(loc):
|
if path.exists(loc):
|
||||||
|
|
Loading…
Reference in New Issue