From f742900f83296362bbca371b9b08785141752809 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 9 Mar 2019 11:51:11 +0000 Subject: [PATCH] Set pos attribute in morphologizer --- spacy/pipeline/morphologizer.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/pipeline/morphologizer.pyx b/spacy/pipeline/morphologizer.pyx index 589373f80..9cb384a03 100644 --- a/spacy/pipeline/morphologizer.pyx +++ b/spacy/pipeline/morphologizer.pyx @@ -94,6 +94,8 @@ class Morphologizer(Pipe): # Now add the analysis, and set the hash. try: doc.c[j].morph = self.vocab.morphology.add(feats) + if doc[j].morph.pos != 0: + doc.c[j].pos = doc[j].morph.pos except: print(offsets) print(doc_guesses[j])