feat: Add HDR extraction from filename and update tests

This commit is contained in:
sha
2025-12-26 13:51:12 +00:00
parent 91df347727
commit 3ecffc0d3c
4 changed files with 31 additions and 7 deletions
+13 -1
View File
@@ -76,4 +76,16 @@ class FilenameExtractor:
if re.search(r'\b' + re.escape(indicator) + r'\b', self.file_name, re.IGNORECASE):
return 'Unclassified'
return 'Unclassified'
return 'Unclassified'
def extract_hdr(self) -> str | None:
"""Extract HDR information from filename"""
# Check for SDR first - indicates no HDR
if re.search(r'\bSDR\b', self.file_name, re.IGNORECASE):
return None
# Check for HDR, but not NoHDR
if re.search(r'\bHDR\b', self.file_name, re.IGNORECASE) and not re.search(r'\bNoHDR\b', self.file_name, re.IGNORECASE):
return 'HDR'
return None