Preprocess existing corpus of type Corpus
according to default operations.
This helper function groups all standard preprocessing steps such that the usage of the
package is more convenient. The result is a document-term matrix.
toDocumentTermMatrix(
x,
language = "english",
minWordLength = 3,
sparsity = NULL,
removeStopwords = TRUE,
stemming = TRUE,
weighting = function(x) tm::weightTfIdf(x, normalize = FALSE)
)
Object of DocumentTermMatrix
Corpus
object which should be processed
Default language used for preprocessing (i.e. stop word removal and stemming)
Minimum length of words used for cut-off; i.e. shorter words are removed. Default is 3.
A numeric for the maximal allowed sparsity in the range from bigger zero to
smaller one. Default is NULL
in order suppress this functionality.
Flag indicating whether to remove stopwords or not (default: yes)
Perform stemming (default: TRUE)
Function used for weighting of words; default is a a link to the tf-idf scheme.
DocumentTermMatrix
for the underlying class