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 54, Wed Sep 13 09:08:20 2006 UTC revision 55, Thu Sep 14 12:31:07 2006 UTC
# Line 216  Line 216 
216  setMethod("tm_transform",  setMethod("tm_transform",
217            c("TextDocCol"),            c("TextDocCol"),
218            function(object, FUN, ...) {            function(object, FUN, ...) {
219                lapply(object, FUN, ...)                lapply(object, FUN, ..., GlobalMetaData = GlobalMetaData(object))
220            })            })
221    
222  setGeneric("toPlainTextDocument", function(object, FUN, ...) standardGeneric("toPlainTextDocument"))  setGeneric("toPlainTextDocument", function(object, FUN, ...) standardGeneric("toPlainTextDocument"))
# Line 240  Line 240 
240                return(xmlApply(xmlRoot(corpus), FUN, ...))                return(xmlApply(xmlRoot(corpus), FUN, ...))
241            })            })
242    
243  setGeneric("stemTextDocument", function(object) standardGeneric("stemTextDocument"))  setGeneric("stemTextDocument", function(object, ...) standardGeneric("stemTextDocument"))
244  setMethod("stemTextDocument",  setMethod("stemTextDocument",
245            c("PlainTextDocument"),            c("PlainTextDocument"),
246            function(object) {            function(object) {
# Line 251  Line 251 
251                return (object)                return (object)
252            })            })
253    
254  setGeneric("removeStopWords", function(object, stopwords) standardGeneric("removeStopWords"))  setGeneric("removeStopWords", function(object, stopwords, ...) standardGeneric("removeStopWords"))
255  setMethod("removeStopWords",  setMethod("removeStopWords",
256            c("PlainTextDocument", "character"),            c("PlainTextDocument", "character"),
257            function(object, stopwords) {            function(object, stopwords) {
# Line 266  Line 266 
266  setMethod("tm_filter",  setMethod("tm_filter",
267            c("TextDocCol"),            c("TextDocCol"),
268            function(object, FUN, ...) {            function(object, FUN, ...) {
269                sapply(object, FUN, ...)                sapply(object, FUN, ..., GlobalMetaData = GlobalMetaData(object))
270            })            })
271    
272  setGeneric("filterREUT21578Topics", function(object, topics, ...) standardGeneric("filterREUT21578Topics"))  setGeneric("filterREUT21578Topics", function(object, topics, ...) standardGeneric("filterREUT21578Topics"))
273  setMethod("filterREUT21578Topics",  setMethod("filterREUT21578Topics",
274            c("PlainTextDocument", "character"),            c("PlainTextDocument", "character"),
275            function(object, topics, ...) {            function(object, topics) {
276                if (object@Cached == 0)                if (object@Cached == 0)
277                    object <- loadFileIntoMem(object)                    object <- loadFileIntoMem(object)
278    
# Line 282  Line 282 
282                    return(FALSE)                    return(FALSE)
283            })            })
284    
285  setGeneric("filterIDs", function(object, IDs) standardGeneric("filterIDs"))  setGeneric("filterIDs", function(object, IDs, ...) standardGeneric("filterIDs"))
286  setMethod("filterIDs",  setMethod("filterIDs",
287            c("TextDocument", "numeric"),            c("TextDocument", "numeric"),
288            function(object, IDs) {            function(object, IDs) {
# Line 376  Line 376 
376                    cat(names(GlobalMetaData(object)), "\n")                    cat(names(GlobalMetaData(object)), "\n")
377                }                }
378      })      })
379    
380    setGeneric("inspect", function(object) standardGeneric("inspect"))
381    setMethod("inspect",
382              c("TextDocCol"),
383              function(object) {
384                  summary(object)
385                  cat("\n")
386                  show(as(object, "list"))
387              })

Legend:
Removed from v.54  
changed lines
  Added in v.55

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