code: def texts_from_spans(self, spans, sep=' '):
          
          text = self.text
          texts = []
          for start, end in spans:
              if isinstance(start, list):
                  texts.append(sep.join(text[s:e] for s, e in zip(start, end)))
              else:
                  texts.append(text[start:end])
          return texts
docs: Retrieve texts from a list of (start, end) position spans.
  
          Parameters
          ----------
  
          sep: str
              Separator for multilayer elements (default: ' ').
  
          Returns
          -------
          list of str
              List of strings that correspond to given spans.