name: word-letter-frequency description: 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.
a/A are merged.scripts/count_letters.py "<text>" to get a frequency table. Use the optional flags when needed:--case-sensitive keeps uppercase and lowercase separate.--include-non-alpha counts digits/punctuation as-is.发现更多技能插件,请访问7w4.net。
--json returns machine-friendly JSON for downstream processing.Lightweight CLI/utility that powers this skill. It exposes two layers:
- CLI usage: python3 scripts/count_letters.py "balloon" --json
- Import usage: from scripts.count_letters import count_letters and call count_letters(text, case_sensitive=False, include_non_alpha=False) to get a collections.Counter.
Sample CLI output (default options):
$ python3 scripts/count_letters.py "balloon"
Character Count
--------- -----
a 1
b 1
l 2
o 2
n 1
Sample JSON output (good for embedding directly into responses):
$ python3 scripts/count_letters.py "AaB!" --case-sensitive --include-non-alpha --json
{"A": 1, "a": 1, "B": 1, "!": 1}
balloon contains b×1, a×1, l×2, o×2, n×1 (case-insensitive, punctuation ignored).”--json flag.--include-non-alpha is not set, the script intentionally reports “(no characters were counted)”. Explain why in the response.这个技能整体质量中上,文档清晰易懂,操作简单容易上手,核心功能实现得比较好。主要优点是说明详细、使用灵活,支持多种统计模式。不足之处是功能比较基础,缺少测试验证,质量稳定性有待确认。作为一个简单的字母计数工具来说基本够用,但如果需要更复杂的统计分析可能需要其他工具辅助。