From 2be362033348a6c46a1f23e6d48e25c78cfc60eb Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 8 Sep 2015 15:39:24 +0200 Subject: [PATCH] * Save morphological analyses in a cache --- spacy/morphology.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index fc6a4936b..77d7bd2df 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -42,6 +42,7 @@ cdef class Morphology: analysis = 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