                      state.first = token_i
                      state.second = pattern + 1
                      partials.push_back(state)
                  elif action == ACCEPT:
                      start = token_i
                      end = token_i+1
                      ent_id = pattern[1].attrs[0].value
                      label = pattern[1].attrs[1].value
                      if acceptor is None or acceptor(doc, ent_id, label, start, end):
                          matches.append((ent_id, label, start, end))
          for i, (ent_id, label, start, end) in enumerate(matches):
 
</s> remove                     start = state.first
                    end = token_i+1
 </s> add                     start = doc.c[state.first].idx
                    end = doc.c[token_i].idx + doc.c[token_i].lex.length </s> remove                     if acceptor is None or acceptor(doc, ent_id, label, start, end):
                        matches.append((ent_id, label, start, end))
 </s> add                     acceptor = self._acceptors.get(ent_id)
                    if acceptor is not None:
                        match = acceptor(doc, ent_id, label, start, end)
                        if match:
                            ent_id, label, start, end = match
                    matches.append((ent_id, label, start, end))
                    start = token.idx
                    end = token.idx + token.lex.length
                      state.first = token_i
                      state.second = pattern + 1
                      partials.push_back(state)
                  elif action == ACCEPT:
                    start = token.idx
                    end = token.idx + token.lex.length
                    start = token.idx
                    end = token.idx + token.lex.length
                      ent_id = pattern[1].attrs[0].value
                      label = pattern[1].attrs[1].value
                      if acceptor is None or acceptor(doc, ent_id, label, start, end):
                          matches.append((ent_id, label, start, end))
          for i, (ent_id, label, start, end) in enumerate(matches):
keep keep keep keep replace replace keep keep keep keep keep
 Have the matcher return character offsets, to handle the match better. 
spacy/matcher.pyx