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 1328, Tue Apr 15 09:46:28 2014 UTC revision 1333, Fri Apr 18 10:38:46 2014 UTC
# Line 46  Line 46 
46                class = c("PCorpus", "Corpus"))                class = c("PCorpus", "Corpus"))
47  }  }
48    
49  VCorpus <- Corpus <-  VCorpus <-
50  function(x, readerControl = list(reader = x$defaultreader, language = "en"))  function(x, readerControl = list(reader = x$defaultreader, language = "en"))
51  {  {
52      stopifnot(inherits(x, "Source"))      stopifnot(inherits(x, "Source"))
# Line 221  Line 221 
221  print.PCorpus <- print.VCorpus <-  print.PCorpus <- print.VCorpus <-
222  function(x, ...)  function(x, ...)
223  {  {
224      cat(sprintf(ngettext(length(x),      writeLines(sprintf("<<%s (documents: %d, metadata (corpus/indexed): %d/%d)>>",
225                           "A corpus with %d text document\n\n",                         class(x)[1],
226                           "A corpus with %d text documents\n\n"),                         length(x),
227                  length(x)))                         length(meta(x, type = "corpus")),
228                           ncol(meta(x, type = "indexed"))))
     meta <- meta(x, type = "corpus")  
     dmeta <- meta(x, type = "indexed")  
   
     cat("Metadata:\n")  
     cat(sprintf("  Tag-value pairs. Tags: %s\n",  
                 paste(names(meta), collapse = " ")))  
     cat("  Data frame. Variables:", colnames(dmeta), "\n")  
   
229      invisible(x)      invisible(x)
230  }  }
231    

Legend:
Removed from v.1328  
changed lines
  Added in v.1333

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