txlyre 1 هفته پیش
والد
کامیت
a70d963aad
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  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):