Thai Address Splitter
Description
split long address string(in Thai) to 'name', 'phone number', 'subdistrict', 'district', 'province', 'zipcode'
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Thai Address Splitter
split long address string(in Thai) to 'name', 'phone number', 'subdistrict', 'district', 'province', 'zipcode'
Architecture
This library uses a class-based architecture with separated concerns:
ThaiAddressSplitter- Main orchestrator classTextPreprocessor- Text cleaning and normalizationLocationMatcher- Subdistrict database matching and scoringEntityExtractor- Name, phone, and address extractionConstants- Centralized patterns, keywords, and mappings
How It Works
flowchart LR
A[Thai Address String] --> B[Clean Text]
B --> C[Extract Thai Words]
C --> D[Find Location Match]
D --> E[Extract Entities]
E --> F[Structured Output]
subgraph "Core Steps"
B
C
D
E
end
subgraph "Data Sources"
DB[(subdistricts.json)]
PATTERNS[Regex Patterns]
end
D -.-> DB
E -.-> PATTERNS
Processing Steps
- Text Preprocessing:
- Removes administrative prefixes (เขต, แขวง, จังหวัด, อำเภอ, ตำบล, etc.)
- Normalizes whitespace and cleans input
- Word Extraction: Splits text and filters Thai words with at least 2 characters
- Location Matching:
- Searches each word against the subdistricts database
- Calculates frequency scores for location confidence
- Entity Extraction:
- Removes location words from text (zipcode → province → district → subdistrict)
- Extracts names with title prefixes (นาย, นาง, คุณ, etc.) or without titles
- Extracts phone numbers (starting with 06, 08, 09)
- Remaining text becomes the address field
Example
basic split
const Splitter = require('../splitter');
(async () => {
const input = 'คุณดอกฝ้าย สายเขียว 799/11 ถนนจักรแก้ว แขวงวังบูรพาภิรมย์ เขตพระนคร กรุงเทพ 10200 เบอร์ 0911222333';
const result = Splitter.split(input);
console.log('result :', { input, result });
})();
Tests
pnpm run te
Related Skills
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11