hu2004.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:opminreplicability 作者: epochx 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号