txlyre hace 1 semana
padre
commit
a70d963aad
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      markov.py

+ 3 - 0
markov.py

@@ -35,6 +35,9 @@ class Markov:
         if not words:
             return self.generate()
 
+        if init_state:
+            words = list(init_state) + words
+
         text = ""
         for word in words:
             if word in "-–—" or not all(c in string.punctuation for c in word):