docs: def get_text(obj) -> Tuple[int, str]:
      """
      Return text with its offset in the document
  
      Args:
          obj: BioCDocument, BioCPassage, or BioCSentence
  
      Returns:
          offset, text
      """
      from bioc.bioc import BioCDocument, BioCPassage, BioCSentence
  
      if isinstance(obj, BioCSentence):
          return obj.offset, obj.text
      if isinstance(obj, BioCPassage):
          if obj.text:
              return obj.offset, obj.text
          text = ''
          for sentence in obj.sentences:
              try:
                  text = pad_char(text, sentence.offset - obj.offset, ' ')
                  assert sentence.text, f'BioC sentence has no text: {sentence.offset}'
                  text += sentence.text
              except ValueError:
                  raise ValueError(f'Overlapping sentences {sentence.offset}')
          return obj.offset, text
      if isinstance(obj, BioCDocument):
          text = ''
          for passage in obj.passages:
              try:
                  text = pad_char(text, passage.offset)
                  text += get_text(passage)[1]
              except ValueError:
                  raise ValueError(f'{obj.id}: overlapping passages {passage.offset}')
          return 0, text
      raise TypeError(f'Object of type {obj.__class__.__name__} must be BioCCollection, '
                      f'BioCDocument, BioCPassage, or BioCSentence')