def token_list_to_text ( tokenlist ) : ZeroWidthEscape = Token . ZeroWidthEscape return '' . join ( item [ 1 ] for item in tokenlist if item [ 0 ] != ZeroWidthEscape )
strips all leading and trailing space of each token in python list
Concatenate all the text parts again .
def token_list_to_text(tokenlist):
    """
    Concatenate all the text parts again.
    """
    ZeroWidthEscape = Token.ZeroWidthEscape
    return ''.join(item[1] for item in tokenlist if item[0] != ZeroWidthEscape)