word-letter-frequency
v1.0.0Count how many times each letter 应用ears 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.
运行时依赖
安装命令
点击复制技能文档
Word Letter Frequency Quick 启动 Identify the 输入 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. 运行 scripts/count_letters.py "" to 获取 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 down流 processing. Summarize the counts for the user. Include clarifying notes (e.g., whether you ignored punctuation) when relevant. Script reference scripts/count_letters.py
Lightweight 命令行工具/实用工具 that powers this 技能. It exposes two layers:
命令行工具 usage: python3 scripts/count_letters.py "balloon" --json 导入 usage: from scripts.count_letters 导入 count_letters and call count_letters(text, case_sensitive=False, include_non_alpha=False) to 获取 a collections.Counter.
Sample 命令行工具 输出 (default options):
$ python3 scripts/count_letters.py "balloon" Character Count --------- ----- a 1 b 1 l 2 o 2 n 1
Sample JSON 输出 (good for embedding directly into 响应s):
$ python3 scripts/count_letters.py "AaB!" --case-sensitive --include-non-alpha --json {"A": 1, "a": 1, "B": 1, "!": 1}
响应 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 状态 how you treated uppercase letters and punctuation, especially when the counts differ depending on options. If the 输入 contAIns no alphabetic characters and --include-non-alpha is not 设置, the script intentionally 报告s “(no characters were counted)”. ExplAIn why in the 响应. For multiple words, either 运行 the script once on the full phrase (default) or note that the 技能 focuses on short strings; if the 请求 expands to full documents, escalate to a general text-analysis 工作流 instead.