Function to access documents for textmining objects

Description

Function to access documents for textmining objects

Usage

1
getDoc(x, i = 1)

Arguments

x

object to retrive document fe tmCorpus or tmTextDocument

i

index

Value

returns i-th document of object x

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
corp <- tmCorpus(c("This is first document", "This is second"))
getDoc(corp, 1)
getDoc(corp, 2)
content(corp)

text <- tmTextDocument("Text document new")
getDoc(text)
content(text)

parsed <- tmParsed(list(c("Parsed", "doc", "one"), c("Parsed", "two")))
getDoc(parsed, 2)
content(parsed)