code: def _helper_wrefs(self, targets, recurse=True):
          
          for c in self:
              if isinstance(c,Word) or isinstance(c,Morpheme) or isinstance(c, Phoneme):
                  targets.append(c)
              elif isinstance(c,WordReference):
                  try:
                      targets.append(self.doc[c.id]) #try to resolve
                  except KeyError:
                      targets.append(c) #add unresolved
              elif isinstance(c, AbstractSpanAnnotation) and recurse:
                  #recursion
                  c._helper_wrefs(targets) #pylint: disable=protected-access
              elif isinstance(c, Correction) and c.auth: #recurse into corrections
                  for e in c:
                      if isinstance(e, AbstractCorrectionChild) and e.auth:
                          for e2 in e:
                              if isinstance(e2, AbstractSpanAnnotation):
                                  #recursion
                                  e2._helper_wrefs(targets)
docs: Internal helper function