From 5431c47b915d821e231d9f5d1df4041fcd57fadb Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 10 Mar 2019 00:59:51 +0000 Subject: [PATCH] Refactor morphology slightly --- spacy/morphology.pyx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index 6c9ecebdc..c592ee674 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -130,13 +130,7 @@ class MorphologyClassMap(object): return [len(self.field2feats[field]) for field in self.fields] def get_field_offset(self, field): - n = 0 - for f in self.fields: - if f == field: - return n - n += len(self.field2feats[f]) - else: - return -1 + return self.field2col[field] cdef class Morphology: