Markov chain text generator: Difference between revisions

m
Line 1,069:
# main :: IO ()
def main():
nGramLength = 23
dctNGrams = markovRules(nGramLength)(
readFile(getcwd() + '/' + 'alice_oz.txt').split()
Line 1,138:
# zipWithN :: (a -> b -> ... -> c) -> ([a], [b] ...) -> [c]
def zipWithN(f):
return lambda tplListsxs: list(
starmap(f, zip(*tplListsxs))
)
 
9,655

edits