SCM

SCM Repository

[tm] Diff of /pkg/R/corpus.R
ViewVC logotype

Diff of /pkg/R/corpus.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1258, Fri Sep 20 12:15:42 2013 UTC revision 1259, Sat Sep 21 07:36:25 2013 UTC
# Line 17  Line 17 
17  PCorpus <-  PCorpus <-
18  function(x,  function(x,
19           readerControl = list(reader = x$DefaultReader, language = "en"),           readerControl = list(reader = x$DefaultReader, language = "en"),
20           dbControl = list(dbName = "", dbType = "DB1"),           dbControl = list(dbName = "", dbType = "DB1"))
          ...)  
21  {  {
22      readerControl <- prepareReader(readerControl, x$DefaultReader, ...)      readerControl <- prepareReader(readerControl, x$DefaultReader)
23    
24      if (is.function(readerControl$init))      if (is.function(readerControl$init))
25          readerControl$init()          readerControl$init()
# Line 42  Line 41 
41      while (!eoi(x)) {      while (!eoi(x)) {
42          x <- stepNext(x)          x <- stepNext(x)
43          elem <- getElem(x)          elem <- getElem(x)
44          doc <- readerControl$reader(elem, readerControl$language, if (is.null(x$Names)) as.character(counter) else x$Names[counter])          id <- if (is.null(x$Names) || is.na(x$Names))
45                    as.character(counter)
46                else
47                    x$Names[counter]
48            doc <- readerControl$reader(elem, readerControl$language, id)
49          filehash::dbInsert(db, ID(doc), doc)          filehash::dbInsert(db, ID(doc), doc)
50          if (x$Length > 0) tdl[[counter]] <- ID(doc)          if (x$Length > 0) tdl[[counter]] <- ID(doc)
51          else tdl <- c(tdl, ID(doc))          else tdl <- c(tdl, ID(doc))
# Line 66  Line 69 
69      x      x
70  }  }
71    
 # The "..." are additional arguments for the FunctionGenerator reader  
72  VCorpus <-  VCorpus <-
73  Corpus <-  Corpus <-
74  function(x,  function(x, readerControl = list(reader = x$DefaultReader, language = "en"))
          readerControl = list(reader = x$DefaultReader, language = "en"),  
          ...)  
75  {  {
76      readerControl <- prepareReader(readerControl, x$DefaultReader, ...)      readerControl <- prepareReader(readerControl, x$DefaultReader)
77    
78      if (is.function(readerControl$init))      if (is.function(readerControl$init))
79          readerControl$init()          readerControl$init()

Legend:
Removed from v.1258  
changed lines
  Added in v.1259

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge