def lstrip_token(token):
'''Strips some characters from the left side of a token
Characters which have a type listed in CATEGORIES_TO_STRIP_FROM_TOKENS
are stripped from the left side of a token.
The stripped token is returned.
:param token: The token where characters may be stripped from
:type token: String
:rtype: String
Examples:
>>> lstrip_token(".'foo'.")
"foo'."
'''
token = token.lstrip()
while (len(token) > 0
and
unicodedata.category(token[0]) in CATEGORIES_TO_STRIP_FROM_TOKENS):
token = token[1:]
return token
评论列表
文章目录