X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=segment.py;h=bd15e00e41913aa5115da546fb70215143341df2;hb=84f8833b49b5fc8d1195e831753e01b203552e3e;hp=712895b6b0d7f1563ee4149fe7d94445a3931233;hpb=2985cc355e868951a2755be23d3503b05ba17ea7;p=cipher-tools.git diff --git a/segment.py b/segment.py index 712895b..bd15e00 100644 --- a/segment.py +++ b/segment.py @@ -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.