mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-25 00:34:20 +03:00
* Save morphological analyses in a cache
This commit is contained in:
parent
1def5a6cbe
commit
2be3620333
|
@ -42,6 +42,7 @@ cdef class Morphology:
|
|||
analysis = <MorphAnalysisC*>self.mem.alloc(1, sizeof(MorphAnalysisC))
|
||||
analysis.tag = self.rich_tags[tag_id]
|
||||
analysis.lemma = self.lemmatize(analysis.tag.pos, token.lex.orth)
|
||||
self._cache.set(tag_id, token.lex.orth, analysis)
|
||||
token.lemma = analysis.lemma
|
||||
token.pos = analysis.tag.pos
|
||||
token.tag = analysis.tag.name
|
||||
|
|
Loading…
Reference in New Issue
Block a user