Removed spurious affine tests
authorNeil Smith <neil.github@njae.me.uk>
Mon, 7 Oct 2013 13:46:41 +0000 (14:46 +0100)
committerNeil Smith <neil.github@njae.me.uk>
Mon, 7 Oct 2013 13:46:41 +0000 (14:46 +0100)
cipher.py

index b086a5d98c671bce6e401f0bc9f0ebf184454df8..9bec231335d73aaaa7851058f835f75a1293d0a1 100644 (file)
--- a/cipher.py
+++ b/cipher.py
@@ -178,14 +178,7 @@ def caesar_break(message, metric=norms.euclidean_distance, target_frequencies=no
     return best_shift, best_fit
 
 def affine_break(message, metric=norms.euclidean_distance, target_frequencies=normalised_english_counts, message_frequency_scaling=norms.normalise):
-    """Breaks a Caesar cipher using frequency analysis
-    
-    >>> caesar_break('ibxcsyorsaqcheyklxivoexlevmrimwxsfiqevvmihrsasrxliwyrhecjsppsamrkwleppfmergefifvmhixscsymjcsyqeoixlm')
-    (4, 0.3186395289018361)
-    >>> caesar_break('wxwmaxdgheetgwuxztgptedbgznitgwwhpguxyhkxbmhvvtlbhgteeraxlmhiixweblmxgxwmhmaxybkbgztgwztsxwbgmxgmert')
-    (19, 0.4215290123583277)
-    >>> caesar_break('yltbbqnqnzvguvaxurorgenafsbezqvagbnornfgsbevpnaabjurersvaquvzyvxrnznazlybequrvfohgriraabjtbaruraprur')
-    (13, 0.31602920807545154)
+    """Breaks an affine cipher using frequency analysis
     """
     sanitised_message = sanitise(message)
     best_multiplier = 0