Help us improve
Share bugs, ideas, or general feedback.
From claude-thai-skills
Use this skill for any task involving Thai postal address parsing, validation, formatting, or province/postcode lookup. Trigger whenever the user asks to: parse a Thai address into fields, validate a 5-digit Thai postcode, look up a province from its postcode, or format an address for a shipping label. Also trigger for requests like "แยกที่อยู่ไทย", "ตรวจรหัสไปรษณีย์", "แปลที่อยู่เป็นภาษาอังกฤษ", "ที่อยู่จัดส่ง", or any variation involving Thai addresses with ตำบล/แขวง/อำเภอ/เขต/จังหวัด.
npx claudepluginhub boom-vitt/claude-thai-skills --plugin thai-invoiceHow this skill is triggered — by the user, by Claude, or both
Slash command
/claude-thai-skills:thai-addressThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
แยกที่อยู่ไทย (บ้านเลขที่ หมู่ ซอย ถนน ตำบล/แขวง อำเภอ/เขต จังหวัด รหัสไปรษณีย์) เป็น structured dict, ตรวจ postcode 5 หลัก, ดูจังหวัดจาก 2 หลักแรกของ postcode, และ map ระหว่างชื่อไทย/อังกฤษของ 77 จังหวัด. รองรับชื่อถนนหลายคำ (เช่น `ถนนพระราม 9`, `ถนนเลียบทางด่วน`) และฟิลด์คอนโด/อพาร์ตเมนต์ (อาคาร, ชั้น, ห้อง) ด้วย.
Use this skill for any task involving Thai text in code — word segmentation, Unicode normalization, sorting/collation, search indexing, romanization, truncation, or database/Elasticsearch configuration for Thai. Trigger whenever the user asks to: tokenize / segment Thai (no spaces between words), normalize Thai text (NFC vs decomposed), sort Thai strings correctly, transliterate to roman / Latin, build a Thai search index, fix Thai text that breaks length limits or renders broken glyphs, or pick a Thai NLP library. Also trigger for requests like "ตัดคำภาษาไทย", "Thai word segmentation", "Thai NLP", "ค้นหาภาษาไทย", "Thai romanization", "PyThaiNLP", "Thai sort", "ICU Thai", "Thai collation", "Thai search index", "Thai full text search", or any variation. If the task involves processing Thai text in software, use this skill.
Optimizes Thai token usage in coding agent interactions, compressing Thai text while preserving code, commands, and safety constraints.
Activates ultra-compressed Thai+English mode to cut 60-75% tokens in technical responses while preserving accuracy. Triggers: /pordee full/lite/stop, พอดี, พูดสั้นๆ.
Share bugs, ideas, or general feedback.
แยกที่อยู่ไทย (บ้านเลขที่ หมู่ ซอย ถนน ตำบล/แขวง อำเภอ/เขต จังหวัด รหัสไปรษณีย์) เป็น structured dict, ตรวจ postcode 5 หลัก, ดูจังหวัดจาก 2 หลักแรกของ postcode, และ map ระหว่างชื่อไทย/อังกฤษของ 77 จังหวัด. รองรับชื่อถนนหลายคำ (เช่น ถนนพระราม 9, ถนนเลียบทางด่วน) และฟิลด์คอนโด/อพาร์ตเมนต์ (อาคาร, ชั้น, ห้อง) ด้วย.
Thai postal addresses go small-to-large — the reverse of English convention. Always order fields like this on a shipping label:
[อาคาร → ชั้น → ห้อง →] บ้านเลขที่ → หมู่ → ซอย → ถนน → ตำบล/แขวง → อำเภอ/เขต → จังหวัด → รหัสไปรษณีย์
Example (house):
123/45 ซอยสุขุมวิท 21 ถนนสุขุมวิท
แขวงคลองเตยเหนือ เขตวัฒนา
กรุงเทพมหานคร 10110
Example (condo / apartment):
อาคารชาญอิสสระ ชั้น 12 ห้อง 1203
99 ถนนพระราม 4
แขวงสีลม เขตบางรัก
กรุงเทพมหานคร 10500
| Concept | Bangkok | Province | English |
|---|---|---|---|
| Sub-district | แขวง | ตำบล (ต.) | Sub-district / Tambon / Khwaeng |
| District | เขต | อำเภอ (อ.) | District / Amphoe / Khet |
| Province | กรุงเทพมหานคร | จังหวัด (จ.) | Bangkok / Province / Changwat |
Never mix these. A Bangkok address must use แขวง/เขต; a provincial address must use ตำบล/อำเภอ. Mixing them is a strong "this address is wrong" signal.
| Thai | English / Roman |
|---|---|
| บ้านเลขที่ / เลขที่ | No. |
| หมู่ที่ / หมู่ / ม. | Moo / Mu |
| ซอย / ซ. | Soi |
| ถนน / ถ. | Road / Rd. |
| อาคาร / ตึก / คอนโด | Building / Block / Condo |
| ชั้น | Floor / Fl. |
| ห้อง | Unit / Room |
| ตำบล / ต. | Sub-district / Tambon |
| อำเภอ / อ. | District / Amphoe |
| แขวง | Sub-district / Khwaeng |
| เขต | District / Khet |
| จังหวัด / จ. | Province / Changwat |
| รหัสไปรษณีย์ | Postcode |
| Function | Returns |
|---|---|
parse_address(s) | dict with 11 keys (any may be None) |
validate_postcode(pc) | bool |
province_from_postcode(pc) | Thai province name or None |
parse_address return keyshouse_no, moo, soi, road, building, floor, unit, subdistrict, district, province, postcode. Each is a str or None. building covers อาคาร / ตึก / คอนโด.
Multi-token road names are captured up to the next address keyword, so
ถนนพระราม 9 แขวงห้วยขวาง … yields road = "พระราม 9". Thai numerals
(๐-๙) and compound names (ถนนเลียบทางด่วน, ถนนสาทรเหนือ) are supported.
| Prefix | Region |
|---|---|
| 10 | กรุงเทพมหานคร & ปริมณฑล (sub-districts of Samut Prakan also fall here) |
| 11 | นนทบุรี |
| 12 | ปทุมธานี |
| 20–27 | ภาคตะวันออก |
| 30–49 | ภาคอีสาน |
| 50–58 | ภาคเหนือ |
| 60–67 | ภาคเหนือตอนล่าง |
| 70–77 | ภาคกลาง/ตะวันตก |
| 80–86 | ภาคใต้ตอนบน |
| 90–96 | ภาคใต้ตอนล่าง |
Full 77-province table: provinces.json.
parse.py — python parse.py runs self-testsparse.ts — npx tsx parse.ts runs self-testsBangkok 10110 Wattana Khwaeng… in English order on a Thai-side label confuses postmen. Always small-to-large in Thai.123/4 and 123/04 may differ; preserve as the user wrote them.ซอยสุขุมวิท 21 is off ถนนสุขุมวิท). Don't merge them or you'll lose the sub-numbering.