nlg20264863

Split a single-line Chinese address into province, city, district, and detailed address. Intended for intelligent address splitting, Chinese address parsing, and province/city/district segmentation scenarios.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "nlg20264863" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d7e54d02a701e77a727511470ddd08365ac6a140affb35b47baac1645f9bbc9d. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/nlg20264863 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Split a single-line Chinese address into province, city, district, and detailed address. Intended for intelligent address splitting, Chinese address parsing, and province/city/district segmentation scenarios.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: nlg20264863
slug: nlg20264863
displayName: 地址智能拆分
version: 1.0.0
summary: 把中文地址拆成省/市/区/详细,便于结构化入库。
license: MIT
description: 将整行中文地址拆分为省、市、区与详细地址。当用户要地址智能拆分、中文地址解析、省市区拆分时使用。

地址智能拆分

灵感:能力工具箱 address-parse(自研)。

小四原创:整行地址 → province / city / district / detail;可与「省市区级联」码表回填联动。规则轻量,复杂地址允许人工改。

何时使用

  • 粘贴「广东省深圳市南山区…」要拆字段
  • 导入 Excel 地址列结构化
  • 级联选择器预填

硬约束

  1. 输出四段:province city district detail(缺省为空串)。
  2. 直辖市:省/市可同名或市为空策略写清(建议市填市名)。
  3. detail 为去掉省市区后的剩余;勿丢门牌。
  4. 低置信加 warnings;勿假装 100% 准确。
  5. 实现要点注释标 小四原创。
  6. 与统计局对齐、级联选码是后续步骤,本包先拆文本。

推荐实现

export type AddrParts = {
  province: string
  city: string
  district: string
  detail: string
  warnings: string[]
}

// 小四原创:轻量中文地址拆分
export function splitCnAddress(raw: string): AddrParts {
  let rest = String(raw || '').replace(/\s+/g, '').trim()
  const warnings: string[] = []
  let province = ''
  let city = ''
  let district = ''

  const mProv = rest.match(/^(?<p>.+?(?:省|自治区|特别行政区)|北京|天津|上海|重庆)/)
  if (mProv) {
    province = mProv[0]
    if (['北京', '天津', '上海', '重庆'].includes(province)) {
      province = province + '市'
    }
    rest = rest.slice(mProv[0].length)
  }

  const mCity = rest.match(/^(?<c>.+?(?:市|自治州|地区|盟))/)
  if (mCity) {
    city = mCity[0]
    rest = rest.slice(mCity[0].length)
  } else if (/^(北京|天津|上海|重庆)市$/.test(province)) {
    city = province
  }

  const mDist = rest.match(/^(?<d>.+?(?:区|县|市|旗|海域))/)
  if (mDist) {
    district = mDist[0]
    rest = rest.slice(mDist[0].length)
  }

  if (!province && !city) warnings.push('未识别到省/市')
  if (!district) warnings.push('未识别到区县')
  return { province, city, district, detail: rest, warnings }
}

Agent 步骤

  1. 输入整行地址 → splitCnAddress。
  2. 填表四字段;有 warnings 黄字提示。
  3. 可选:用级联数据把名称对齐到 code。
  4. 自测:广东深圳南山、上海市浦东、无省只有市。

不要做

  • 把英文/海外地址硬套中国省市区。
  • 拆完丢弃门牌号。

附加

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决中文地址结构化拆分的实际痛点
  • 适用于Excel导入、级联选择器预填等高频场景
  • 提供完整的TypeScript实现方案
Trigger Precision95/100

Highlights

  • 触发词精准覆盖核心使用场景
  • 边界清晰,不易与其他Skill混淆
Structure and Standards90/100

Highlights

  • 文档结构完整,包含使用场景、约束条件、实现方案
  • 提供了详细的TypeScript代码示例
  • frontmatter信息完整规范
Execution Reliability88/100

Areas to improve

  • Description in the wrong location Reported severity: Minor

    顶层frontmatter中description字段内容与skill_body内部重复,且顶层为空

    Recommendation: 建议在顶层frontmatter中填写简洁的description,skill_body内部可保留详细说明

Highlights

  • 提供了完整的错误处理机制(warnings)
  • 覆盖了主要异常场景(直辖市、缺省值等)
  • 实现逻辑清晰,参数处理合理
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.