(noun: Token)
return (min_i, noun.i)
Return document indexes spanning all (adjacent) tokens in a compound noun.
Return document indexes spanning all (adjacent) tokens in a compound noun.
Return document indexes spanning all ( adjacent ) tokens in a compound noun .
def get_span_for_compound_noun(noun: Token) -> Tuple[int, int]:
    """Return document indexes spanning all (adjacent) tokens in a compound noun."""
    min_i = noun.i - sum(
        1
        for _ in itertools.takewhile(
            lambda x: x.dep_ == "compound", reversed(list(noun.lefts))
        )
    )
    return (min_i, noun.i)
def get_span_for_compound_noun ( noun : Token ) -> Tuple [ int , int ] : min_i = noun . i - sum ( 1 for _ in itertools . takewhile ( lambda x : x . dep_ == "compound" , reversed ( list ( noun . lefts ) ) ) ) return ( min_i , noun . i )