openNLP (version 0.0-7)

tagPOS: 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 (Span
tagdict
A tag dictionary.

Value

  • A character vector holding POS-tagged sentence.

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.

References

OpenNLP http://opennlp.sourceforge.net/

Examples

Run this code
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")

Run the code above in your browser using DataLab