diff --git a/tagger.py b/tagger.py index 015bbcb..5848d5d 100644 --- a/tagger.py +++ b/tagger.py @@ -8,6 +8,7 @@ from pathlib import Path from exclude import EXCLUDED_WORDS SOURCE_DIR = Path('data') +SOURCE_FILENAME = 'index.txt' OUTPUT_FILE = 'tags.json' TAGS_PER_ARTICLE = 5 JSON_INDENT = 2 @@ -126,7 +127,8 @@ def read_file(file: Path) -> str: def main(): final_tags = {} - for file in SOURCE_DIR.glob('**/index.txt'): # Nach allen index.txt Dateien suchen + # Nach allen Quelldateien suchen + for file in SOURCE_DIR.glob(f'**/{SOURCE_FILENAME}'): # Die Dateien, deren Ordner mit 'autosave-' beginnen, ignorieren. title = file.parent.name if title.startswith('autosave-'):