stem_strings: Stem a Vector of Strings

Description Usage Arguments Value Note See Also Examples

View source: R/stem.R

Description

Stem a vector of strings.

Usage

1
stem_strings(x, language = "porter", ...)

Arguments

x

A vector of strings.

language

The name of a recognized language (see wordStem).

...

Other arguments passed to split_token.

Value

Returns a vector of stemmed strings.

Note

The stemmer requires splitting the string apart into tokens. After the stemming occurs the strings are pasted back together. The strings are not guaranteed to retain exact spacing of the original.

See Also

stem_words

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- c(
    'the dirtier dog has eaten the pies',
    'that shameful pooch is tricky and sneaky',
    "He opened and then reopened the food bag",
    'There are skies of blue and red roses too!',
    NA,
    "The doggies, well they aren't joyfully running.",
    "The daddies are coming over...",
    "This is 34.546 above"
)
stem_strings(x)

Example output

[1] "the dirtier dog ha eaten the pi"          
[2] "that shame pooch i tricki and sneaki"     
[3] "He open and then reopen the food bag"     
[4] "There ar ski of blue and red rose too!"   
[5] NA                                         
[6] "The doggi, well thei aren't joyfulli run."
[7] "The daddi ar come over..."                
[8] "Thi i 34. 546 abov"                       

textstem documentation built on May 2, 2019, 6:42 a.m.