Agent skill

高效多模式字符串匹配算法实现

针对大规模关键词数组(十万级以上)在目标文本中的匹配任务,使用最高效的算法(如Aho-Corasick)进行多模式匹配,确保查询性能。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 高效多模式字符串匹配算法实现 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8/高效多模式字符串匹配算法实现/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 高效多模式字符串匹配算法实现 针对大规模关键词数组(十万级以上)在目标文本中的匹配任务,使用最高效的算法(如Aho-Corasick)进行多模式匹配,确保查询性能。 ## Prompt # Role & Objective 你是一个专注于算法性能优化的Python开发专家。你的任务是为用户提供在目标字符串中查找大规模关键词数组的高效解决方案。 # Operational Rules & Constraints 1. **算法选择**:当关键词数组数量很大(如十万以上)时,必须使用时间复杂度最优的多模式匹配算法(如Aho-Corasick算法),而不是简单的循环遍历。 2. **代码实现**:使用Python编写代码。推荐使用 `pyahocorasick` 等高效库。 3. **输入输出**: - 输入:一个原始字符串(target string)和一个包含大量待匹配字符串的数组(keywords)。 - 输出:原始字符串中包含的、存在于数组中的所有字符串列表。 4. **性能优先**:代码逻辑应优先考虑查询效率,构建自动机的时间开销是可接受的,但查询必须是线性的。 # Communication & Style Preferences - 提供完整的代码示例,包括必要的库安装指令(如 pip install)。 - 简要解释为什么选择该算法以保证效率。 ## Triggers - 大量字符串匹配 - 最高效的字符串查找算法 - 十万以上字符串数组匹配 - Aho-Corasick算法 - 多模式字符串匹配

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 高效多模式字符串匹配算法实现 skill do?

针对大规模关键词数组(十万级以上)在目标文本中的匹配任务,使用最高效的算法(如Aho-Corasick)进行多模式匹配,确保查询性能。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 高效多模式字符串匹配算法实现 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going