Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from markovbot import MarkovBot
- # Initialise the MarkovBot instance in your script
- trumpbot = MarkovBot()
- # Get the current directory's path
- dirname = os.path.dirname(os.path.abspath(__file__))
- # We need the bot to read the book... but what is the filepath to the book?
- book = os.path.join(dirname, 'trump.txt')
- # Bot, go read a book!
- trumpbot.read(book)
- my_first_text = trumpbot.generate_text(65, seedword=[])
- print("trumpbot says:")
- print(my_first_text)
Add Comment
Please, Sign In to add comment