← 返回
未分类 中文

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...
统计每个字母在单词或短语中出现的次数。当用户请求每个字母的频率、分布或统计时触发。
simmusjune simmusjune 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 354
下载
💾 8
安装
1
版本
#latest

概述

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 "" 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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 18:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 216 📥 71,484
data-analysis

AdMapix

fly0pants
AdMapix 原始数据层,提供广告创意、应用、排名、下载/收入及市场元数据。返回 AdMapix API 的结构化 JSON;调用方...
★ 298 📥 142,920
knowledge-management

summarizer2

simmusjune
使用 summarize CLI 汇总 URL 或文件(网页、PDF、图像、音频、YouTube)。
★ 0 📥 458