tagPOS {openNLP}R Documentation

Tag part-of-speech

Description

Tag part-of-speech.

Usage

tagPOS(sentence, language = "en", model = NULL, tagdict = NULL)

Arguments

sentence A character vector with sentences to get POS-tagged.
model A model.
language A character vector giving the language of sentence. 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.
tagdict A tag dictionary.

Details

If model is NULL then a default model for sentence detection is loaded from the corresponding openNLP models language package. If tagdict is NULL a default English tag dictionary is taken.

Value

A character vector holding POS-tagged sentence.

Author(s)

Ingo Feinerer

References

OpenNLP http://opennlp.sourceforge.net/

Examples

sentence <- "This is a short sentence consisting of some nouns, verbs, and adjectives."
tagPOS(sentence, language = "en")
s <- "el castellano es la lengua espaƱola oficial del Estado."
tagPOS(s, language = "es")

[Package openNLP version 0.0-7 Index]