Learn R Programming

koRpus (version 0.10-2)

kRp.filter.wclass: Remove word classes

Description

This function strips off defined word classes of tagged text objects.

Usage

kRp.filter.wclass(txt, corp.rm.class = "nonpunct", corp.rm.tag = c(),
  as.vector = FALSE)

Arguments

txt

An object of class kRp.tagged-class.

corp.rm.class

A character vector with word classes which should be removed. The default value "nonpunct" has special meaning and will cause the result of kRp.POS.tags(lang, c("punct","sentc"), list.classes=TRUE) to be used. Another valid value is "stopword" to remove all detected stopwords.

corp.rm.tag

A character vector with valid POS tags which should be removed.

as.vector

Logical. If TRUE, results will be returned as a character vector containing only the text parts which survived the filtering.

Value

An object of class kRp.tagged-class. If as.vector=TRUE, returns only a character vector.

See Also

kRp.POS.tags

Examples

Run this code
# NOT RUN {
   kRp.filter.wclass(tagged.text)
# }

Run the code above in your browser using DataLab