tagPOS {openNLP} | R Documentation |
Tag part-of-speech.
tagPOS(sentence, language = "en", model = NULL, tagdict = NULL)
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. |
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.
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")