(
    doc: Doc, match_func: Callable[[Token], bool],
)
Get candidate keyterms from ``doc``, where candidates are longest consecutive
    subsequences of tokens for which all ``match_func(token)`` is True.

    Args:
        doc
        match_func: Function applied sequentially to each ``Token`` in ``doc``
            that returns True for matching ("good") tokens, False otherwise.

    Yields:
        Next longest consecutive subsequence candidate, as a tuple of constituent tokens.
Get candidate keyterms from ``doc``, where candidates are longest consecutive
    subsequences of tokens for which all ``match_func(token)`` is True.
Get candidate keyterms from doc where candidates are longest consecutive subsequences of tokens for which all match_func ( token ) is True .
def get_longest_subsequence_candidates(
    doc: Doc, match_func: Callable[[Token], bool],
) -> Iterable[Tuple[Token, ...]]:
    """
    Get candidate keyterms from ``doc``, where candidates are longest consecutive
    subsequences of tokens for which all ``match_func(token)`` is True.

    Args:
        doc
        match_func: Function applied sequentially to each ``Token`` in ``doc``
            that returns True for matching ("good") tokens, False otherwise.

    Yields:
        Next longest consecutive subsequence candidate, as a tuple of constituent tokens.
    """
    for key, words_grp in itertools.groupby(doc, key=match_func):
        if key is True:
            yield tuple(words_grp)
def get_longest_subsequence_candidates ( doc : Doc , match_func : Callable [ [ Token ] , bool ] , ) -> Iterable [ Tuple [ Token , ... ] ] : for key , words_grp in itertools . groupby ( doc , key = match_func ) : if key is True : yield tuple ( words_grp )