stemDocument: Stem Words

Description Usage Arguments Details Examples

View source: R/transform.R

Description

Stem words in a text document using Porter's stemming algorithm.

Usage

1
2
3
4
## S3 method for class 'character'
stemDocument(x, language = "english")
## S3 method for class 'PlainTextDocument'
stemDocument(x, language = meta(x, "language"))

Arguments

x

A character vector or text document.

language

A string giving the language for stemming.

Details

The argument language is passed over to wordStem as the name of the Snowball stemmer.

Examples

1
2
3

Example output

Loading required package: NLP
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 527

Diamond Shamrock Corp said that
effective today it had cut its contract prices for crude oil by
1.50 dlrs a barrel.
    The reduction brings its posted price for West Texas
Intermediate to 16.00 dlrs a barrel, the copany said.
    "The price reduction today was made in the light of falling
oil product prices and a weak crude oil market," a company
spokeswoman said.
    Diamond is the latest in a line of U.S. oil companies that
have cut its contract, or posted, prices over the last two days
citing weak oil markets.
 Reuter
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 484

Diamond Shamrock Corp said that effect today it had cut it contract price for crude oil by 1.50 dlrs a barrel. The reduct bring it post price for West Texa Intermedi to 16.00 dlrs a barrel, the copani said. "The price reduct today was made in the light of fall oil product price and a weak crude oil market," a compani spokeswoman said. Diamond is the latest in a line of U.S. oil compani that have cut it contract, or posted, price over the last two day cite weak oil markets. Reuter

tm documentation built on July 11, 2020, 3 a.m.