Learn R Programming

quanteda (version 0.9.8.5)

nsentence: count the number of sentences

Description

Return the count of sentences in a corpus or character.

Usage

nsentence(x, ...)
"nsentence"(x, ...)
"nsentence"(x, ...)

Arguments

x
texts or corpus whose sentences will be counted
...
additional arguments passed to tokenize

Value

scalar count(s) of the total sentences per text

Examples

Run this code
# simple example
txt <- c(text1 = "This is a sentence: second part of first sentence.",
         text2 = "A word. Repeated repeated.")
nsentence(txt)

Run the code above in your browser using DataLab