def s_one_pre(topics):
 s_one_pre = []
 for top_words in topics:
  s_one_pre_t = []
  for (w_prime_index, w_prime) in enumerate(top_words[1:]):
   for w_star in top_words[:(w_prime_index + 1)]:
    s_one_pre_t.append((w_prime, w_star))
  s_one_pre.append(s_one_pre_t)
 return s_one_pre

def s_one_pre ( topics ) : s_one_pre = [ ] for top_words in topics : s_one_pre_t = [ ] for ( w_prime_index , w_prime ) in enumerate ( top_words [ 1 : ] ) : for w_star in top_words [ : ( w_prime_index + 1 ) ] : s_one_pre_t . append ( ( w_prime , w_star ) ) s_one_pre . append ( s_one_pre_t ) return s_one_pre
this function performs s_one_pre segmentation on a list of topics .