Skip to content
Back to skills

Rules And Trie

ASecurity

"Guides HanLP deterministic rules, sentence and string utilities,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
developmentpythongoapi

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill rules-and-trie --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rules And Trie?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rules And Trie
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-rules-and-trie/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-rules-and-trie)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rules-and-trie
description: "Guides HanLP deterministic rules, sentence and string utilities,
  Trie/TrieDict matching, and model-backed custom dictionary overlays."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Rules And Trie

Use this sub-skill when a task mentions deterministic sentence splitting, `hanlp.utils.rules`, `possible_tokenization`, `Trie`, `TrieDict`, `TupleTrieDict`, custom dictionaries, `dict_force`, `dict_combine`, `dict_tags`, gazetteers, or longest-prefix matching.

## Read First

- Read `references/trie-reference.md` for verified trie and dictionary APIs.
- Read `references/custom-dictionaries.md` for model-backed tokenizer/POS/NER dictionary overlays.
- Read `references/troubleshooting.md` for matching surprises, tuple keys, whitespace, and model-download boundaries.
- Run `scripts/rules_smoke.py` for no-download rules/string utility checks.
- Run `scripts/trie_smoke.py` for no-download trie and dictionary checks.

## Minimal Trie Use

```python
from hanlp_trie import Trie, TrieDict
trie = Trie({'商品': 'goods', '和服': 'kimono'})
print(trie.parse('商品和服'))
print(trie.parse_longest('商品和服'))
custom = TrieDict({'重要': 'important'})
print(custom.tokenize('第一个词语很重要'))
```

Trie and rule utilities can be verified without model downloads. Model-backed dictionary overlays such as `tok.dict_force`, `tok.dict_combine`, `pos.dict_tags`, and `ner.dict_whitelist` require a loaded pretrained component before they can change model output.

Files in this skill

  • SKILL.md1.5 KB
  • references/custom-dictionaries.md857 B
  • references/trie-reference.md695 B
  • references/troubleshooting.md607 B
  • scripts/rules_smoke.py884 B
  • scripts/trie_smoke.py964 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.