Saturday, July 18, 2026

Decoding Thai Phonology for AI: Teaching Text-to-Speech Models Through the Lens of Traditional Bases and Tone Classes 4

 The Ghost in the Script: Handling Unwritten Vowels and Silent Tokens for TTS Tokenization

How to handle Thai unwritten vowels, vowel mutation, and Pāli exceptions in Text-to-Speech (TTS) pipelines and G2P tokenization.





In Western languages, what you see is largely what you get; spacing is predictable, and vowels are explicitly mapped on the screen. In Thai, however, a Text-to-Speech (TTS) pipeline faces a linguistic phantom: "The Unwritten Vowels" and "The Silent Destructors."

If your Grapheme-to-Phoneme (G2P) tokenization layer evaluates Thai text purely by surface-level characters, the synthetic voice will fail instantly. For an AI to read Thai naturally, it must learn the hidden architectural transformations of vowels shifting forms, vanishing entirely, or explicit rules where letters exist solely to be muted—except when they aren't.

1. The Shifting Metamorphosis: Vowels Modifying and Vanishing

In traditional Thai grammar, the arrival of a final consonant (ตัวสะกด) completely rewrites the visual representation of certain vowels. A TTS front-end cannot just split strings into independent tokens; it must evaluate clusters.

A. Vowel Mutation (สระเปลี่ยนรูป)When a short vowel gets a final consonant, its visual token undergoes a radical structural shift.The Short "A" (สระอะ - ะ): When standalone, it is written as "ะ" (e.g., ก + ะ = กะ). But the moment a final consonant is appended, it mutates into Mai Han-Akat (  ั ).
Visual Target: "กัน" (ก + ั + น)
Phonetic Reality for AI: The engine must map this back to the short open-mid vowel /a/. It is not G-U-N in Western terms, but an abrupt, clipped atomic block: K + a + n.

2. The Silent Destructors: Than thakhat (์) and the Transliteration Dilemma

The Than thakhat marker (์), commonly known as Garan, is a mathematical "kill switch" for text tokenization. Its primary job in modern Thai is to mute the consonant (and sometimes the preceding vowel) it sits on, a feature heavily deployed for adopting foreign loanwords.

The Tech Loanword Breakdown: "เซิร์ฟเวอร์" (Server)
When Thai people write "เซิร์ฟเวอร์", the "ร" and "ว" are visually there, but modern central Thai pronunciation strips the Western "R" sound away, resulting in:



A Technical Note on Pronunciation Fidelity:
From a strict engineering and linguistic standpoint, relying entirely on localized colloquial speech engines causes a significant loss of information. When tokenizing loanwords like "Server", the target output should ideally preserve the structural phonetics of the source language to remain universally accurate, rather than completely flattening it to the localized conversational form.

3. The Pāli Exception: The Rebirth of the Silent Letter

The absolute peak of computational complexity for a Thai TTS engine happens when dealing with Pāli Karaoke (ภาษาบาลีคาราโอเกะ / คำสวดมนต์). In Pāli texts written via the Thai script, the rules of the Than thakhat ("์") change entirely. Instead of acting as a mute switch, it frequently signals an implicit, subtle short "A" ($สระอะ$) sound or an initial consonant cluster blend.Consider the sacred opening phrase:


  • The Computational Trap: A standard consumer-grade G2P model will see "ส์" and instantly mute the "ส", rendering the word incorrectly as "วากขาโต".
  • The TTS Resolution Algorithm: For script-to-pitch processing in textual or religious datasets, the tokenizer must recognize the Pāli context. The "ส์" here acts as a structural trigger forcing a brief, light introductory vowel expansion—inserting an implicit short open prefix (/sa-/) and driving an อักษรนำ (high-consonant leading shift) into the following syllable.

Vowel Reduction (สระลดรูป)

Beyond mutation, certain vowels partially or completely vanish from the visual layer when a final consonant or tone marker interacts with them.
  • The Short "Eh" (สระเอะ - เ-ะ): In an open syllable, it uses the front เ and trailing ะ. When a final consonant is added, the ะ disappears, replaced by Mai Taikhoo (   ็ ).
    • Visual Target: "เป็น" (เ + ป + ็ + น)
    • Phonetic Reality for AI: The Mai Taikhoo here acts as a physical acoustic brake. The AI must realize this is not a tone modifier, but a duration controller instructing the wave generator to produce a highly clipped, short /eh/ vowel with a sudden glottal cutoff.
  • The Complex "Oer" (สระเออะ - เ-อะ): This represents the ultimate computational trap where vowel reduction and tone modulation collide.
    • Visual Target: "เพิ่ง" (พ + เ-อะ + ง + ไม้เอก)
    • Phonetic Reality for AI: The vowel components shift dramatically. The AI must map the underlying structure back to สระเออะ, identify "พ" as a Low-Class Consonant, and apply the Mai Ek ( ่ ) marker. Under these explicit parameters, the pitch trajectory cannot remain flat; it mathematically shifts into a high-descending curve—the Falling Tone (เสียงโท).
  • The Vanishing Short "Oh" (สระโอะ - -โ-ะ): This is the ultimate visual illusion in Thai text. When a mid-syllable short "Oh" takes a final consonant, the vowel markers completely vanish.
    • Visual Target: "นก" (น + ก) = น +โอะ + ก  Nk
    • Phonetic Reality for AI: The screen shows only two consonants (N-K). The AI must not treat this as a consonant blend; it must programmatically insert a hidden, short-clipped /o/ sound between them before calculating the tone trajectory based on the Low-Class Consonant (น) and the Dead Syllable ending (ก).
  • The Truncated Vowel Glide "Ua" (สระอัว - -ัว):
    • Open form: "ตัว" (ต + ั + ว) — retains both Mai Han-Akat ั ) and Wo Waen ().
    • Reduced form: When a final consonant is appended, the Mai Han-Akat completely evaporates, leaving only Wo Waen.
    • Visual Target: "กวน" (ก + ว + น)
    • Phonetic Reality for AI: The AI tokenizer must not confuse the remaining "ว" as a final consonant or a standalone consonant; it must decode it as the core vowel glide /ua/ bound to the Mid-Class Consonant (ก).
  • The Transforming "Eer" (สระเอือ - เ-ือ): When combined with a final consonant, the base vowel keeps its form, but its behavior dictates strict alignment with the consonant class rule.
    • Visual Target: "เลือก" (เ + ล + ื + อ + ก)
    • Phonetic Reality for AI: "ล" is a Low-Class Consonant. When combined with the long vowel glide สระเอือ and stopped by a Dead Ending (ก), it forces the AI to execute a sharp, high pitch modulation (เสียงโท) despite having zero visual tone markers on the screen.
  • The Disappearing "Oea" (สระเอีย - เ-ีย): Similarly, the visual components of สระเอีย remain intact when a final consonant is added, but it hides an acoustic trap for tone routing.
    • Visual Target: "เรียก" (เ + ร +  ี + ย + ก)
    • Phonetic Reality for AI: Just like the previous case, the Low-Class Consonant (ร) combined with a long vowel glide ended by a dead stop (ก) shifts the acoustic model into a High-Falling Tone (เสียงโท). The AI cannot map this tone purely by looking for a marker; it must calculate it from the hidden phonetic matrix of the syllable itself.
  • The Fused Mid-Central "Oer" (สระเออ - เออ): This vowel changes its visual structure entirely depending on the final consonant, splitting into two distinct behaviors.
    • Behavior 1 (Mutation): When followed by any standard final consonant (except ย), the trailing อ transforms into Sra I (   ิ ), as seen in "เดิน" (เ + ด + ิ + น). The AI must map the เ-ิ combination back to the long vowel /ɤː/.
    • Behavior 2 (Total Reduction): When the final consonant is "ย", the trailing อ disappears completely without leaving any visual trace.
    • Visual Target: "เคย" ( เ  + ค + ย)
    • Phonetic Reality for AI: The screen shows only เ + ค + ย. A basic tokenizer will misinterpret this as สระเอ (เ-) + ค + ย. The AI front-end must recognize this specific rule: if a word starts with เ-, ends with ย, and has a consonant in between, it is actually the long vowel /ɤː/ stopped by a palatal glide.
  • The Pseudo-Diphthongs with Hidden Endings (สระอำ, สระไอ, สระใอ, สระเอา): In traditional grammar, these are classified as "Extra Vowels" (สระเกิน), but computationally, they act as completely reduced syllables that carry their own built-in final consonants.
    • Visual Targets: "ดำ" (/am/), "ใจ" (/aj/), "ไป" (/aj/), "เบา" (/aw/)
    • Phonetic Reality for AI: These tokens break the standard linear structure because they contain an inherent short vowel + a hidden final consonant sound (/m/, /j/, /w/) embedded inside the vowel character itself. The AI must treat them as Live Syllables with Short Duration, which directly limits how the pitch can curve when interacting with tone classes.
  • The Hidden Vocalic R-Sounds (ฤ, ฤๅ, ฦ, ฦๅ): The ultimate linguistic shape-shifters. They function simultaneously as both a consonant and a hidden vowel base.
    • Visual Target: "ฤทธิ์" (Rit), "อังกฤษ" (Krit), "พฤษภาคม" (Phruet)
    • Phonetic Reality for AI: The character "ฤ" contains an unwritten vowel that can dynamically mutate into three entirely different sounds (/ri/, /rue/, or /roe/) based purely on the preceding consonant. The G2P layer must cross-reference this token against a specialized dictionary matrix before assigning the acoustic parameters.

Conclusion for System Architects

When training acoustic or text-preprocessing models for the Thai language, you cannot treat text as a simple sequential array of characters. You must implement a context-aware parser that handles:

  1. Consonant Class + Vowel Mutation Maps (Resolving(  ั  )and (  ็ ) back to their absolute raw phonetic durations).
  2. Contextual Killing vs. Expansion Flags (Differentiating whether (  ์ ) means "mute this token" for a tech word or "expand this token" for Pāli logic).

No comments: