get_sentences: Sentence Tokenization

View source: R/syuzhet.R

get_sentencesR Documentation

Sentence Tokenization

Description

Parses a string into a vector of sentences.

Usage

get_sentences(text_of_file, fix_curly_quotes = TRUE, as_vector = TRUE)

Arguments

text_of_file

A Text String

fix_curly_quotes

logical. If TRUE curly quotes will be converted to ASCII representation before splitting.

as_vector

If TRUE the result is unlisted. If FALSE the result stays as a list of the original text string elements split into sentences.

Value

A Character Vector of Sentences

Examples

(x <- c(paste0(
    "Mr. Brown comes! He says hello. i give him coffee.  i will ",
    "go at 5 p. m. eastern time.  Or somewhere in between!go there"
),
paste0(
    "Marvin K. Mooney Will You Please Go Now!", "The time has come.",
    "The time has come. The time is now. Just go. Go. GO!",
    "I don't care how."
)))

get_sentences(x)
get_sentences(x, as_vector = FALSE)



syuzhet documentation built on Aug. 12, 2023, 1:05 a.m.