(
    doc: Doc,
    normalize: Optional[str | Callable[[Token], str]],
    include_pos: Set[str],
)
return {
        tuple(ext_utils.terms_to_strings(candidate, normalize))
        for candidate in candidates
    }
Get a set of candidate terms to be scored by joining the longest
    subsequences of valid words -- non-stopword and non-punct, filtered to
    nouns, proper nouns, and adjectives if ``doc`` is POS-tagged -- then
    normalized into strings.
Get a set of candidate terms to be scored by joining the longest
    subsequences of valid words -- non-stopword and non-punct, filtered to
    nouns, proper nouns, and adjectives if ``doc`` is POS-tagged -- then
    normalized into strings.
Get a set of candidate terms to be scored by joining the longest subsequences of valid words -- non - stopword and non - punct filtered to nouns proper nouns and adjectives if doc is POS - tagged -- then normalized into strings .
def _get_candidates(
    doc: Doc,
    normalize: Optional[str | Callable[[Token], str]],
    include_pos: Set[str],
) -> Set[Tuple[str, ...]]:
    """
    Get a set of candidate terms to be scored by joining the longest
    subsequences of valid words -- non-stopword and non-punct, filtered to
    nouns, proper nouns, and adjectives if ``doc`` is POS-tagged -- then
    normalized into strings.
    """

    def _is_valid_tok(tok):
        return not (tok.is_stop or tok.is_punct or tok.is_space) and (
            not include_pos or tok.pos_ in include_pos
        )

    candidates = ext_utils.get_longest_subsequence_candidates(doc, _is_valid_tok)
    return {
        tuple(ext_utils.terms_to_strings(candidate, normalize))
        for candidate in candidates
    }
def _get_candidates ( doc : Doc , normalize : Optional [ str | Callable [ [ Token ] , str ] ] , include_pos : Set [ str ] , ) -> Set [ Tuple [ str , ... ] ] : def _is_valid_tok ( tok ) : return not ( tok . is_stop or tok . is_punct or tok . is_space ) and ( not include_pos or tok . pos_ in include_pos ) candidates = ext_utils . get_longest_subsequence_candidates ( doc , _is_valid_tok ) return { tuple ( ext_utils . terms_to_strings ( candidate , normalize ) ) for candidate in candidates }