Fix bug in NER state

This commit is contained in:
Matthew Honnibal 2017-05-30 22:12:19 +02:00
parent be4a640f0c
commit cc911feab2
1 changed files with 12 additions and 3 deletions

View File

@ -89,12 +89,21 @@ cdef cppclass StateC:
ids[11] = this.R(this.S(1), 1) ids[11] = this.R(this.S(1), 1)
ids[12] = this.R(this.S(1), 2) ids[12] = this.R(this.S(1), 2)
elif n == 6: elif n == 6:
ids[0] = this.B(0)-1 if this.B(0) >= 0:
ids[0] = this.B(0)
else:
ids[0] = -1
ids[1] = this.B(0) ids[1] = this.B(0)
ids[2] = this.B(1) ids[2] = this.B(1)
ids[3] = this.E(0) ids[3] = this.E(0)
if ids[3] >= 1:
ids[4] = this.E(0)-1 ids[4] = this.E(0)-1
else:
ids[4] = -1
if ids[3] < (this.length+1):
ids[5] = this.E(0)+1 ids[5] = this.E(0)+1
else:
ids[5] = -1
else: else:
# TODO error =/ # TODO error =/
pass pass