Approximate cost in Break transition, to speed things up a bit.

This commit is contained in:
Matthew Honnibal 2017-03-15 16:40:27 -05:00
parent 8543db8a5b
commit 4ef68c413f

View File

@ -272,6 +272,8 @@ cdef class Break:
B_i = s.B(j) B_i = s.B(j)
cost += gold.heads[S_i] == B_i cost += gold.heads[S_i] == B_i
cost += gold.heads[B_i] == S_i cost += gold.heads[B_i] == S_i
if cost != 0:
return cost
# Check for sentence boundary --- if it's here, we can't have any deps # Check for sentence boundary --- if it's here, we can't have any deps
# between stack and buffer, so rest of action is irrelevant. # between stack and buffer, so rest of action is irrelevant.
s0_root = _get_root(s.S(0), gold) s0_root = _get_root(s.S(0), gold)