360 Secure SkillHub
360 安全技能中心

Text Processor

以 JavaScript 模块形式提供批量文本处理能力:清理多余空格、统一引号与全半角标点,提取中文关键词,并可对文本数组批量执行同一操作,面向内容创作与自动化流程。

huizong-cpu
huizong-cpu
热度 20.28
最近更新 2026-05-22 09:55:43
分类:效率依赖:代码执行应用场景:数据处理 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add text-processor
Metadata
name
text-processor
description
Batch Chinese text processing — clean, normalize, translate, extract keywords, and format text for content production.

Text Processor

A batch text processing utility for content workflows. Handles Chinese text normalization, cleaning, formatting, and structured extraction. Designed for content creators, editors, and automation pipelines.

Features

  • Text cleaning: Remove extra whitespace, fix punctuation, normalize quotes
  • Chinese normalization: Convert full-width/half-width, simplify/traditional
  • Batch processing: Process multiple text items in one call
  • Format conversion: Markdown ↔ plain text, numbered lists, tables
  • Keyword extraction: Extract key terms and phrases from Chinese text

Usage

const processor = require('./skills/text-processor');

// Clean and normalize
const cleaned = processor.clean("  Hello,世界!  This has ”bad” quotes.  ");
// → "Hello,世界!This has "bad" quotes."

// Extract keywords from Chinese text
const keywords = processor.extractKeywords("今天天气很好,适合出去郊游");
// → ["天气", "郊游", ...]

// Batch process
const results = processor.batch([
  "  文本1  ",
  "  文本2  "
], 'clean');
// → ["文本1", "文本2"]

API

clean(text)

Normalize and clean Chinese/English mixed text:

  • Trim whitespace
  • Collapse multiple spaces
  • Normalize quotes («»「」"" → standard "")
  • Normalize full-width/half-width punctuation

extractKeywords(text, maxCount?)

Extract meaningful keywords from Chinese text using TF heuristics.

batch(items, operation, options?)

Process an array of texts with the same operation.

License

MIT