alshaya / word-count
获取带排名的单词数。
dev-master
2018-01-18 06:33 UTC
Requires
- php: ~5.6.5|7.0.2|7.0.4|~7.0.6
This package is not auto-updated.
Last update: 2024-09-29 05:01:46 UTC
README
此模块将句子分割成每个单词,并根据出现的次数分配排名。
使用步骤
- 通过composer安装 "composer require alshaya/word-count"
- 在根目录中创建测试文件。a. 包含自动加载器以加载类。//require_once DIR . '/vendor/autoload.php'; b. 初始化根类 //$instance = new alshaya\WordCount\GetCount(); c. 设置要检查的文本 //$instance->setText("fsfsf"); d. 调用对给定文本进行排名的函数,参数可以是数组或JSON //$result = $instance->getWordRanking("array");