(
        self,
        textables: Iterable[str | types.DocLike],
    )
Convert a sequence of texts or textable spaCy objects (Doc or Span)
        into an ordered, nested sequence of character ngrams.

        Args:
            textables

        Yields:
            Ordered sequence of character ngrams as strings for next textable.
Convert a sequence of texts or textable spaCy objects (Doc or Span)
        into an ordered, nested sequence of character ngrams.
Convert a sequence of texts or textable spaCy objects ( Doc or Span ) into an ordered nested sequence of character ngrams .
def transform(
        self,
        textables: Iterable[str | types.DocLike],
    ) -> Iterable[Tuple[str, ...]]:
        """
        Convert a sequence of texts or textable spaCy objects (Doc or Span)
        into an ordered, nested sequence of character ngrams.

        Args:
            textables

        Yields:
            Ordered sequence of character ngrams as strings for next textable.
        """
        texts = (self._to_text(textable) for textable in textables)
        if self.normalize is not None:
            texts = (self.normalize(text) for text in texts)
        for text in texts:
            tokens: List[str] = []
            for n in self.ns:
                if self.pad is True and n > 1:
                    pad_chars = "_" * (n - 1)
                    text = f"{pad_chars}{text}{pad_chars}"
                tokens.extend(text[i : i + n] for i in range(len(text) - n + 1))
            yield tuple(tokens)
def transform ( self , textables : Iterable [ str | types . DocLike ] , ) -> Iterable [ Tuple [ str , ... ] ] : texts = ( self . _to_text ( textable ) for textable in textables ) if self . normalize is not None : texts = ( self . normalize ( text ) for text in texts ) for text in texts : tokens : List [ str ] = [ ] for n in self . ns : if self . pad is True and n > 1 : pad_chars = "_" * ( n - 1 ) text = f"{pad_chars}{text}{pad_chars}" tokens . extend ( text [ i : i + n ] for i in range ( len ( text ) - n + 1 ) ) yield tuple ( tokens )