      @staticmethod
      cdef bint is_valid(const StateC* st, attr_t label) nogil:
          if st.B_(1).ent_iob == 1:
              return False
          return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
  
      @staticmethod
      cdef int transition(StateC* st, attr_t label) nogil:
          st.close_ent()
          st.set_ent_tag(st.B(0), 1, label)
 
</s>
        # Don't allow entities to end on whitespace
        elif Lexeme.get_struct_attr(st.B_(0).lex, IS_SPACE):
            return False
      @staticmethod
      cdef bint is_valid(const StateC* st, attr_t label) nogil:
          if st.B_(1).ent_iob == 1:
              return False
        # Don't allow entities to end on whitespace
        elif Lexeme.get_struct_attr(st.B_(0).lex, IS_SPACE):
            return False
          return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
  
      @staticmethod
      cdef int transition(StateC* st, attr_t label) nogil:
          st.close_ent()
          st.set_ent_tag(st.B(0), 1, label)
keep keep keep add keep keep keep keep keep keep
 Try to prevent spaces from being tagged as entities
spacy/syntax/ner.pyx