[问题类型]:
程式咨询(我想用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
[关键字]: