https://xxyh.xiaoli.icu/api/p_wordfreq.phphttps://xxyh.xiaoli.icu/api/p_wordfreq.php?text=%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%E6%AD%A3%E5%9C%A8%E6%94%B9%E5%8F%98%E4%B8%96%E7%95%8C&top=30top 控制返回数量(最多 100),文本上限 2 万字。
中文没有现成分词库时用二元组近似,效果对短文本足够;英文按 2 个字母以上的单词统计,统一转小写。
返回 total_terms 总词数、unique 去重后数量与 list 排行。停用词表内置 200 多个,避免「的、了、我们」霸榜。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
text |
string | 必填 | 人工智能正在改变世界 | 要统计的文本 |
top |
int | 选填 | 30 | 返回前 N 个 |
https://xxyh.xiaoli.icu/api/p_wordfreq.php
此处将显示接口返回结果…
{
"code": 200,
"msg": "ok",
"data": {
"total_terms": 42,
"unique": 31,
"list": [
{ "word": "人工", "count": 3 },
{ "word": "智能", "count": 3 }
]
}
}
—