Merge branch 'transpositions' of git.njae.me.uk:national-cipher-challenge into transp...
[cipher-tools.git] / segment.py
index 712895b6b0d7f1563ee4149fe7d94445a3931233..dd0b2a8347ee800c4addf996f369ea0293b47bb7 100644 (file)
@@ -1,4 +1,3 @@
-# import re, string, random, glob, operator, heapq
 import string
 import collections
 from math import log10
@@ -24,7 +23,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.