def main(): k = int(sys.argv[1]) T = int(sys.argv[2]) text = sys.stdin.read() model = MarkovModel(text, k) z = model.gen(text[:k], T) stdio.writeln(z)
def main(): # Create a Markov model named model using text and k. model = MarkovModel(text, k) # Use model.gen() to generate a random text of length T and # starting with the first k characters of text. rand = model.gen(text[:k], T) # Write the random text to standard output. stdio.writeln(rand)
def main(): k, t = int(sys.argv[1]), int(sys.argv[2]) text = sys.stdin.read() model = MarkovModel(text, k) kgram = text[:k] print(model.gen(kgram, t))
def main(): k, T = int(sys.argv[1]), int(sys.argv[2]) txt = sys.stdin.read() model = MarkovModel(txt, k) stdio.writeln(model.gen(txt[:k], T))