Skip to Content

sentDetect {openNLP}

Detect sentences
Package: 
openNLP
Version: 
0.0-8

Description

Detect sentences.

Usage

sentDetect(s, language = "en", model = NULL)

Arguments

s
A character vector with texts from which sentences should be detected.
language
A character string giving the language of s. This argument is only used if model is NULL for selecting a default model. At the moment, languages en (English), es (Spanish), de (German) and th (Thai) are supported, provided that the corresponding openNLP model language packages (openNLPmodels.en, ...) are available.
model
A model.

Details

If model is NULL then a default model for sentence detection is loaded from the corresponding openNLP models language package.

Values

A character vector with all the sentences found in the elements of s.

References

OpenNLP http://opennlp.sourceforge.net/

Examples

s <- "This is a sentence. This another---but with dash-like structures, and some commas.
Maybe another with question marks? Sure!"
sentDetect(s, language = "en")
s <- "<c2><bf>Como se llama usted? El castellano es la lengua espa<c3><b1>ola oficial del Estado."
sentDetect(s, language = "es")

Author(s)

Ingo Feinerer

Documentation reproduced from package openNLP, version 0.0-8. License: LGPL-2.1