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 833, Fri Mar 21 10:55:11 2008 UTC revision 836, Sat Apr 19 17:08:07 2008 UTC
# Line 677  Line 677 
677                return(result)                return(result)
678            })            })
679    
680    setAs("list", "Corpus", function(from) {
681        cmeta.node <- new("MetaDataNode",
682                          NodeID = 0,
683                          MetaData = list(create_date = Sys.time(), creator = Sys.getenv("LOGNAME")),
684                          children = list())
685        data <- list()
686        counter <- 1
687        for (f in from) {
688            doc <- new("PlainTextDocument",
689                       .Data = f, URI = NULL, Cached = TRUE,
690                       Author = "", DateTimeStamp = Sys.time(),
691                       Description = "", ID = as.character(counter),
692                       Origin = "", Heading = "", Language = "en_US")
693            data <- c(data, list(doc))
694            counter <- counter + 1
695        }
696        return(new("Corpus", .Data = data,
697                   DMetaData = data.frame(MetaID = rep(0, length(from)), stringsAsFactors = FALSE),
698                   CMetaData = cmeta.node,
699                   DBControl = dbControl <- list(useDb = FALSE, dbName = "", dbType = "DB1")))
700    })
701    
702  setGeneric("writeCorpus", function(object, path = ".", filenames = NULL) standardGeneric("writeCorpus"))  setGeneric("writeCorpus", function(object, path = ".", filenames = NULL) standardGeneric("writeCorpus"))
703  setMethod("writeCorpus",  setMethod("writeCorpus",
704            signature(object = "Corpus"),            signature(object = "Corpus"),

Legend:
Removed from v.833  
changed lines
  Added in v.836

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