From: Neil Smith Date: Sat, 5 Jul 2014 13:14:38 +0000 (+0100) Subject: Updated language_models to include trigrams X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=8e18e9342d15e7373cb904fba1157ce78a1e89af;p=cipher-training.git Updated language_models to include trigrams --- diff --git a/language_models.py b/language_models.py index 173de64..59d8588 100644 --- 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): - """The Naive Bayes log probability of the bigrams formed from a sequence + """The Naive Bayes log probability of the trigrams formed from a sequence of letters. """ return sum(P3l[p] for p in ngrams(letters, 3))