(doclike: types.DocLike)
return [
        types.AugTok(
            text=tok.text,
            ws=tok.whitespace_,
            pos=tok.pos_,
            is_word=(not (tok.is_punct or tok.is_space)),
            syns=syns,
        )
        for tok, syns in zip(doclike, toks_syns)
    ]
Transform a spaCy ``Doc`` or ``Span`` into a list of ``AugTok`` objects,
    suitable for use in data augmentation transform functions.
Transform a spaCy ``Doc`` or ``Span`` into a list of ``AugTok`` objects,
    suitable for use in data augmentation transform functions.
Transform a spaCy Doc or Span into a list of AugTok objects suitable for use in data augmentation transform functions .
def to_aug_toks(doclike: types.DocLike) -> List[types.AugTok]:
    """
    Transform a spaCy ``Doc`` or ``Span`` into a list of ``AugTok`` objects,
    suitable for use in data augmentation transform functions.
    """
    if not isinstance(doclike, (Doc, Span)):
        raise TypeError(
            errors.type_invalid_msg("spacy_obj", type(doclike), types.DocLike)
        )
    lang = doclike.vocab.lang
    toks_syns: Iterable[List[str]]
    if concept_net.filepath is None or lang not in concept_net.synonyms:
        toks_syns = ([] for _ in doclike)
    else:
        toks_syns = (
            concept_net.get_synonyms(tok.text, lang=lang, sense=tok.pos_)
            if not (tok.is_punct or tok.is_space)
            else []
            for tok in doclike
        )
    return [
        types.AugTok(
            text=tok.text,
            ws=tok.whitespace_,
            pos=tok.pos_,
            is_word=(not (tok.is_punct or tok.is_space)),
            syns=syns,
        )
        for tok, syns in zip(doclike, toks_syns)
    ]
def to_aug_toks ( doclike : types . DocLike ) -> List [ types . AugTok ] : if not isinstance ( doclike , ( Doc , Span ) ) : raise TypeError ( errors . type_invalid_msg ( "spacy_obj" , type ( doclike ) , types . DocLike ) ) lang = doclike . vocab . lang toks_syns : Iterable [ List [ str ] ] if concept_net . filepath is None or lang not in concept_net . synonyms : toks_syns = ( [ ] for _ in doclike ) else : toks_syns = ( concept_net . get_synonyms ( tok . text , lang = lang , sense = tok . pos_ ) if not ( tok . is_punct or tok . is_space ) else [ ] for tok in doclike ) return [ types . AugTok ( text = tok . text , ws = tok . whitespace_ , pos = tok . pos_ , is_word = ( not ( tok . is_punct or tok . is_space ) ) , syns = syns , ) for tok , syns in zip ( doclike , toks_syns ) ]