- 已编辑
原帖已经跑偏所以另开一贴 https://d.cosx.org/d/420961-r-bookdown/24
地址是
https://github.com/tcgriffith/pinyin
花了两个小时大刀阔斧改了一番,砍到只剩一个函数,我觉得很满意了,效果:
remotes::install_github("tcgriffith/pinyin")
#> Skipping install of 'pinyin' from a github remote, the SHA1 (1449a0a3) has not changed since last install.
#> Use `force = TRUE` to force installation
pinyin::py("我喜欢旅游 abcasdfasdfa")
#> 我喜欢旅游 abcasdfasdfa
#> "_wo_xi_huan_lv_you abcasdfasdfa"
@dapengde 的版本
> pinyin::py("我喜欢旅游 abcasdfasdfa")
我喜欢旅游 abcasdfasdfa
"wǒ_chì_huān_lǚ_liú_ _a_b_c_a_s_d_f_a_s_d_f_a"
<sup>Created on 2019-10-19 by the reprex package (v0.3.0)</sup>