unidecode markov blabbers

This commit is contained in:
Tomáš Mládek 2019-12-17 13:31:55 +01:00
parent 902a49dcb2
commit 6311672c9e
3 changed files with 6 additions and 4 deletions

View file

@ -28,6 +28,7 @@ import telegram
import youtube_dl import youtube_dl
from mutagen.easyid3 import EasyID3 from mutagen.easyid3 import EasyID3
from telegram.ext import Updater, CommandHandler, MessageHandler from telegram.ext import Updater, CommandHandler, MessageHandler
from unidecode import unidecode
from youtube_dl import DownloadError from youtube_dl import DownloadError
from youtube_dl.version import __version__ as YTDL_VERSION from youtube_dl.version import __version__ as YTDL_VERSION
@ -760,7 +761,7 @@ class MarkovBlabberer:
with open(filepath) as f: with open(filepath) as f:
text = f.read() text = f.read()
self.markov = markovify.NewlineText(text.lower()) self.markov = markovify.NewlineText(unidecode(text.lower()))
self.logger.info("Sentence of the day: " + self.make_sentence()) self.logger.info("Sentence of the day: " + self.make_sentence())
def make_sentence(self, tries=100): def make_sentence(self, tries=100):

View file

@ -6,3 +6,4 @@ mutagen
pyacoustid pyacoustid
pytumblr pytumblr
markovify markovify
unidecode

View file

@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile # This file is autogenerated by pip-compile
# To update, run: # To update, run:
# #
# pip-compile --upgrade # pip-compile
# #
asn1crypto==0.24.0 # via cryptography asn1crypto==0.24.0 # via cryptography
audioread==2.1.8 # via pyacoustid audioread==2.1.8 # via pyacoustid
@ -23,6 +23,6 @@ pytumblr==0.0.8
requests-oauthlib==1.2.0 # via pytumblr requests-oauthlib==1.2.0 # via pytumblr
requests==2.22.0 requests==2.22.0
six==1.12.0 # via cryptography six==1.12.0 # via cryptography
unidecode==1.0.23 # via markovify unidecode==1.0.23
urllib3==1.25.3 # via requests urllib3==1.25.3 # via requests
youtube-dl==2019.5.20 youtube-dl==2019.5.20