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 729, Tue Apr 10 17:08:52 2007 UTC revision 730, Wed Apr 11 02:15:10 2007 UTC
# Line 2  Line 2 
2    
3  # The "..." are additional arguments for the FunctionGenerator reader  # The "..." are additional arguments for the FunctionGenerator reader
4  setGeneric("TextDocCol", function(object,  setGeneric("TextDocCol", function(object,
5                                    readerControl = list(reader = object@DefaultReader, language = "en_US", load = FALSE),                                    readerControl = list(reader = object@DefaultReader, language = "en_US", load = FALSE, ...),
6                                    dbControl = list(useDb = FALSE, dbName = "", dbType = "DB1"),                                    dbControl = list(useDb = FALSE, dbName = "", dbType = "SQLite")) standardGeneric("TextDocCol"))
                                   ...) standardGeneric("TextDocCol"))  
7  setMethod("TextDocCol",  setMethod("TextDocCol",
8            signature(object = "Source"),            signature(object = "Source"),
9            function(object,            function(object,
10                     readerControl = list(reader = object@DefaultReader, language = "en_US", load = FALSE),                     readerControl = list(reader = object@DefaultReader, language = "en_US", load = FALSE, ...),
11                     dbControl = list(useDb = FALSE, dbName = "", dbType = "DB1"),                     dbControl = list(useDb = FALSE, dbName = "", dbType = "SQLite")) {
                    ...) {  
12                if (attr(readerControl$reader, "FunctionGenerator"))                if (attr(readerControl$reader, "FunctionGenerator"))
13                    readerControl$reader <- readerControl$reader(...)                    readerControl$reader <- readerControl$reader(...)
14    
# Line 450  Line 448 
448    
449                if (!all(sapply(args, inherits, "TextDocCol")))                if (!all(sapply(args, inherits, "TextDocCol")))
450                    stop("not all arguments are text document collections")                    stop("not all arguments are text document collections")
451                if (DBControl(x)$useDb == TRUE || any(unlist(sapply(args, DBControl)["useDb", ])))                if (DBControl(x)[["useDb"]] == TRUE || any(unlist(sapply(args, DBControl)["useDb", ])))
452                    stop("concatenating text document collections with activated database is not supported")                    stop("concatenating text document collections with activated database is not supported")
453    
454                result <- x                result <- x
# Line 469  Line 467 
467                object@.Data <- c(as(x, "list"), as(y, "list"))                object@.Data <- c(as(x, "list"), as(y, "list"))
468    
469                # Set the DBControl slot                # Set the DBControl slot
470                object@DBControl <- list(useDb = FALSE, dbName = "", dbType = "DB1")                object@DBControl <- list(useDb = FALSE, dbName = "", dbType = "SQLite")
471    
472                # Update the CMetaData tree                # Update the CMetaData tree
473                cmeta <- new("MetaDataNode", NodeID = 0, MetaData = meta, children = list(CMetaData(x), CMetaData(y)))                cmeta <- new("MetaDataNode", NodeID = 0, MetaData = meta, children = list(CMetaData(x), CMetaData(y)))
# Line 533  Line 531 
531                           .Data = list(x, ...),                           .Data = list(x, ...),
532                           DMetaData = dmeta.df,                           DMetaData = dmeta.df,
533                           CMetaData = cmeta.node,                           CMetaData = cmeta.node,
534                           DBControl = list(useDb = FALSE, dbName = "", dbType = "DB1")))                           DBControl = list(useDb = FALSE, dbName = "", dbType = "SQLite")))
535            })            })
536    
537  setMethod("length",  setMethod("length",

Legend:
Removed from v.729  
changed lines
  Added in v.730

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