Displaying 1 result from an estimated 1 matches for "uniq_stem".
Did you mean:
uniq_stems
2011 Jun 09
2
Coercing Output from mget() into Proper Data Frame
..._list <- function(freqFile) {
stem_dict <- new.env(parent=emptyenv(), hash=TRUE)
freq_dist <- read.csv(freqFile,header=TRUE)
words <- as.character(freq_dist[,1])
freqs <- as.numeric(freq_dist[,2])
stems <- wordStem(words, language="english")
uniq_stems <- c()
# make a hash table of stems and their frequencies
for (i in 1:length(words)) {
word <- words[i]; stem <- stems[i]; freq <- freqs[i]
if (exists(stem, envir=stem_dict)) {
cnt <- get(stem, envir=stem_dict)
cnt <- cnt + f...