本文整理汇总了Python中markov.Markov.generate_markov_text_quadrograms方法的典型用法代码示例。如果您正苦于以下问题:Python Markov.generate_markov_text_quadrograms方法的具体用法?Python Markov.generate_markov_text_quadrograms怎么用?Python Markov.generate_markov_text_quadrograms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类markov.Markov
的用法示例。
在下文中一共展示了Markov.generate_markov_text_quadrograms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Markov
# 需要导入模块: from markov import Markov [as 别名]
# 或者: from markov.Markov import generate_markov_text_quadrograms [as 别名]
from markov import Markov
mm = Markov("heiseticker-text.txt")
print("###############")
print("### bigrams ###")
print("###############")
print("Markov chain text of size {}:\n{}\n".format(10, mm.generate_markov_text_bigrams(10)))
print("Markov chain text of size {}:\n{}\n".format(20, mm.generate_markov_text_bigrams(20)))
print("Markov chain text of size {}:\n{}\n".format(30, mm.generate_markov_text_bigrams(30)))
print("Markov chain text of size {}:\n{}\n".format(40, mm.generate_markov_text_bigrams(40)))
print("################")
print("### trigrams ###")
print("################")
print("Markov chain text of size {}:\n{}\n".format(10, mm.generate_markov_text_trigrams(10)))
print("Markov chain text of size {}:\n{}\n".format(20, mm.generate_markov_text_trigrams(20)))
print("Markov chain text of size {}:\n{}\n".format(30, mm.generate_markov_text_trigrams(30)))
print("Markov chain text of size {}:\n{}\n".format(40, mm.generate_markov_text_trigrams(40)))
print("###################")
print("### quadrograms ###")
print("###################")
print("Markov chain text of size {}:\n{}\n".format(10, mm.generate_markov_text_quadrograms(10)))
print("Markov chain text of size {}:\n{}\n".format(20, mm.generate_markov_text_quadrograms(20)))
print("Markov chain text of size {}:\n{}\n".format(30, mm.generate_markov_text_quadrograms(30)))
print("Markov chain text of size {}:\n{}\n".format(40, mm.generate_markov_text_quadrograms(40)))