diff --git a/text.py b/text.py index 991c764d9..27c6a9406 100644 --- a/text.py +++ b/text.py @@ -60,7 +60,7 @@ def add_sequence(self, words): n = self.n words = self.add_empty(words, n) - for i in range(len(words) - n): + for i in range(len(words) - n + 1): self.add(tuple(words[i:i + n])) def samples(self, nwords): @@ -80,7 +80,7 @@ def samples(self, nwords): class NgramCharModel(NgramTextModel): def add_empty(self, words, n): - return ' ' * (n - 1) + words + return ' ' * (n - 1) + words def add_sequence(self, words): for word in words:
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: