返回顶部
w

word-letter-frequency单词字母频率

Count how many times each letter appears in a word or short phrase. Trigger when a user asks for per-letter frequencies, distributions, or statistics inside a single word or very short string.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
103
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

word-letter-frequency

单词字母频率

快速入门

  1. 1. 识别输入文本(通常为一个单词或短句)。默认行为会将文本转换为小写并忽略非字母字符,因此像a/A这样的重复字母会被合并。
  2. 运行scripts/count_letters.py <文本>获取频率表。需要时可使用可选标志:
- --case-sensitive 区分大小写。 - --include-non-alpha 按原样统计数字/标点符号。 - --json 返回机器可读的JSON格式,便于后续处理。
  1. 3. 向用户汇总统计结果。必要时添加说明性注释(例如是否忽略了标点符号)。

脚本参考

scripts/count_letters.py

支撑此技能的轻量级CLI/工具。它提供两个层级:
  • - CLI使用方式:python3 scripts/countletters.py balloon --json
  • 导入使用方式:from scripts.countletters import countletters 并调用countletters(text, casesensitive=False, includenon_alpha=False)获取collections.Counter对象。

CLI输出示例(默认选项):

$ python3 scripts/count_letters.py balloon
字符 计数
---- ----
a 1
b 1
l 2
o 2
n 1

JSON输出示例(适合直接嵌入响应):

$ python3 scripts/count_letters.py AaB! --case-sensitive --include-non-alpha --json
{A: 1, a: 1, B: 1, !: 1}

响应模式

  • - 简洁摘要:balloon包含b×1, a×1, l×2, o×2, n×1(不区分大小写,忽略标点符号)。
  • 表格片段:镜像脚本的表格以提高可读性。注明使用的任何选项。
  • JSON/字典:当用户需要结构化数据时,复用脚本的--json标志。

边界情况与提示

  • - 务必说明如何处理大写字母和标点符号,尤其是在不同选项下统计结果不同时。
  • 如果输入不包含字母字符且未设置--include-non-alpha,脚本会明确报告(未统计任何字符)。在响应中解释原因。
  • 对于多个单词,要么对整个短语运行一次脚本(默认方式),要么说明该技能专注于短字符串;如果请求扩展到完整文档,应升级到通用文本分析工作流程。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 word-letter-frequency-1776012849 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 word-letter-frequency-1776012849 技能

通过命令行安装

skillhub install word-letter-frequency-1776012849

下载

⬇ 下载 word-letter-frequency v1.0.0(免费)

文件大小: 2.83 KB | 发布时间: 2026-4-13 12:36

v1.0.0 最新 2026-4-13 12:36
- Initial release of the word-letter-frequency skill.
- Counts how many times each letter appears in a word or short phrase.
- Supports case sensitivity and inclusion of non-alphabetic characters through command-line flags.
- Provides results as formatted tables or JSON for easy use in responses or downstream processing.
- Includes detailed usage examples and guidance on handling special cases and clarifying output behavior.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部