Markov chain text generator: Difference between revisions
Content deleted Content added
m →Functional Python: Edited an in-line comment string |
|||
Line 1,039: | Line 1,039: | ||
# markovText :: Dict -> [String] -> ([String] -> Bool) -> IO [String] |
# markovText :: Dict -> [String] -> ([String] -> Bool) -> IO [String] |
||
def markovText(dct): |
def markovText(dct): |
||
''' |
'''nGram-hashed word dict -> opening words -> end condition -> text''' |
||
n = len(list(dct.keys())[0].split()) |
n = len(list(dct.keys())[0].split()) |