Skip to content

Instantly share code, notes, and snippets.

@tasdikrahman
Created May 7, 2017 11:19
Show Gist options
  • Save tasdikrahman/a2268fd81815e8bef2da03579d855b17 to your computer and use it in GitHub Desktop.
Save tasdikrahman/a2268fd81815e8bef2da03579d855b17 to your computer and use it in GitHub Desktop.
>>> from markovipy.markovipy import MarkoviPy
>>>
>>> obj = MarkoviPy("/Users/tasrahma/development/projects/markovipy/corpus/shakespeare/hamlet_utf8.txt", 3)
>>> obj.generate_sentence()
'If his occulted guilt, Do not it selfe vnkennell in one speech, It is most retrograde to our desire And we beseech you, bend you to remaine Heere in the cheere and comfort of our eye, Our cheefest Courtier Cosin, and our whole Kingdome To be contracted in one brow of woe Yet so farre hath Discretion fought with Nature, That we with wisest sorrow thinke on him, Together with remembrance of our selues.'
>>> obj.generate_sentence()
'Fare you well my Lord Ham.'
>>> obj.generate_sentence()
'To thinke, my Lord? Ham.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment