Skip to content

[BUG]: Text-analyzer top words include punctuation-only tokens such as "" and "-" #736

Closed

Description

@dhananjay6561

What happened?

The bundled text-analyzer reference skill (src/skillevaluator/tier3/reference_skills/text-analyzer/scripts/analyze_text.py) builds its "Top words" list from text.split() tokens with only a fixed set of punctuation stripped. Tokens that are only punctuation end up in the list:

  • an ellipsis ... strips to the empty string, so "" is reported as a top word;
  • a dash -, en/em dash –/—, &, etc. aren't stripped at all and are reported as words.

For text with dashes or ellipses these entries take up places in the top 5 and push real words out, and the text report prints a blank row.

Expected: top words only contain tokens that actually contain a letter or digit, so punctuation-only tokens aren't counted as words in the frequency list.

Reproduction steps

python3 src/skillevaluator/tier3/reference_skills/text-analyzer/scripts/analyze_text.py --json \
  --text 'Wait... what? ... ok ... - fine - yes!'

Observed top_words:

[{"word": "", "count": 2}, {"word": "-", "count": 2}, {"word": "wait", "count": 1}, {"word": "what", "count": 1}, {"word": "ok", "count": 1}]

fine and yes are pushed out of the top 5 by "" and -. No credentials, network, or provider access needed.

SkillEvaluator version or commit

0.9.0, commit d2cb1388 (upstream main).

Environment

macOS 26.6 arm64, Python 3.14.7, source checkout run with the repository's uv environment.

Before submitting

  • I agree to follow this project's Code of Conduct
  • I have searched the open issues and found no duplicate of this report

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions