tokens_tolower
and tokens_toupper
convert the features of a
tokens object and reindex the types.
tokens_tolower(x, keep_acronyms = FALSE, ...) tokens_toupper(x, ...)
x | the input object whose character/tokens/feature elements will be case-converted |
---|---|
keep_acronyms | logical; if |
... | additional arguments passed to stringi functions, (e.g.
|
# for a document-feature matrix toks <- tokens(c(txt1 = "b A A", txt2 = "C C a b B")) tokens_tolower(toks)#> tokens from 2 documents. #> txt1 : #> [1] "b" "a" "a" #> #> txt2 : #> [1] "c" "c" "a" "b" "b" #>tokens_toupper(toks)#> tokens from 2 documents. #> txt1 : #> [1] "B" "A" "A" #> #> txt2 : #> [1] "C" "C" "A" "B" "B" #>