mcmc.py 文件源码

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

项目:MCMC-Metropolis-Hastings-Decryption 作者: jhell96 项目源码 文件源码
def create_mapping_from_cipher(cipher):
    """
    Creates the mapping between the alphabet string and the cipher string

    Inputs
    ------
    cipher : a string, in which order matters, that is mapped to from the alphabet in the 
             encrypted document i.e. abcdefg.. -> udhjenk...

    Returns
    -------
    a dictionary in which each key is a letter of the alphabet, and each value is
    the corresponding letter in the cipher
    """
    charset = list(string.lowercase)
    return {charset.pop(0):elem for elem in cipher}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号