backend-api/normalization/base.py
2025-04-20 19:46:54 +07:00

23 lines
479 B
Python

"""
Base module defining protocols for the normalization layer.
"""
from typing import Protocol, Dict, Any
class TextExtractor(Protocol):
"""
Protocol for text extraction strategies.
"""
def extract(self, record: Dict[str, Any]) -> str:
"""
Extract and return text from a flattened record.
Args:
record: A flattened record dict.
Returns:
A string containing the extracted text.
"""
...