clisaurus.py 文件源码

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

项目:clisaurus 作者: steffenkarlsson 项目源码 文件源码
def present_synonyms(synonym_groups, query):
    table = defaultdict(list)
    for sg in sorted(synonym_groups.keys()):
        synonyms = synonym_groups[sg]
        table[sg] = [COLORS[category - 1] + word
                     for category in sorted(synonyms.keys(), reverse=True)
                     for word in sorted(synonyms[category])]
        table[sg].append(Fore.WHITE + "")

    print ">> Results from searching: %s, where the first row denotes the context of where the synonyms are used.\n" % query
    print tabulate(table, tablefmt="rst", headers="keys")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号