1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

fix bug and slip

This commit is contained in:
Steffo 2020-01-09 03:34:27 +01:00
parent 2a0714b8b8
commit caa2fff26c

View file

@ -19,6 +19,8 @@ class MarkovCommand(Command):
files: List[str] = tuple(os.walk(self.config["Markov"]["models_directory"]))[0][2] files: List[str] = tuple(os.walk(self.config["Markov"]["models_directory"]))[0][2]
for file in files: for file in files:
match = re.match("(\S+)\.json", file) match = re.match("(\S+)\.json", file)
if match is None:
continue
model_name = match.group(1) model_name = match.group(1)
with open(os.path.join(self.config["Markov"]["models_directory"], file)) as f: with open(os.path.join(self.config["Markov"]["models_directory"], file)) as f:
self._texts[model_name] = markovify.NewlineText.from_json(f.read()) self._texts[model_name] = markovify.NewlineText.from_json(f.read())