(doc: Doc)
return itertoolz.count(doc.sents)
Compute the number of sentences in a document.

    Args:
        doc

    Warning:
        If ``doc`` has not been segmented into sentences, it will be modified in-place
        using spaCy's rule-based ``Sentencizer`` pipeline component before counting.
Compute the number of sentences in a document.
Compute the number of sentences in a document .
def n_sents(doc: Doc) -> int:
    """
    Compute the number of sentences in a document.

    Args:
        doc

    Warning:
        If ``doc`` has not been segmented into sentences, it will be modified in-place
        using spaCy's rule-based ``Sentencizer`` pipeline component before counting.
    """
    if not doc.has_annotation("SENT_START"):
        LOGGER.warning(
            "`doc` has not been segmented into sentences; applying spaCy's rule-based, "
            "`Sentencizer` pipeline component to `doc` before counting..."
        )
        doc = _SENTENCIZER(doc)
    return itertoolz.count(doc.sents)
def n_sents ( doc : Doc ) -> int : if not doc . has_annotation ( "SENT_START" ) : LOGGER . warning ( "`doc` has not been segmented into sentences; applying spaCy's rule-based, " "`Sentencizer` pipeline component to `doc` before counting..." ) doc = _SENTENCIZER ( doc ) return itertoolz . count ( doc . sents )