WrenP-Complete

TrumpBot

Oct 5th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. import os
  2. from markovbot import MarkovBot
  3. # Initialise the MarkovBot instance in your script
  4. trumpbot = MarkovBot()
  5. # Get the current directory's path
  6. dirname = os.path.dirname(os.path.abspath(__file__))
  7. # We need the bot to read the book... but what is the filepath to the book?
  8. book = os.path.join(dirname, 'trump.txt')
  9. # Bot, go read a book!
  10. trumpbot.read(book)
  11. my_first_text = trumpbot.generate_text(65, seedword=[])
  12. print("trumpbot says:")
  13. print(my_first_text)
Add Comment
Please, Sign In to add comment