Anonymous user
Markov chain text generator: Difference between revisions
Minor edits to my old Python implementation.
(Added Wren) |
(Minor edits to my old Python implementation.) |
||
Line 1,095:
Usage: markov.py source.txt context length
<lang python>
contents = f.read()▼
def makerule(data, context):
Line 1,145 ⟶ 1,135:
if __name__ == '__main__':
rule = makerule(data, int(sys.argv[2]))
string = makestring(rule, int(sys.argv[3]))
|