Update text-gen

This commit is contained in:
Dominic Zimmer 2023-06-14 11:00:25 +02:00
parent 642c24108e
commit 43c2a1a326
2 changed files with 12333 additions and 1 deletions

12326
hp/hodbook.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,10 @@
#!/bin/python3
import sys
if len(sys.argv) < 2:
print(sys.argv)
exit("Please provide a filename as argument")
filename = sys.argv[-1]
def colorize(word):
return f"\u001b[0;33m{word}\u001b[0m"
@ -16,7 +22,7 @@ import re
chapter_pattern = re.compile("^CHAPTER")
page_pattern = re.compile("^\d+$")
with open("hp.txt") as f:
with open(filename) as f:
lines = f.readlines()
print("Stripping excess data")