code: def get_unique_clause_indices( text ):
      ''' Returns a list of clause indices for the whole text. For each token in text, 
          the list contains index of the clause the word belongs to, and the indices
          are unique over the whole text. '''
      # Add clause boundary annotation (if missing)
      if not text.is_tagged( CLAUSES ):
          text.tag_clauses()
      # Collect (unique) clause indices over the whole text
      clause_indices = []
      sent_id = 0
      for sub_text in text.split_by( SENTENCES ):
          for word, cl_index in zip( sub_text.words, sub_text.clause_indices ):
              clause_indices.append( sent_id+cl_index )
          nr_of_clauses = len(set(sub_text.clause_indices))
          sent_id += nr_of_clauses
      assert len(clause_indices) == len(text.words), '(!) Number of clause indices should match nr of words!'
      return clause_indicef get_unique_clause_indices( text ):
      ''' Returns a list of clause indices for the whole text. For each token in text, 
          the list contains index of the clause the word belongs to, and the indices
          are unique over the whole text. '''
      # Add clause boundary annotation (if missing)
      if not text.is_tagged( CLAUSES ):
          text.tag_clauses()
      # Collect (unique) clause indices over the whole text
      clause_indices = []
      sent_id = 0
      for sub_text in text.split_by( SENTENCES ):
          for word, cl_index in zip( sub_text.words, sub_text.clause_indices ):
              clause_indices.append( sent_id+cl_index )
          nr_of_clauses = len(set(sub_text.clause_indices))
          sent_id += nr_of_clauses
      assert len(clause_indices) == len(text.words), '(!) Number of clause indices should match nr of words!'
      return clause_indices
docs: Returns a list of clause indices for the whole text. For each token in text, 
          the list contains index of the clause the word belongs to, and the indices
          are unique over the whole text.