返回顶部
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
安全检测
已通过
82
下载量
0
收藏
概述
安装方式
版本历史

word-letter-frequency

# Word Letter Frequency ## Quick start 1. Identify the input text (typically one word or a short phrase). Default behavior lowercases the text and ignores non-letters so repeated letters like `a`/`A` are merged. 2. Run `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. - `--json` returns machine-friendly JSON for downstream processing. 3. Summarize the counts for the user. Include clarifying notes (e.g., whether you ignored punctuation) when relevant. ## Script reference ### scripts/count_letters.py 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} ``` ## Response patterns - **Concise summary**: “`balloon` contains `b×1, a×1, l×2, o×2, n×1` (case-insensitive, punctuation ignored).” - **Tabular snippet**: Mirror the script’s table for readability. Mention any options you used. - **JSON / dict**: When the user wants structured data, reuse the script’s `--json` flag. ## Edge cases & tips - Make sure to state how you treated uppercase letters and punctuation, especially when the counts differ depending on options. - If the input contains no alphabetic characters and `--include-non-alpha` is not set, the script intentionally reports “(no characters were counted)”. Explain why in the response. - For multiple words, either run the script once on the full phrase (default) or note that the skill focuses on short strings; if the request expands to full documents, escalate to a general text-analysis workflow instead.

标签

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

下载 Zip 包

⬇ 下载 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-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部