mirror of
https://github.com/borbann-platform/backend-api.git
synced 2025-12-18 12:14:05 +01:00
23 lines
479 B
Python
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.
|
|
"""
|
|
... |