728x90
Specific Transformations 의 예
> toString <- content_transformer(function(x,from,to) gsub(from,to,x))
> inspect(doc[6])
<<VCorpus (documents: 1, metadata (corpus/indexed): 0/0)>>
[[1]]
<<PlainTextDocument (metadata: 7)>>
clewell yes im coordinator reading language arts montgomery county public schools suburban district surrounding washington schools elementary schools
> doc <- tm_map(doc,toString, "washington", "WA")
> inspect(doc[6])
<<VCorpus (documents: 1, metadata (corpus/indexed): 0/0)>>
[[1]]
<<PlainTextDocument (metadata: 7)>>
clewell yes im coordinator reading language arts montgomery county public schools suburban district surrounding WA schools elementary schools
728x90
'프로그래밍 Programming' 카테고리의 다른 글
07. Document-Term행렬 만들기 Creating a Document-Term Matrix (0) | 2014.11.22 |
---|---|
06. Stemming 어간추출 (0) | 2014.11.22 |
04. Preparing the Corpus - 기본 변환 (0) | 2014.11.22 |
03. Exploring the corpus - 전처리 및 간단한 변환 (0) | 2014.11.21 |
02. Loading a Corpus (txt, pdf, word) (1) | 2014.11.18 |