Markov chain text generator: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
Hout (talk | contribs)
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):
'''Word-hashed nGram dict -> opening words -> end condition -> text'''
'''nGram-hashed word dict -> opening words -> end condition -> text'''


n = len(list(dct.keys())[0].split())
n = len(list(dct.keys())[0].split())