word-letter-frequency

👤 simmusjune 📦 v1.0.0 ⭐ 4.3 ⬇️ 654 下載
📊 資料分析 免費

📖 技能介紹


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.


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:
  3. --case-sensitive keeps uppercase and lowercase separate.
  4. --include-non-alpha counts digits/punctuation as-is.
  5. --json returns machine-friendly JSON for downstream processing.
  6. 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):

7w4.net小蔥技能站,你的AI助手技能庫。

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

🤖 AI 評測

這個技能整體質量中上,文件清晰易懂,操作簡單容易上手,核心功能實現得比較好。主要優點是說明詳細、使用靈活,支援多種統計模式。不足之處是功能比較基礎,缺少測試驗證,質量穩定性有待確認。作為一個簡單的字母計數工具來說基本夠用,但如果需要更復雜的統計分析可能需要其他工具輔助。

📊 多維度評分

適應性4.3
規範性4.2
有效性4.6
可靠性4
可信度4.5

📁 包含檔案 (3 個)

📄 SKILL.md 2.5 KB
📄 _meta.json 140 B
📄 scripts/count_letters.py 1.9 KB