mirror of https://github.com/explosion/spaCy.git
Add extra comment on 'add label' in parser
This commit is contained in:
parent
6e749d3c70
commit
5080760288
|
@ -178,6 +178,9 @@ cdef class TransitionSystem:
|
|||
self.c = <Transition*>self.mem.realloc(self.c, self._size * sizeof(self.c[0]))
|
||||
self.c[self.n_moves] = self.init_transition(self.n_moves, action, label_id)
|
||||
self.n_moves += 1
|
||||
# Add the new (action, label) pair, making up a frequency for it if
|
||||
# necessary. To preserve sort order, the frequency needs to be lower
|
||||
# than previous frequencies.
|
||||
if self.labels.get(action, []):
|
||||
new_freq = min(self.labels[action].values())
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue