projects
/
cipher-training.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e0ea589
)
Updated language_models to include trigrams
author
Neil Smith
<neil.git@njae.me.uk>
Sat, 5 Jul 2014 13:14:38 +0000
(14:14 +0100)
committer
Neil Smith
<neil.git@njae.me.uk>
Sat, 5 Jul 2014 13:14:38 +0000
(14:14 +0100)
language_models.py
patch
|
blob
|
history
diff --git
a/language_models.py
b/language_models.py
index 173de64c18c39b40beb2bbe1c208dfc50dede48f..59d858868dd5b67d5de9dd848fe26d6b5f1c6391 100644
(file)
--- a/
language_models.py
+++ b/
language_models.py
@@
-148,7
+148,7
@@
def Pbigrams(letters):
return sum(P2l[p] for p in ngrams(letters, 2))
def Ptrigrams(letters):
return sum(P2l[p] for p in ngrams(letters, 2))
def Ptrigrams(letters):
- """The Naive Bayes log probability of the
b
igrams formed from a sequence
+ """The Naive Bayes log probability of the
tr
igrams formed from a sequence
of letters.
"""
return sum(P3l[p] for p in ngrams(letters, 3))
of letters.
"""
return sum(P3l[p] for p in ngrams(letters, 3))