Updated language_models to include trigrams
authorNeil Smith <neil.git@njae.me.uk>
Sat, 5 Jul 2014 13:14:38 +0000 (14:14 +0100)
committerNeil Smith <neil.git@njae.me.uk>
Sat, 5 Jul 2014 13:14:38 +0000 (14:14 +0100)
language_models.py

index 173de64c18c39b40beb2bbe1c208dfc50dede48f..59d858868dd5b67d5de9dd848fe26d6b5f1c6391 100644 (file)
@@ -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))