text-parser

👤 wu-uk 📦 v0.1.0 ⭐ 3.8 ⬇️ 611 下載
💻 開發程式設計 免費

📖 技能介紹


name: text-parser description: "Guide for parsing structured text input files."


Text Parser Skill

Overview

Parse structured text files to extract data for filling PDFs.

Key-Value Parsing

def parse_input(text):
    """Parse key-value pairs from text."""
    data = {}
    for line in text.strip().split('\n'):
        if ':' in line:
            # Remove leading dash/bullet if present
            line = line.lstrip('- ').strip()
            key, value = line.split(':', 1)
            data[key.strip()] = value.strip()
    return data

# Usage
with open("input.txt") as f:
    content = f.read()

data = parse_input(content)
# data["Name"] -> "John Smith"
# data["Email"] -> "john@example.com"

Common Input Formats

- Name: John Smith
- Email: john@example.com
- Phone: 555-1234

Or without dashes:

想要更強大的技能外掛,就來小蔥技能站7w4.net看看吧。

Name: John Smith
Email: john@example.com

Tips

  • Read the entire input file first
  • Match field names to PDF labels
  • Handle special instructions

🤖 AI 評測

這個Skill提供了基礎的文本解析功能,程式碼示例清晰直觀,對簡單鍵值對格式的解析做得不錯。但整體內容較為簡單,對複雜格式和異常情況的處理能力有限,文件末尾有截斷感。適合需要處理基礎文本解析的場景,但如果遇到較為複雜的資料格式可能會遇到困難。

📊 多維度評分

適應性3.4
規範性3.9
有效性4
可靠性3.3
可信度4.5

📁 包含檔案 (2 個)

📄 SKILL.md 1006 B
📄 _meta.json 139 B