mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Refactor morphology slightly
This commit is contained in:
parent
0f12082465
commit
5431c47b91
|
@ -130,13 +130,7 @@ class MorphologyClassMap(object):
|
||||||
return [len(self.field2feats[field]) for field in self.fields]
|
return [len(self.field2feats[field]) for field in self.fields]
|
||||||
|
|
||||||
def get_field_offset(self, field):
|
def get_field_offset(self, field):
|
||||||
n = 0
|
return self.field2col[field]
|
||||||
for f in self.fields:
|
|
||||||
if f == field:
|
|
||||||
return n
|
|
||||||
n += len(self.field2feats[f])
|
|
||||||
else:
|
|
||||||
return -1
|
|
||||||
|
|
||||||
|
|
||||||
cdef class Morphology:
|
cdef class Morphology:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user