|
@@ -38,10 +38,12 @@ class Markov:
|
|
|
|
|
|
if size < config.MARKOV_STATE_SIZE:
|
|
if size < config.MARKOV_STATE_SIZE:
|
|
init_state = (markovify.chain.BEGIN,) * (config.MARKOV_STATE_SIZE - size) + init_state
|
|
init_state = (markovify.chain.BEGIN,) * (config.MARKOV_STATE_SIZE - size) + init_state
|
|
-
|
|
|
|
|
|
+ elif size > config.MARKOV_STATE_SIZE:
|
|
|
|
+ init_state = init_state[:-config.MARKOV_STATE_SIZE]
|
|
|
|
+
|
|
words = self.chain.walk(init_state)
|
|
words = self.chain.walk(init_state)
|
|
if not words:
|
|
if not words:
|
|
- return self.generate()
|
|
|
|
|
|
+ return self.generate(init_state)
|
|
|
|
|
|
text = orig_init_state if orig_init_state is not None else ""
|
|
text = orig_init_state if orig_init_state is not None else ""
|
|
for word in words:
|
|
for word in words:
|