tagPOS {openNLP} | R Documentation |
Tag part-of-speech.
tagPOS(sentence, language = "en", model = NULL, tagdict = NULL)
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. |
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.
A character vector holding POS-tagged sentence
.
Ingo Feinerer
OpenNLP. http://opennlp.sourceforge.net/
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")