Skip to content

Instantly share code, notes, and snippets.

@justincosentino
Last active August 29, 2015 14:18
Show Gist options
  • Save justincosentino/009245069bb66d648b96 to your computer and use it in GitHub Desktop.
Save justincosentino/009245069bb66d648b96 to your computer and use it in GitHub Desktop.
def bootstrapDecipher(decipher, encoded_string, encoded_numeric, transition_matrix):
decoded_numeric = [decipher[s] for s in encoded_numeric]
decoded_string = numeric_to_text(decoded_numeric)
current_plausibility = plausibility(transition_matrix, decoded_string)
print ("Bootstrapping ", end="")
while current_plausibility == 0:
random.shuffle(decipher)
decoded_numeric = [decipher[s] for s in encoded_numeric]
decoded_string = numeric_to_text(decoded_numeric)
current_plausibility = plausibility(transition_matrix, decoded_string)
print (".", end="")
print ("DONE!")
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment