feat: Enhance title normalization by replacing dots with spaces and add test case for multi-dot filenames

This commit is contained in:
sha
2026-01-03 16:13:50 +00:00
parent 0ec1fbe4db
commit 06cf206c70
5 changed files with 34 additions and 9 deletions
+8 -1
View File
@@ -125,7 +125,14 @@ class FilenameExtractor:
# Clean up title: remove leading/trailing brackets and dots
title = title.strip('[](). ')
# Replace dots with spaces if they appear to be word separators
# Only replace dots that are surrounded by letters/digits (not at edges)
title = re.sub(r'(?<=[a-zA-Z0-9À-ÿ])\.(?=[a-zA-Z0-9À-ÿ])', ' ', title)
# Clean up multiple spaces
title = re.sub(r'\s+', ' ', title).strip()
return title if title else None
@cached_method()