code: def scan(self, data, part):
          
          if not self.end_chars:
              yield from data
              self.start = self.start or bool(data)
              self.end = False
          else:
              for char in data:
                  if char in self.end_chars:
                      if not self.start:
                          continue
                      self.end = True
                  else:
                      if self.end:
                          yield self.END
                          self.end = False
                      self.start = True
                  yield char
  
          if not part and self.start:
              if not self.end and self.default_end is not None:
                  yield self.default_end
              yield self.END
              self.reset()
docs: Scan a string.
  
          Parameters
          ----------
          data : `str`
              String to scan.
          part : `bool`
              True if data is partial.
  
          Returns
          -------
          `generator` of (`str` or `markovchain.scanner.Scanner.END`)
              Token generator.