Tokenize a document or character vector.
- A character vector, or an object that can be coerced to character by
The quality and correctness of a tokenization algorithm highly depends on the context and application scenario. Relevant factors are the language of the underlying text and the notions of whitespace (which can vary with the used encoding and the language) and punctuation marks. Consequently, for superior results you probably need a custom tokenization function.
- Relies on
scan(..., what = "character").
A character vector consisting of tokens obtained by tokenization of
getTokenizers to list tokenizers provided by package tm.
Regexp_Tokenizer for tokenizers using regular expressions
provided by package NLP.
tokenize for a simple regular expression based tokenizer
provided by package tau.
data("crude") MC_tokenizer(crude[]) scan_tokenizer(crude[]) strsplit_space_tokenizer <- function(x) unlist(strsplit(as.character(x), "[[:space:]]+")) strsplit_space_tokenizer(crude[])