【发布时间】:2017-08-18 06:04:46
【问题描述】:
我正在尝试从字符向量中删除停用词。但我面临的问题是有一个词“king kond”。由于“king”是停用词之一,“king kong”中的“king”正在被删除。
有没有办法避免双字被删除? 我的代码是:
text <- VCorpus(VectorSource(newmnt1$form))
#(newmnt1$form is chr [1:4] "king kong lives" "foot" "island" "skull")
#Normal standardization of text.
text <- tm_map(text, content_transformer(tolower))
text <- tm_map(text, removeWords, custom_stopwords)
text <- tm_map(text, stripWhitespace)
newmnt2 <- text[[1]]$content
【问题讨论】:
标签: r tm corpus stop-words