Documentation Index
Fetch the complete documentation index at: https://mintlify.com/khaphanspace/gonhanh.org/llms.txt
Use this file to discover all available pages before exploring further.
Tone Placement
This guide explains how Gõ Nhanh determines where to place tone marks (dấu thanh) and diacritics (dấu phụ) in Vietnamese text.Overview
Vietnamese is a tonal language with 6 tones, represented by diacritical marks placed on vowels:| Tone | Mark | Example | Name |
|---|---|---|---|
| Level | (none) | ma | Ngang |
| Falling | ` | mà | Huyền |
| Rising | ´ | má | Sắc |
| Tumbling | ̉ | mả | Hỏi |
| Rising glottalized | ~ | mã | Ngã |
| Falling glottalized | ̣ | mạ | Nặng |
Basic Rules
Single Vowel
When the syllable has only one vowel, the tone mark goes on that vowel:Multiple Vowels
For syllables with 2-3 vowels, Gõ Nhanh uses the priority system:Priority 1: Vowels with existing diacritics
If a vowel already has a circumflex (^), horn (ơ, ư), or breve (ă), place the tone mark there.Examples:
sứa- tone onứ(has horn)đời- tone onờ(has horn)luật- tone onậ(has circumflex)
Modern vs. Traditional Tone Placement
Vietnamese has two accepted tone placement styles: Kiểu mới (Modern) and Kiểu cũ (Traditional).Kiểu mới (Modern) - Default
Based on phonetics and the 2018 Ministry of Education guidelines. Places tone marks according to the main vowel in IPA phonetic transcription. Examples:hoà(nothòa) - /wa/ → tone onakhoẻ(notkhỏe) - /wɛ/ → tone onethuỷ(notthủy) - /wi/ → tone ony
Kiểu cũ (Traditional)
Based on visual aesthetics and pre-1950 dictionaries. Places tone marks near the center of the word for balance. Examples:hòa(nothoà)khỏe(notkhoẻ)thủy(notthuỷ)
Changing the Style
In Settings → Quy tắc gõ → Đặt dấu kiểu mới:- Enabled = Modern style (hoà, khoẻ, thuỷ)
- Disabled = Traditional style (hòa, khỏe, thủy)
Both styles are correct and widely used in Vietnam. Choose based on your preference or organization’s style guide.
Tone Mark Matrix
Gõ Nhanh implements 43 vowel patterns covering all valid Vietnamese combinations.Two-Vowel Combinations
Common Diphthongs (Click to expand)
Common Diphthongs (Click to expand)
| Pattern | Keys | Tone Position | Examples |
|---|---|---|---|
| ai | A+I | a | hái, mài, sải, dãi, mại |
| ao | A+O | a | cao, sào, hảo, não, tạo |
| au | A+U | a | sau, mầu, dẩu, mãu, mậu |
| âu | A+A+U | â | sâu, lầu, đẩu, trẫu, chậu |
| ây | A+A+Y | â | đây, tầy, hẩy, mãy, mậy |
| eo | E+O | e | kẹo, rẻo, méo |
| êu | E+E+U | ê | kêu, rều, khểu, nghễu, liệu |
| ia | I+A | i | kía, ghì̀a, bỉa, nghĩa, xía |
| iê | I+E+E | ê | tiến, miền, kiểu, biễn, điệp |
| iu | I+U | i | dịu, kìu, tỉu |
| oa | O+A | a | hoa, toà, hoả, khoã, khoạ |
| oe | O+E | e | khoẻ, oé, toẹ |
| oi | O+I | o | tới, nòi, đổi, mõi, cọi |
| ôi | O+O+I | ô | tôi, hồi, tổi, mỗi, khối |
| ơi | O+W+I | ơ | bơi, nời, rởi, mỡi, nợi |
| ua | U+A | u (open) | mua, cùa, sủa, mũa, múa |
| ua | Q+U+A | a (after q) | qua, quà, quả, quã, quạ |
| uê | U+E+E | ê | huế, muền, tuể |
| ui | U+I | u | vui, nùi, thủi, nhũi, múi |
| uô | U+O+O | ô | thuốc, nguồn, quổng |
| uy | U+Y | y | quy, duyên, chuyển, hủy, thúy |
| ưa | U+W+A | ư | mưa, chừa, tửa, mữa, lựa |
| ươ | U+W+O | ơ | mười, người, lướn, khuỡng, lượm |
| ưu | U+W+U | ư (first) | lưu, hừu, dửu, mữu, kịu |
Three-Vowel Combinations
Triphthongs (Click to expand)
Triphthongs (Click to expand)
| Pattern | Keys | Tone Position | Examples |
|---|---|---|---|
| iêu | I+E+E+U | ê | tiêu, miều, diễu, liệu |
| yêu | Y+E+E+U | ê | yêu, nguyễn |
| oai | O+A+I | a | ngoài, loại, hoài, khoãi, ngoại |
| oay | O+A+Y | a | xoáy, khoảy, ngoãy |
| oeo | O+E+O | e | khoèo, ngoéo, khỏeo |
| uây | U+A+A+Y | â | khuấy, quầy, quẩy |
| uôi | U+O+O+I | ô | cuối, tuổi, nguồi, buổi |
| ươi | U+W+O+I | ơ | mười, tươi, lười, khuỡi, cười |
| ươu | U+W+O+U | ơ | rượu, hương, nước, cườm |
| uyê | U+Y+E+E | ê | chuyến, nguyện, tuyển |
Invalid Combinations
These vowel combinations do not exist in Vietnamese and will not receive diacritics:ou,eu,ae,yi,wuôa,âi,ôe(must use plain vowels)eng,êng(use-nhinstead:anh,ênh)
Diacritic Placement (Dấu phụ)
Before placing tone marks, Gõ Nhanh first applies diacritics (circumflex, horn, breve).Telex Method
| Input | Diacritic | Result |
|---|---|---|
aa | Circumflex | â |
ee | Circumflex | ê |
oo | Circumflex | ô |
aw | Breve | ă |
ow | Horn | ơ |
uw | Horn | ư |
Special Cases
- ươ (Both horns)
- uơ (Only o gets horn)
- ưu (First u gets horn)
- ươu (u,o get horn)
Input: Examples:
uow or uwoBoth u and o receive the horn:được, mười, ngườiFinal Consonant Rules
The final consonant (phụ âm cuối) affects tone placement:Open Syllables (No Final Consonant)
Tone mark placement follows the standard vowel priority rules.Closed Syllables (With Final Consonant)
When a syllable ends with a consonant, tone placement depends on whether the final is sonorant: Sonorant finals (-m, -n, -ng, -nh):
- Follow standard vowel priority
- All tones allowed
-p, -t, -c, -ch):
- Only sắc (rising) and nặng (falling glottalized) tones allowed
- Examples:
cấp,mật,các,ách✓ - Invalid:
cảp,mãt,càc,ạch✗
Implementation Details
Gõ Nhanh implements tone placement in the core Rust engine:Vowel Collection
Context-Aware Placement
Thefind_tone_position function considers:
- Number of vowels (1, 2, or 3)
- Diacritics present (circumflex, horn, breve)
- Final consonant (yes/no)
- Tone style (modern/traditional)
- Special initials (
qu,gi)
~/workspace/source/core/src/data/vowel.rs (Phonology module)
Vietnamese Orthography Resources
For a complete reference of Vietnamese phonology and orthography:- Vowel System: See
~/workspace/source/docs/vietnamese-language-system.mdSection 3 - Tone Placement Matrix: Section 7.6 (43 patterns)
- Validation Rules:
~/workspace/source/docs/validation-algorithm.md
Quick Reference
Vietnamese has:- 12 base vowels: a, ă, â, e, ê, i, o, ô, ơ, u, ư, y
- 29 diphthongs: ai, ao, au, ây, âu, eo, êu, ia, iê, iu, oa, oă, oe, oi, ôi, ơi, ua, uâ, uê, ui, uô, uy, ưa, ưi, ươ, ưu, yê
- 14 triphthongs: iêu, yêu, oai, oay, oeo, uây, uôi, uya, ươi, ươu, uyê, uyu, uêu, oao
- 6 tones: ngang, huyền, sắc, hỏi, ngã, nặng
Testing Tone Placement
You can verify tone placement by typing test words:Test Cases
| Input (Telex) | Expected Output | Tests |
|---|---|---|
hoaf | hoà (modern) or hòa (traditional) | oa+tone placement |
khoẻ | khoẻ (modern) or khỏe (traditional) | oe+tone placement |
nguyeenx | nguyễn | Triphthong uyê |
duowcj | được | ươ with tone |
luuuj | lưu | ưu with tone |
tieeus | tiếu | iêu with tone |
quatss | quất | ua after q + nặng |
Invalid Combinations
These should not transform:| Input (Telex) | Result | Reason |
|---|---|---|
taafoo | tàoo | V1 has tone → no circumflex on V2 |
tifaa | tìaa | V1 has tone → no circumflex on V2 |
ce | ce | Invalid consonant+vowel (use ke) |
Related Documentation
- Settings Guide - Configure tone placement style
- Per-App Configuration - App-specific settings