def add(self, doc):
array = doc.to_array(self.attrs)<EOL>if len(array.shape) == <NUM_LIT:1>:<EOL><INDENT>array = array.reshape((array.shape[<NUM_LIT:0>], <NUM_LIT:1>))<EOL><DEDENT>self.tokens.append(array)<EOL>spaces = doc.to_array(SPACY)<EOL>assert array.shape[<NUM_LIT:0>] == spaces.shape[<NUM_LIT:0>]<EOL>spaces = spaces.reshape((spaces.shape[<NUM_LIT:0>], <NUM_LIT:1>))<EOL>self.spaces.append(numpy.asarray(spaces, dtype=bool))<EOL>self.strings.update(w.text for w in doc)<EOL>
Add a doc's annotations to the binder for serialization.