getNgrams-character-method: get ngrams

Description Usage Arguments Examples

Description

get ngrams

Usage

1
2
3
4
## S4 method for signature 'character'
getNgrams(.Object, chars = NULL,
  returnSparseMatrix = TRUE, progress = TRUE, verbose = FALSE,
  mc = FALSE)

Arguments

.Object

the source directory

chars

chars to keep, if NULL (default, all chars are kept)

returnSparseMatrix

logical, whether to return a TermDocumentMatrix, defaults to TRUE. If FALSE, a list will be returned

progress

logical

verbose

logical

mc

logical, or the number of cores

Examples

1
2
3
4
5
6
## Not run: 
xmlDir <- "/Users/blaette/Lab/repos/keywords/data/figaro/xml"
noChars <- characterCount(xmlDir, toLower=TRUE, progress=TRUE, verbose=TRUE, mc=3)
ngramMatrix <- getNgrams(xmlDir, charCount=noChars, nChar=10, progress=TRUE, mc=3, verbose=TRUE)

## End(Not run)

PolMine/ctk documentation built on May 8, 2019, 3:20 a.m.