|
@@ -32,6 +32,8 @@ class Markov:
|
|
|
def rebuild(self):
|
|
|
self.chain = markovify.Chain(self.corpus, config.MARKOV_STATE_SIZE).compile()
|
|
|
|
|
|
+ self.counter = 0
|
|
|
+
|
|
|
def extend_corpus(self, text):
|
|
|
text = text.strip()
|
|
|
if not text:
|
|
@@ -51,8 +53,6 @@ class Markov:
|
|
|
self.counter += 1
|
|
|
|
|
|
if self.counter % config.MARKOV_REBUILD_RATE == 0:
|
|
|
- self.counter = 0
|
|
|
-
|
|
|
self.rebuild()
|
|
|
|
|
|
def load(self):
|