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:

Name: John Smith
Email: john@example.com

Tips

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

    小葱技能站7w4.net,专业的AI技能分享平台。

  • Handle special instructions

🤖 AI 评测

这个Skill提供了基础的文本解析功能,代码示例清晰直观,对简单键值对格式的解析做得不错。但整体内容较为简单,对复杂格式和异常情况的处理能力有限,文档末尾有截断感。适合需要处理基础文本解析的场景,但如果遇到较为复杂的数据格式可能会遇到困难。

📊 多维度评分

适应性3.4
规范性3.9
有效性4
可靠性3.3
可信度4.5

📁 包含文件 (2 个)

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