(doc_or_tokens: types.DocOrTokens)
return sum(ncpw)
Compute the total number of characters in a document's words.

    Args:
        doc_or_tokens: If a spaCy ``Doc``, non-punctuation tokens (words) are extracted;
            if an iterable of spaCy ``Token`` s, all non-punct elements are used.

    See Also:
        :func:`n_chars_per_word()`
Compute the total number of characters in a document's words.
Compute the total number of characters in a document s words .
def n_chars(doc_or_tokens: types.DocOrTokens) -> int:
    """
    Compute the total number of characters in a document's words.

    Args:
        doc_or_tokens: If a spaCy ``Doc``, non-punctuation tokens (words) are extracted;
            if an iterable of spaCy ``Token`` s, all non-punct elements are used.

    See Also:
        :func:`n_chars_per_word()`
    """
    # docs are hashable, so we can leverage the lru cache as-is
    if isinstance(doc_or_tokens, Doc):
        ncpw = n_chars_per_word(doc_or_tokens)
    # otherwise, let's get an iterable of words but cast it to a hashable tuple
    # so we can leverage the lru cache on this and related calls in, say, n_long_words
    else:
        words = utils.get_words(doc_or_tokens)
        ncpw = n_chars_per_word(tuple(words))
    return sum(ncpw)
def n_chars ( doc_or_tokens : types . DocOrTokens ) -> int : # docs are hashable, so we can leverage the lru cache as-is if isinstance ( doc_or_tokens , Doc ) : ncpw = n_chars_per_word ( doc_or_tokens ) # otherwise, let's get an iterable of words but cast it to a hashable tuple # so we can leverage the lru cache on this and related calls in, say, n_long_words else : words = utils . get_words ( doc_or_tokens ) ncpw = n_chars_per_word ( tuple ( words ) ) return sum ( ncpw )