def adjective_fuzzy_matching(token, adjectives, match):
"""
Given a token and a list of terms to match, returns True if
the stem of the token matches any of the items in the list.
Input:
token: Token object to match
adjectives: list of items to match the Token
match: minimum ratio (0-100) for matching
"""
for adjective in adjectives:
if Levenshtein.ratio(str(token.stem), str(adjective)) >= match:
return True
return False
评论列表
文章目录