agentsclimarketplace

Run3 read python tokenizer source

Skill cxcscmu/SkillLearnBench/skills/b3-teacher-feedback-claude-opus-4-6/python-scala-translation/run3_read-python-tokenizer-source

Use this skill to understand the exact Python source code in /root/Tokenizer.py before translating to Scala. This covers every class, method, regex pattern, enum value, default value, and metadata key that must be faithfully reproduced.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run3_read-python-tokenizer-source

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.6 KB, 310 tokens by cl100k_base, as published. Nobody here has run it

Reading and Understanding /root/Tokenizer.py

Step-by-step workflow

  1. Read the file completely first:

    cat /root/Tokenizer.py
    
  2. Key elements to extract and note:

    • TokenType enum: all member names and their string values
    • Token dataclass/namedtuple: all fields, types, defaults
    • BaseTokenizer abstract class: interface methods
    • StringTokenizer: regex patterns, tokenize logic, what metadata it produces
    • NumericTokenizer: regex patterns (integers, floats, scientific notation), metadata keys
    • TemporalTokenizer: date/time regex patterns, metadata
    • UniversalTokenizer: how it combines other tokenizers, fallback logic
    • WhitespaceTokenizer: simple split logic
    • TokenizerBuilder: builder pattern methods, what it configures
    • Free functions: tokenize, tokenizeBatch, toToken, withMetadata — their exact signatures, parameters, defaults, return types
  3. Pay special attention to:

    • Every regex pattern string (copy exactly)
    • Default parameter values
    • Error handling (what happens with empty strings, None, invalid input)
    • How metadata dictionaries are constructed
    • How tokenizers are chained/composed in UniversalTokenizer
    • Return types (lists, Optional values, etc.)
  4. Document the exact API surface before writing any Scala code.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.