5 def print_tokens(token_list, outfile=sys.stdout, encoding=None):
7 outfile = getattr(outfile, 'buffer', outfile)
8 for token in token_list.flatten():
9 normalized = token.normalized
11 normalized = normalized.encode(encoding)
12 outfile.write(normalized)
15 def tlist2str(token_list):
16 return u''.join(token.normalized for token in token_list.flatten())