Re-structure the project.
This commit is contained in:
42
src/matcher/strategies/base.py
Normal file
42
src/matcher/strategies/base.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
Base class for matching strategies.
|
||||
"""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from ..models import TokenLike, Match
|
||||
from ..token_index import TokenIndex
|
||||
|
||||
|
||||
class BaseMatchStrategy(ABC):
|
||||
"""Base class for all matching strategies."""
|
||||
|
||||
def __init__(self, context_radius: float = 200.0):
|
||||
"""
|
||||
Initialize the strategy.
|
||||
|
||||
Args:
|
||||
context_radius: Distance to search for context keywords
|
||||
"""
|
||||
self.context_radius = context_radius
|
||||
|
||||
@abstractmethod
|
||||
def find_matches(
|
||||
self,
|
||||
tokens: list[TokenLike],
|
||||
value: str,
|
||||
field_name: str,
|
||||
token_index: TokenIndex | None = None
|
||||
) -> list[Match]:
|
||||
"""
|
||||
Find matches for the given value.
|
||||
|
||||
Args:
|
||||
tokens: List of tokens to search
|
||||
value: Value to find
|
||||
field_name: Name of the field
|
||||
token_index: Optional spatial index for efficient lookup
|
||||
|
||||
Returns:
|
||||
List of Match objects
|
||||
"""
|
||||
pass
|
||||
Reference in New Issue
Block a user