correct hitler_words and start analysis

This commit is contained in:
2021-08-02 15:02:25 +02:00
parent 88a62a22d7
commit 75042d7128
4 changed files with 7884 additions and 24905 deletions
+7755 -24901
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -21,17 +21,17 @@ def get_words_from_line(line):
hitler_words = []
for i in range(1, 7):
with open(f'hitler_texts/hitler_rede_{i}') as f:
with open(f'hitler_rede_{i}') as f:
lines = f.readlines()
for line in lines:
hitler_words.extend(get_words_from_line(line))
with open(f'hitler_texts/goebbels_sportpalast') as f:
with open(f'goebbels_sportpalast') as f:
lines = f.readlines()
for line in lines:
hitler_words.extend(get_words_from_line(line))
with open(f'hitler_texts/mein_kampf') as f:
with open(f'mein_kampf') as f:
lines = f.readlines()
for line in lines:
hitler_words.extend(get_words_from_line(line))
@@ -47,6 +47,6 @@ with open("german_words", "w") as f:
f.write(word)
with open("hitler_words", "w") as f:
for word in hitler_words:
for word in only_hitler_words:
word += "\n"
f.write(word)