code: def set_text(node, text, strategy):
      
      text = text.strip()
      textEquivs = node.get_TextEquiv()
      if not textEquivs:
          node.add_TextEquiv(TextEquivType(Unicode=text))
      #  elif strategy == 'index1':
      else:
          if len(textEquivs) > 1:
              index1 = [x for x in textEquivs if x.index == 1]
              if index1:
                  index1[0].set_Unicode(text)
                  return
          textEquivs[0].set_Unicode(text)
docs: Set the most confident text results, either those with @index = 1, the first text results or add new one.