projects
/
cipher-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fiddling with cracking dictionaries
[cipher-tools.git]
/
segment.py
diff --git
a/segment.py
b/segment.py
index 712895b6b0d7f1563ee4149fe7d94445a3931233..dd0b2a8347ee800c4addf996f369ea0293b47bb7 100644
(file)
--- a/
segment.py
+++ b/
segment.py
@@
-1,4
+1,3
@@
-# import re, string, random, glob, operator, heapq
import string
import collections
from math import log10
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.
"""
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.
class Pdist(dict):
"""A probability distribution estimated from counts in datafile.