From e4ccfeb116272cbc060ec3beb227d5076c4ab882 Mon Sep 17 00:00:00 2001 From: Rashi Date: Sat, 17 Dec 2016 19:52:44 +0530 Subject: [PATCH] Corrections made in the triple qouted strings --- text.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/text.py b/text.py index 57a19d2ab..f96831d5f 100644 --- a/text.py +++ b/text.py @@ -59,7 +59,7 @@ def add_sequence(self, words): self.add(tuple(words[i:i + n])) def samples(self, nwords): - """Build up a random sample of text nwords words long, using + """Build up a random sample of text onwords words long, using the conditional probability given the n-1 preceding words.""" n = self.n nminus1gram = ('',) * (n-1) @@ -319,7 +319,7 @@ def all_shifts(text): class PermutationDecoder: - """This is a much harder problem than the shift decoder. There are 26! + """This is a much harder problem than the shift decoder. There are 26! permutations, so we can't try them all. Instead we have to search. We want to search well, but there are many things to consider: Unigram probabilities (E is the most common letter); Bigram probabilities @@ -339,7 +339,7 @@ def __init__(self, training_text, ciphertext=None): self.P2 = NgramTextModel(2, training_text) # By letter pair def decode(self, ciphertext): - "Search for a decoding of the ciphertext." + "Searching for a decoding of the ciphertext." self.ciphertext = ciphertext problem = PermutationDecoderProblem(decoder=self) return search.best_first_tree_search(