我在macOS上的R中探索koRpus包,尝试在以下对象上使用 treetag 函数:
文本 [1]"因为我无法阻止死亡 - " "他好心地为我停下来 - "
[3]"运输举行但只是我们自己 - " "和不朽"
使用以下语法
> tagged.text <- treetag(as.vector(paste(text, collapse = '')), format = "obj", debug = TRUE)
我收到以下错误
file: /var/folders/bt/sdf_vz6d3qbd188c7tkz50gw0000gn/T//RtmpoatWov/tempTextFromObject12d3d169614b6.txt sys.tt.call: /Applications/treetagger/cmd/tree-tagger-english /var/folders/bt/sdf_vz6d3qbd188c7tkz50gw0000gn/T//RtmpoatWov/tempTextFromObject12d3d169614b6.txt
矩阵中的错误(unlist(strsplit(tagged.text,&#34; \ t&#34;)),ncol = 3,byrow = TRUE,: &#39;数据&#39;必须是矢量类型,是&#39; NULL&#39;
当我尝试上面的emboldened命令时,我得到了这个
矩阵(取消列表(strsplit(粘贴(文字,折叠=&#39;&#39;),&#34; \ t&#34;))) [,1] [1,]&#34;因为我无法停止死亡 - 他好心地为我停了下来 - 运输举行,但只是我们自己 - 和不朽&#34;
我的工作区如下
sessionInfo()R版本3.4.2(2017-09-28)平台:x86_64-apple-darwin15.6.0(64位)运行于:macOS High Sierra 10.13.1
Matrix产品:默认BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
语言环境:[1] 的en_US.UTF-8 /的en_US.UTF-8 /的en_US.UTF-8 / C /的en_US.UTF-8 /的en_US.UTF-8
附加基础包:[1] stats graphics grDevices utils
数据集方法基础其他附件包:[1] quanteda_0.99.12 koRpus_0.10-2
data.table_1.10.4-3 scales_0.5.0 [5] purrr_0.2.4
readr_1.1.1 tidyr_0.7.2 tibble_1.3.4 [9] tidyverse_1.1.1 gutenbergr_0.1.3 ggplot2_2.2.1
stringr_1.2.0 [13] dplyr_0.7.4 janeaustenr_0.1.5
tidytext_0.1.4通过命名空间加载(而不是附加):[1] reshape2_1.4.2
haven_1.1.0 lattice_0.20-35 colorspace_1.3-2 [5] htmltools_0.3.6 SnowballC_0.5.1 yaml_2.1.14
rlang_0.1.2 [9] foreign_0.8-69 glue_1.2.0
modelr_0.1.1 readxl_1.0.0 [13] bindrcpp_0.2
bindr_0.1 plyr_1.8.4 munsell_0.4.3 [17] gtable_0.2.0 cellranger_1.1.0 rvest_0.3.2
psych_1.7.8 [21] evaluate_0.10.1 knitr_1.17
forcats_0.2.0 parallel_3.4.2 [25] broom_0.4.2
tokenizers_0.1.4 Rcpp_0.12.13 backports_1.1.1 [29] RcppParallel_4.3.20 jsonlite_1.5 fastmatch_1.1-0
mnormt_1.5-5 [33] hms_0.3 digest_0.6.12
stringi_1.1.5 bookdown_0.5 [37] grid_3.4.2
rprojroot_1.2 tools_3.4.2 magrittr_1.5 [41] lazyeval_0.2.1 pkgconfig_2.0.1 Matrix_1.2-11 xml2_1.1.1 [45] lubridate_1.7.1 assertthat_0.2.0 rmarkdown_1.6
httr_1.3.1 [49] R6_2.2.2 nlme_3.1-131
compiler_3.4.2