text_extensions_for_pandas/array/token_span.py
def from_char_offsets(tokens: Any) -> "TokenSpanArray":
        """
        Convenience factory method for wrapping the character-level spans of a
        series of tokens into single-token token-based spans.

        :param tokens: character-based offsets of the tokens, as any type that
         :func:`SpanArray.make_array` understands.

        :return: A :class:`TokenSpanArray` containing single-token spans for each of the
         tokens in ``tokens``.
        """
        begin_tokens = np.arange(len(tokens))
        tokens_array = SpanArray.make_array(tokens)
        return TokenSpanArray(tokens_array, begin_tokens, begin_tokens + 1)

        Convenience factory method for wrapping the character-level spans of a
        series of tokens into single-token token-based spans.

        :param tokens: character-based offsets of the tokens, as any type that
         :func:`SpanArray.make_array` understands.

        :return: A :class:`TokenSpanArray` containing single-token spans for each of the
         tokens in ``tokens``.
        
Convenience factory method for wrapping the character-level spans of a
series of tokens into single-token token-based spans.
Convenience factory method for wrapping the character - level spans of a series of tokens into single - token token - based spans .
def from_char_offsets(tokens: Any) -> "TokenSpanArray":
        begin_tokens = np.arange(len(tokens))
        tokens_array = SpanArray.make_array(tokens)
        return TokenSpanArray(tokens_array, begin_tokens, begin_tokens + 1)
def from_char_offsets ( tokens : Any ) -> "TokenSpanArray" : begin_tokens = np . arange ( len ( tokens ) ) tokens_array = SpanArray . make_array ( tokens ) return TokenSpanArray ( tokens_array , begin_tokens , begin_tokens + 1 )
Convenience factory method for wrapping the character-level spans of a
series of tokens into single-token token-based spans.
Convenience factory method for wrapping the character - level spans of a series of tokens into single - token token - based spans .
"""
        Convenience factory method for wrapping the character-level spans of a
        series of tokens into single-token token-based spans.

        :param tokens: character-based offsets of the tokens, as any type that
         :func:`SpanArray.make_array` understands.

        :return: A :class:`TokenSpanArray` containing single-token spans for each of the
         tokens in ``tokens``.
        """
A :class:`TokenSpanArray` containing single-token spans for each of the
tokens in ``tokens``.
A : class : ` TokenSpanArray ` containing single - token spans for each of the tokens in ` ` tokens ` ` .
tokens
Any
character-based offsets of the tokens, as any type that
:func:`SpanArray.make_array` understands.
character - based offsets of the tokens as any type that : func : ` SpanArray . make_array ` understands .