build_dictionary.py 文件源码

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

项目:samnorsk 作者: gisleyt 项目源码 文件源码
def compare(tokens, trans_tokens):
    pairs = []

    same_len = len(tokens) == len(trans_tokens)
    consecutive = False

    for a, b in zip(tokens, trans_tokens):
        if a != b:
            if consecutive and not same_len:
                break

            if not consecutive:
                consecutive = True

            pairs.append((a, b))
        else:
            consecutive = False

    return pairs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号