Closed BruceZhaoR closed 8 years ago
library(jiebaR) #关键词提取 kseg = worker(type = "keywords") > segment("我爱北京天安门",kseg) Error: "segment" %in% class(jiebar) is not TRUE > kseg["我爱北京天安门"] 8.9954 4.6674 "天安门" "北京" > kseg <= "我爱北京天安门" 8.9954 4.6674 "天安门" "北京"
> mseg = worker() > segment("我爱北京天安门",mseg) [1] "我" "爱" "北京" "天安门" > mseg["我爱北京天安门"] [1] "我" "爱" "北京" "天安门" > mseg <= "我爱北京天安门" [1] "我" "爱" "北京" "天安门"
> devtools::session_info() Session info ------------------------------------------------------------ setting value version R version 3.2.4 (2016-03-10) system x86_64, mingw32 ui RStudio (0.99.879) language (EN) collate Chinese (Simplified)_China.936 tz Asia/Shanghai date 2016-03-21 Packages ----------------------------------------------------------------- package * version date source ... jiebaR * 0.8 2016-01-30 CRAN (R 3.2.3) jiebaRD * 0.1 2015-01-04 CRAN (R 3.2.3) memoise 1.0.0 2016-01-29 CRAN (R 3.2.3) microbenchmark * 1.4-2.1 2015-11-25 CRAN (R 3.2.3) Rcpp 0.12.3 2016-01-10 CRAN (R 3.2.3) ...
segment 是对分词的,keywords(code, jiebar) 是对关键词的
了解了,怪我没有仔细看说明文档。感觉这个 <= 是通用的。:blush:
<=
Reproducible example:
Test Mix Segment mode
My Env