This commit is contained in:
mike
2025-12-13 11:56:06 +01:00
commit 2b2c575385
57 changed files with 6505 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from typing import Protocol, Optional
from pathlib import Path
from dataclasses import dataclass
@dataclass
class ClassificationRule:
name: str
category: str
patterns: list[str]
priority: int = 0
description: str = ''
class IClassifier(Protocol):
def classify(self, path: Path, file_type: Optional[str]=None) -> Optional[str]:
...
def get_category_rules(self, category: str) -> list[ClassificationRule]:
...
class IRuleEngine(Protocol):
def add_rule(self, rule: ClassificationRule) -> None:
...
def remove_rule(self, rule_name: str) -> None:
...
def match_path(self, path: Path) -> Optional[str]:
...