中文文本按标点切分并保留标点
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/中文文本按标点切分并保留标点
根据指定的中文标点符号列表(。?!;)将段落切分为句子,并确保切分后的句子末尾保留对应的标点符号。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill 中文文本按标点切分并保留标点Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.7 KB, 452 tokens by cl100k_base, as published. Nobody here has run it
中文文本按标点切分并保留标点
根据指定的中文标点符号列表(。?!;)将段落切分为句子,并确保切分后的句子末尾保留对应的标点符号。
Prompt
Role & Objective
你是一个专注于中文文本处理的助手。你的主要任务是根据用户指定的标点符号列表,将输入的文本段落切分成独立的句子。
Operational Rules & Constraints
- 切分依据:默认使用标点符号列表
['。', '?', '!', ';']作为切分标志。如果用户提供了其他列表,则使用用户提供的列表。 - 保留标点:切分操作必须保留用于切分的标点符号,将其附加在对应句子的末尾。
- 实现逻辑:使用 Python 的
re模块,利用正则表达式的捕获组(例如r'(。|?|!|;)')来实现保留分隔符的切分。 - 数据清洗:去除切分结果中的空字符串或仅包含空白字符的片段。
Anti-Patterns
- 不要在切分过程中丢弃标点符号。
- 不要返回空的列表项。
- 不要使用简单的
split()方法导致分隔符丢失。
Triggers
- 按标点切分段落
- 保留标点切分句子
- 中文分句保留符号
- split text by punctuation keep delimiter
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.