[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
入門(寫過其他程式,只是對語法不熟悉)
[問題敘述]:
想要分詞的時候,依我自訂的辭典分,例如:閃電狼>他會分成"閃電","狼"
姆咪>"姆","咪" 其實我已經利用edit_dict() 將我要的字詞輸入到裡面了,
但分出來還是不是我要的
[程式範例]:
edit_dict()
seg <- worker()
seg$encoding
corpus <- NULL
for(i in 1:length(article)){
corpus[[i]] <- segment(article[i], seg)
}
[環境敘述]:
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese
(Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950
LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tm_0.7-3 NLP_0.1-11 RCurl_1.95-4.10 bitops_1.0-6
XML_3.98-1.11
[6] jiebaR_0.9.99 jiebaRD_0.1 readr_1.1.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 slam_0.1-43 R6_2.2.2 pillar_1.2.2
rlang_0.2.0
[6] xml2_1.2.0 tools_3.5.0 hms_0.4.2 parallel_3.5.0
yaml_2.1.19
[11] compiler_3.5.0 pkgconfig_2.0.1 tibble_1.4.2
[關鍵字]: