"""Type definitions and protocols for the PredPatt semantic extraction system.This module provides shared type definitions to support static type checkingacross the PredPatt framework. It defines protocols and type variables thatare used throughout the system to avoid circular imports while maintainingtype safety.Classes-------HasPosition Protocol defining objects with a position attribute, used for tokens, predicates, and arguments that have positions in text.Type Variables--------------T Type variable bounded by HasPosition protocol for generic functions that operate on positioned objects.Type Aliases------------UDSchema Type alias for Universal Dependencies schema classes, supporting both v1 and v2 dependency relation definitions."""fromtypingimportTYPE_CHECKING,Protocol,TypeVarifTYPE_CHECKING:from.utils.ud_schemaimportDependencyRelationsV1,DependencyRelationsV2
[docs]classHasPosition(Protocol):"""Protocol for objects that have a position attribute."""position:int
# type variable for objects with positionT=TypeVar('T',bound=HasPosition)# type alias for UD schema modulestypeUDSchema=type['DependencyRelationsV1']|type['DependencyRelationsV2']