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 755, Sun Jun 3 17:20:40 2007 UTC revision 757, Thu Jun 7 17:41:56 2007 UTC
# Line 168  Line 168 
168                return(FUN(xmlRoot(corpus), ...))                return(FUN(xmlRoot(corpus), ...))
169            })            })
170  setMethod("asPlain",  setMethod("asPlain",
171              signature(object = "Reuters21578Document"),
172              function(object, FUN, ...) {
173                  FUN <- convertReut21578XMLPlain
174                  corpus <- Corpus(object)
175    
176                  # As XMLDocument is no native S4 class, restore valid information
177                  class(corpus) <- "XMLDocument"
178                  names(corpus) <- c("doc","dtd")
179    
180                  return(FUN(xmlRoot(corpus), ...))
181              })
182    setMethod("asPlain",
183              signature(object = "RCV1Document"),
184              function(object, FUN, ...) {
185                  FUN <- convertRCV1Plain
186                  corpus <- Corpus(object)
187    
188                  # As XMLDocument is no native S4 class, restore valid information
189                  class(corpus) <- "XMLDocument"
190                  names(corpus) <- c("doc","dtd")
191    
192                  return(FUN(xmlRoot(corpus), ...))
193              })
194    setMethod("asPlain",
195            signature(object = "NewsgroupDocument"),            signature(object = "NewsgroupDocument"),
196            function(object, FUN, ...) {            function(object, FUN, ...) {
197                new("PlainTextDocument", .Data = Corpus(object), Cached = TRUE, URI = "", Author = Author(object),                new("PlainTextDocument", .Data = Corpus(object), Cached = TRUE, URI = "", Author = Author(object),

Legend:
Removed from v.755  
changed lines
  Added in v.757

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