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 1397, Fri Sep 12 19:30:27 2014 UTC revision 1404, Tue Feb 17 18:04:22 2015 UTC
# Line 28  Line 28 
28      }      }
29      x <- close(x)      x <- close(x)
30    
31      structure(list(content = tdl,      p <- list(content = tdl,
32                     meta = CorpusMeta(),                     meta = CorpusMeta(),
33                     dmeta = data.frame(row.names = seq_along(tdl)),                     dmeta = data.frame(row.names = seq_along(tdl)),
34                     dbcontrol = dbControl),                dbcontrol = dbControl)
35                class = c("PCorpus", "Corpus"))      class(p) <- c("PCorpus", "Corpus")
36        p
37  }  }
38    
39  Corpus <-  Corpus <-
# Line 66  Line 67 
67      }      }
68      x <- close(x)      x <- close(x)
69    
70      structure(list(content = tdl,      v <- list(content = tdl,
71                     meta = CorpusMeta(),                     meta = CorpusMeta(),
72                     dmeta = data.frame(row.names = seq_along(tdl))),                dmeta = data.frame(row.names = seq_along(tdl)))
73                class = c("VCorpus", "Corpus"))      class(v) <- c("VCorpus", "Corpus")
74        v
75  }  }
76    
77  `[.PCorpus` <-  `[.PCorpus` <-
# Line 172  Line 174 
174      if (!all(unlist(lapply(args, inherits, class(x)))))      if (!all(unlist(lapply(args, inherits, class(x)))))
175          stop("not all arguments are of the same corpus type")          stop("not all arguments are of the same corpus type")
176    
177      structure(list(content = do.call("c", lapply(args, content)),      v <- list(content = do.call("c", lapply(args, content)),
178                     meta = CorpusMeta(meta = do.call("c",                     meta = CorpusMeta(meta = do.call("c",
179                       lapply(args, function(a) meta(a, type = "corpus")))),                       lapply(args, function(a) meta(a, type = "corpus")))),
180                     dmeta = Reduce(outer_union, lapply(args, meta))),                dmeta = Reduce(outer_union, lapply(args, meta)))
181                class = c("VCorpus", "Corpus"))      class(v) <- c("VCorpus", "Corpus")
182        v
183  }  }
184    
185  content.VCorpus <-  content.VCorpus <-

Legend:
Removed from v.1397  
changed lines
  Added in v.1404

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