SCM

SCM Repository

[tm] Diff of /trunk/tm/R/textdoccol.R
ViewVC logotype

Diff of /trunk/tm/R/textdoccol.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 694, Sun Dec 31 14:47:46 2006 UTC revision 696, Fri Jan 5 15:04:53 2007 UTC
# Line 149  Line 149 
149  setMethod("stem_doc",  setMethod("stem_doc",
150            signature(object = "PlainTextDocument"),            signature(object = "PlainTextDocument"),
151            function(object, ...) {            function(object, ...) {
152                require(Rstem)                require("Rstem")
153                splittedCorpus <- unlist(strsplit(object, " ", fixed = TRUE))                splittedCorpus <- unlist(strsplit(object, " ", fixed = TRUE))
154                stemmedCorpus <- wordStem(splittedCorpus)                stemmedCorpus <- wordStem(splittedCorpus)
155                Corpus(object) <- paste(stemmedCorpus, collapse = " ")                Corpus(object) <- paste(stemmedCorpus, collapse = " ")
# Line 160  Line 160 
160  setMethod("remove_words",  setMethod("remove_words",
161            signature(object = "PlainTextDocument", stopwords = "character"),            signature(object = "PlainTextDocument", stopwords = "character"),
162            function(object, stopwords, ...) {            function(object, stopwords, ...) {
163                require(Rstem)                require("Rstem")
164                splittedCorpus <- unlist(strsplit(object, " ", fixed = TRUE))                splittedCorpus <- unlist(strsplit(object, " ", fixed = TRUE))
165                noStopwordsCorpus <- splittedCorpus[!splittedCorpus %in% stopwords]                noStopwordsCorpus <- splittedCorpus[!splittedCorpus %in% stopwords]
166                Corpus(object) <- paste(noStopwordsCorpus, collapse = " ")                Corpus(object) <- paste(noStopwordsCorpus, collapse = " ")

Legend:
Removed from v.694  
changed lines
  Added in v.696

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