text-truncator

Truncate long text to a specified maximum length while preserving sentence boundaries.

330|71|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/GongLingRui/screen-creative-skills --skill text-truncator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: text-truncator
Source: https://github.com/GongLingRui/screen-creative-skills/tree/main/category/tools/text-truncator
Command: npx skills add https://github.com/GongLingRui/screen-creative-skills --skill text-truncator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

智能截断工具在不丢失语义的前提下,将超长文本截断到指定长度,方便在各种输入限制下快速使用。

Core Features & Use Cases

  • 智能截断:优先在句号等标点处截断,尽量保持句子完整性。
  • 支持多语言:处理中文和英文文本,确保核心信息保留。
  • 快速集成:可批量处理文本、从文件读取并输出统计信息,适用于文档摘要、数据预处理等场景。

Quick Start

Use this tool to truncate a long text to 1000 characters while preserving sentence boundaries.

Frequently Asked Questions about text-truncator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I truncate long text while preserving sentence boundaries?

To truncate long text while preserving sentence boundaries, this tool prioritizes cutting at punctuation marks like periods to maintain sentence completeness. It returns the truncated text along with length statistics, ensuring semantic integrity up to your specified maximum length.

Can I batch truncate multilingual text without external services?

Yes, you can batch truncate multilingual text without external services. The tool processes Chinese and English content locally, reads from files for batch text processing, and outputs truncated text with length statistics entirely offline.

What is the best way to truncate text for data preprocessing?

The best way to truncate text for data preprocessing is using a tool that preserves semantic integrity while processing file-based input. This tool handles batch truncation locally and provides length statistics, making it ideal for preparing datasets with input limits.

Does the truncation work with both Chinese and English text?

Yes, the truncation works with both Chinese and English text. The tool is designed to handle multilingual content, ensuring core information is retained in both languages by truncating at appropriate sentence boundaries.

How do I get length statistics after truncating text?

You get length statistics after truncating text automatically as part of the tool's output. Along with the truncated text, the tool returns detailed length statistics to help you verify the output meets your specified maximum length requirements.