def _determine_relationship(
    elem1: Union["TextElement", "TableElement"],
    elem2: Union["TextElement", "TableElement"],
    line_threshold: float = 1,
    paragraph_threshold: float = 12,
) -> Literal["same-line", "same-paragraph", None]:
    """
    Determines the relationship between two elements (either TextElement or TableElement).
    Returns 'same-line', 'same-paragraph', or None.
    Tables are considered to have no direct relationship with other elements (None).
    """
    if isinstance(elem1, TableElement) or isinstance(elem2, TableElement):
        return None

    vertical_distance = abs(elem1.bbox.y0 - elem2.bbox.y0)

    if vertical_distance <= line_threshold:
        return "same-line"
    elif vertical_distance <= paragraph_threshold:
        return "same-paragraph"
    else:
        return None

    Determines the relationship between two elements (either TextElement or TableElement).
    Returns 'same-line', 'same-paragraph', or None.
    Tables are considered to have no direct relationship with other elements (None).
    
src/openparse/schemas.py