NewsSource: NewsSource

Description Usage Arguments Examples

Description

Create a tm source from Waterloo Region Record tm packages

Usage

1
NewsSource(x, encoding = "UTF-8")

Arguments

x
encoding

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, encoding = "UTF-8") 
{
    content <- readLines(x)
    content <- content[1:(length(content) - 6)]
    content <- content[grep(".", content)]
    num <- cumsum(grepl("______________", content))
    content <- split(content, num)
    s <- SimpleSource(encoding, length = length(content), content = content, 
        uri = x, reader = readNews, class = "NewsSource")
    s
  }

sjkiss/tm.plugin.waterloo documentation built on May 30, 2019, 8:08 p.m.