看板 R_Language 關於我們 聯絡資訊
大家好, 我想要用R做文字探勘, 但我才剛開始就卡關了... mycorpus = Corpus(DirSource("test", encoding="UTF-8"), readerControl = list(reader=readPlain, language = NA)) 我先用了Corpus建立語料庫,再用DirSource讀進資料庫的純文字檔 然後我想要看我在語料庫的內容,所以我用了inspect(mycorpus) 但是,不知道為什麼只會顯示 <<VCorpus>> Metadata: corpus specific: 0, document level (indexed): 0 Content: documents: 3 [[1]] <<PlainTextDocument>> Metadata: 7 Content: chars: 718 Content: chars: 703 Content: chars: 820 Content: chars: 85 Content: chars: 984 Content: chars: 785 Content: chars: 449 Content: chars: 0 ... 完全沒有顯示我txt檔的內容,但我google了很久,還是無解... 還有,我用了insertWords()想要增加詞彙, 但有些詞好像會被切斷,是因為繁體字的關係嗎? 謝謝各位! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.218.5.190 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1435739807.A.1EB.html
shihs: 我知道insertWords()的解決方式了 07/01 17:02
shihs: insertWords(toTrad(iconv(c("詞彙1","詞彙2"), 07/01 17:03
shihs: "big5", "UTF-8"), rev=TRUE)) 07/01 17:04