Maturevan.22.05.13.valentina.ross.left.naked.on... Online
# Example usage: file_path = "MatureVan.22.05.13.Valentina.Ross.Left.Naked.On..." tags = categorize_content(file_path) print(tags) # Output: [('mature', 'Mature'), ('person', 'Valentina'), ('person', 'Ross')]
"Content Categorization and Tagging"
import os import re
Develop a feature that can automatically categorize and tag content based on predefined criteria. This feature can be useful for organizing and filtering large datasets or collections of files. MatureVan.22.05.13.Valentina.Ross.Left.Naked.On...
def categorize_content(file_path): # Extract tags from filename filename = os.path.basename(file_path) tags = re.findall(r'\.(.+?)\.', filename) # Define categories and tags categories = { 'mature': ['mature', 'adult'], 'person': ['person', 'woman', 'man'] } # Categorize content categorized_tags = [] for tag in tags: for category, keywords in categories.items(): if tag.lower() in keywords: categorized_tags.append((category, tag)) return categorized_tags # Example usage: file_path = "MatureVan