code: def _label_generalized(self, node):
          
          if node.is_leaf():
              x = {self._get_word_start_index(node.idx)}
          else:
              x = {n for ns in node.transition_links for n in ns[0].generalized_idxs}
          node.generalized_idxs = x
docs: Helper method that labels the nodes of GST with indexes of strings
          found in their descendants.