Vigenere cipher breaking now with frequency analysis
[cipher-tools.git] / segment.py
index 712895b6b0d7f1563ee4149fe7d94445a3931233..bd15e00e41913aa5115da546fb70215143341df2 100644 (file)
@@ -24,7 +24,7 @@ def splits(text, L=20):
 def Pwords(words): 
     """The Naive Bayes log probability of a sequence of words.
     """
-    return sum(Pw[w] for w in words)
+    return sum(Pw[w.lower()] for w in words)
 
 class Pdist(dict):
     """A probability distribution estimated from counts in datafile.