utils.py 文件源码

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

项目:resume-optimizer 作者: mhbuehler 项目源码 文件源码
def extract_acronyms(textblob):
    """Creates a list of words beginning with at least 2 capital letters that are not regular English words,
    in descending order of frequency. enchant dictionary returns True if word is an English word."""
    d = enchant.Dict("en_US")
    words = textblob.words
    counts = []
    for word in words:
        if len(word) > 1:
            if word[0].isupper() and word[1].isupper() and word not in [p[0] for p in counts]:
                if not d.check(word):
                    counts.append((word, textblob.words.count(word)))

    return counts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号