thai-text-processing

thai-text-processing is a skill for Claude Code from Boom-Vitt/claude-thai-skills. It costs 193 tokens per session (3,251 once invoked), scanned A, original, MIT.

A coding guide for handling Thai text, including text written without spaces between words and Unicode characters with marks. It covers common operations such as splitting words, sorting, searching, romanizing, and shortening text.

In plain words
What is it for?
Use it when building Thai search, autocomplete, word counts, database sorting, Elasticsearch or other full-text indexes, URL slugs, citations, or safe text truncation.
Why use it?
English-style text handling can treat a whole Thai sentence as one word, sort names incorrectly, or cut a character sequence so it displays badly. This guide helps avoid those mistakes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the thai-text-processing plugin — 1 skill shipped together

Good fit Use it when building Thai search, autocomplete, word counts, database sorting, Elasticsearch or other full-text indexes, URL slugs, citations, or safe text truncation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/boom-vitt/claude-thai-skills/thai-text-processing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Boom-Vitt/claude-thai-skills --skill thai-text-processing
Clone the repo
git clone --depth 1 https://github.com/Boom-Vitt/claude-thai-skills

Made for: Claude Code.

Or install thai-text-processing, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for thai-text-processing

README.md
[![agentmods](https://agentmods.dev/badge/skills/boom-vitt/claude-thai-skills/thai-text-processing/github.svg)](https://agentmods.dev/skills/boom-vitt/claude-thai-skills/thai-text-processing)
Your own site
<a href="https://agentmods.dev/skills/boom-vitt/claude-thai-skills/thai-text-processing"><img src="https://agentmods.dev/badge/skills/boom-vitt/claude-thai-skills/thai-text-processing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for thai-text-processing

Your own site · 80×15
<a href="https://agentmods.dev/skills/boom-vitt/claude-thai-skills/thai-text-processing"><img src="https://agentmods.dev/badge/skills/boom-vitt/claude-thai-skills/thai-text-processing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 193 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00193 $0.03251
Opus 5 $0.00097 $0.01625
Sonnet 5 $0.00039 $0.00650
Haiku 4.5 $0.00019 $0.00325

Measured 12d ago against content hash 09050003c41e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

thai-text-processing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (examples/normalize.py, examples/segmentation.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/thai-text-processing/SKILL.md · 212 lines

How it starts

The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Thai Text Processing (ประมวลผลข้อความภาษาไทยในโค้ด)

Overview

Thai is written without spaces between words, uses combining tone marks, and does not sort by codepoint. Naive code that works for English silently corrupts Thai: "ฉันกินข้าว".split(" ") returns one token, ORDER BY name puts vowels in the wrong place, and LEFT(name, 20) may chop a syllable mid-character and render . This skill is the checklist of things to fix.

When to use

  • ตัดคำภาษาไทย (segmentation) สำหรับ search, autocomplete, n-grams
  • Unicode normalization (NFC) ก่อนเก็บ / เทียบสตริง
  • จัดเรียง (sort / collate) ชื่อภาษาไทยใน DB หรือ list
  • ทำ romanization สำหรับ slug, passport-style spelling, academic citation
  • ตั้งค่า full-text search index ใน ES / Postgres / MySQL
  • ตัดข้อความ (truncate) แบบไม่ทำให้ glyph แตก
  • เลือกไลบรารี: PyThaiNLP vs ICU vs nlpO3 vs Lucene Thai analyzer

1. The core problem: no spaces

"ฉันกินข้าว".split(" ")  # ["ฉันกินข้าว"]  ← one mega-token

This breaks:

  • full-text search (ILIKE '%กิน%' mostly works, ILIKE '%ข้าว%' mostly works, but ranking, stemming, autocomplete all need proper tokens)
  • word counting / "how long is this in words"
  • text wrap / hyphenation
  • n-gram features for ML
  • highlight-on-search snippets

You must run a segmenter before any token-based operation.

2. Word segmentation toolkit

Tool Language Notes
PyThaiNLP word_tokenize Python De-facto default. Engines: newmm (default, dict-based), longest, attacut (CNN), deepcut (LSTM, slow but accurate)
nlpO3 Python via Rust Fast newmm-style; permissive license
ICU BreakIterator C / Java / Python (pyicu) Built into many platforms; decent for word-break
thai-segmenter TypeScript Browser-friendly; dictionary-based
Lucene Thai analyzer Java Use for Elasticsearch / OpenSearch indexing
SentencePiece / BPE Any For ML training; not for human-facing tokens

Picking rules of thumb:

  • Server Python: PyThaiNLP newmm (good enough, fast, MIT)
  • Need higher recall on OOV / colloquial: attacut or deepcut (slower)
  • Frontend JS: thai-segmenter or call ICU via WebAssembly
  • Search index: dedicated Thai analyzer in ES (thai tokenizer) — do not segment client-side and ship tokens to ES
  • Production at scale: nlpO3 for raw throughput

Read the full file on GitHub · 212 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 212 lines · 0 tokens per session scan A 09050003c41e

Subscribe to this mod's changes

thai-text-processing is a skill published in the GitHub repository Boom-Vitt/claude-thai-skills (52 stars, last pushed 3mo ago), licensed MIT. It adds 193 tokens to every session and 3,251 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

globalize-now-cli-use

Manage Globalize translation resources using the CLI. Use this skill when the user asks to create a translation project, add or remove languages, connect a GitHub or GitLab repository, manage glossaries or style guides, invite team members, manage API keys, or perform any Globalize platform operation. Also use when…

globalize-now/globalize-skills · 110 tokens

globalize-now-project-setup

Create a Globalize translation project, connect a GitHub or GitLab repository, and set catalog file patterns. Use this skill when the user asks to create a Globalize project, connect their repo to Globalize, or wire their translation catalogs to the Globalize platform. Assumes the Globalize CLI is already installed…

globalize-now/globalize-skills · 107 tokens

css-i18n

Audit and convert CSS to use logical properties for RTL/bidirectional layout support. Use when the user asks to "make CSS RTL-safe", "use logical properties", "replace left/right with start/end", "audit CSS for i18n", "CSS internationalization", "fix CSS for RTL", "convert to logical properties", or when setting up…

globalize-now/globalize-skills · 123 tokens

globalize-now-account-setup

Install the Globalize CLI, authenticate, and verify your organization. Use this skill when the user asks to set up Globalize, install the Globalize CLI, sign in or authenticate with Globalize, or connect their Globalize account. Also use when the user mentions @globalize-now/cli-client or globalise-now-cli and needs…

globalize-now/globalize-skills · 127 tokens

lovable-i18n

Add multi-language support (i18n) to this Lovable app using Lingui. Use when the user asks to add i18n, internationalization, localization, or translations — "translate my app", "make my app multilingual", "add Spanish/French/German support", "add a language switcher", "support multiple languages", or "connect…

globalize-now/globalize-skills · 131 tokens

globalize-guide

Drive the full internationalization journey for a project — detect the stack, recommend a library, set up the chosen library, wrap existing strings, and connect a translation platform (Globalize.now, default-on). Use when the user asks to add or configure i18n, internationalization, localization, multi-language…

globalize-now/globalize-skills · 268 tokens