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 to get POS-tagged.
model A model.
language A character vector giving sentence's language. This argument is only used if model is NULL for selecting a default model. At the moment only en (English) and es (Spanish) are supported.
tagdict A tag dictionary.

Details

If model is NULL then a default model for English or Spanish part-of-speech tagging from the openNLPmodels is loaded. 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-6 Index]