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 973, Sat Jul 4 08:10:25 2009 UTC revision 982, Tue Aug 11 07:48:04 2009 UTC
# Line 211  Line 211 
211            })            })
212  setMethod("asPlain", signature(object = "RCV1Document"),  setMethod("asPlain", signature(object = "RCV1Document"),
213            function(object, FUN, ...) convertRCV1Plain(object, ...))            function(object, FUN, ...) convertRCV1Plain(object, ...))
 setMethod("asPlain", signature(object = "MailDocument"),  
           function(object, FUN, ...) as(object, "PlainTextDocument"))  
214  setMethod("asPlain",  setMethod("asPlain",
215            signature(object = "StructuredTextDocument"),            signature(object = "StructuredTextDocument"),
216            function(object, FUN, ...) {            function(object, FUN, ...) {
# Line 249  Line 247 
247            signature(object = "Corpus", data = "TextDocument"),            signature(object = "Corpus", data = "TextDocument"),
248            function(object, data, meta = NULL) {            function(object, data, meta = NULL) {
249                if (DBControl(object)[["useDb"]] && require("filehash")) {                if (DBControl(object)[["useDb"]] && require("filehash")) {
250                    db <- dbInit(DBControl(object)[["dbName"]], DBControl(object)[["dbType"]])                    db <- filehash::dbInit(DBControl(object)[["dbName"]], DBControl(object)[["dbType"]])
251                    if (dbExists(db, ID(data)))                    if (filehash::dbExists(db, ID(data)))
252                        warning("document with identical ID already exists")                        warning("document with identical ID already exists")
253                    dbInsert(db, ID(data), data)                    filehash::dbInsert(db, ID(data), data)
254                    object@.Data[[length(object)+1]] <- ID(data)                    object@.Data[[length(object)+1]] <- ID(data)
255                }                }
256                else                else

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

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