SCM

SCM Repository

[tm] Diff of /trunk/tm/R/textdoccol.R
ViewVC logotype

Diff of /trunk/tm/R/textdoccol.R

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

revision 817, Wed Jan 30 11:25:20 2008 UTC revision 819, Thu Jan 31 09:09:18 2008 UTC
# Line 612  Line 612 
612                    result <- base::sapply(X, FUN, ...)                    result <- base::sapply(X, FUN, ...)
613                return(result)                return(result)
614            })            })
615    
616    setGeneric("writeCorpus", function(object, path = ".", filenames = NULL) standardGeneric("writeCorpus"))
617    setMethod("writeCorpus",
618              signature(object = "Corpus"),
619              function(object, path = ".", filenames = NULL) {
620                  filenames <- file.path(path,
621                                         if (is.null(filenames)) sapply(object, function(x) sprintf("%s.txt", ID(x)))
622                                         else filenames)
623                  i <- 1
624                  for (o in object) {
625                      writeLines(o, filenames[i])
626                      i <- i + 1
627                  }
628              })

Legend:
Removed from v.817  
changed lines
  Added in v.819

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