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 982, Tue Aug 11 07:48:04 2009 UTC revision 984, Fri Aug 14 16:32:35 2009 UTC
# Line 242  Line 242 
242                    return(FUN(object, ...))                    return(FUN(object, ...))
243            })            })
244    
 setGeneric("appendElem", function(object, data, meta = NULL) standardGeneric("appendElem"))  
 setMethod("appendElem",  
           signature(object = "Corpus", data = "TextDocument"),  
           function(object, data, meta = NULL) {  
               if (DBControl(object)[["useDb"]] && require("filehash")) {  
                   db <- filehash::dbInit(DBControl(object)[["dbName"]], DBControl(object)[["dbType"]])  
                   if (filehash::dbExists(db, ID(data)))  
                       warning("document with identical ID already exists")  
                   filehash::dbInsert(db, ID(data), data)  
                   object@.Data[[length(object)+1]] <- ID(data)  
               }  
               else  
                   object@.Data[[length(object)+1]] <- data  
               DMetaData(object) <- rbind(DMetaData(object), c(MetaID = CMetaData(object)@NodeID, meta))  
               return(object)  
           })  
   
245  prescindMeta <- function(object, meta) {  prescindMeta <- function(object, meta) {
246      df <- DMetaData(object)      df <- DMetaData(object)
247    

Legend:
Removed from v.982  
changed lines
  Added in v.984

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge