npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vietnamese-phonetic-transcript

v1.0.0

Published

A library for converting Vietnamese text to its phonetic transcription.

Readme

:notebook_with_decorative_cover: Table of Contents

:toolbox: Getting Started

:bangbang: Prerequisites

  • This project uses pnpm as package manager:

    npm install --global pnpm

:running: Run Locally

Clone the project:

git clone https://github.com/DuckyMomo20012/vietnamese-phonetic-transcript.git

Go to the project directory:

cd vietnamese-phonetic-transcript

Install dependencies:

pnpm install

:eyes: Usage

Bảng phiên âm âm vị học Tiếng Việt

Hệ thống âm đầu

Hệ thống âm đầu: 22 phụ âm

| STT | Âm vị | Chữ viết (+ bối cảnh sử dụng) | Ví dụ | | --- | ---------------- | --------------------------------------------- | ------------------- | | 1 | /b-/ | b | bè bạn | | 2 | /m-/ | m | mệt mỏi | | 3 | /f-/ | ph | phờ phạc | | 4 | /v-/ | v | vờ vĩnh | | 5 | /t-/ | t | tí tẹo | | 6 | /tʼ-/ | th | tha thướt | | 7 | /d-/ | đ | đủng đỉnh | | 8 | /n-/ | n | no nê | | 9 | /z-/ | d/gi | giầy da, bánh dầy | | 10 | /ʐ-/ | r | rườm rà | | 11 | /s-/ | x | xa xôi | | 12 | /ʂ-/ | s | san sẻ | | 13 | /c-/ | ch | chim chóc | | 14 | /ʈ-/ | tr | trang trại | | 15 | /ɲ-/ | nh | nhí nhảnh | | 16 | /l-/ | l | lươn lẹo | | 17 | /k-/ | k (+ âm chính: /-i-/, /-e-/, /-ɛ-/, /-ie-/) | kim, kê, kẻ, kiếm | | 17 | /k-/ | q (+ âm đệm: /-u-/) | quả, quýt, quê | | 17 | /k-/ | c (còn lại) | con, cà, cuống | | 18 | /χ-/ | kh | khắt khe | | 19 | /ŋ-/ | ngh (+ âm chính: /-i-/, /-e-/, /-ɛ-/, /-ie-/) | nghĩ, nghèo, nghiền | | 19 | /ŋ-/ | ng (còn lại) | ngố, ngáo, ngõ | | 20 | /ɣ-/ | gh (+ âm chính: /-i-/, /-e-/, /-ɛ-/, /-ie-/) | ghi, ghẻ, ghê | | 20 | /ɣ-/ | g (còn lại) | gà, gỗ, gụ | | 21 | /h-/ | h | hát hò | | 22 | /ʔ-/ hoặc /zero/ | không thể hiện | ăn, uống, uể, oải |

Hệ thống âm đệm

Hệ thống âm đệm: 2 bán nguyên âm

| STT | Âm vị | Chữ viết (+ bối cảnh sử dụng) | Ví dụ | | --- | ----------------- | --------------------------------------------------- | --------------------------------------- | | 1 | /-w-/ hoặc /-u-/ | u (+ âm đầu: /k-/ (ghi bằng con chữ "q")) | quê, quả, quán, quyên, quăn, quận, quốc | | 1 | /-w-/ hoặc /-u-/ | u (+ âm chính: /-i-/, /-e-/, /-ɤ-/, /-ɤ-/, /-ie-/) | huy, huế, huơ, huân, huyền | | 1 | /-w-/ hoặc /-u-/ | o (các trường hợp còn lại) | hoa, hoe, hoác, họa hoằn | | 2 | /zero/ | không thể hiện | hể hả, hiền, hương |

[!NOTE] Toàn bộ tài liệu sẽ sử dụng /-u-/ để biểu diễn âm đệm này.

Hệ thống âm chính

Hệ thống âm chính: 13 nguyên âm đơn, 3 nguyên âm đôi

| STT | Âm vị | Chữ viết (+ bối cảnh sử dụng) | Ví dụ | | --- | ------ | --------------------------------------------------------------- | ------------------------------------ | | 1 | /-i-/ | y (+ âm đệm: /-u-/ hoặc âm đầu, âm đệm, âm cuối đều là /zero/) | huy, thúy, quýt, ý (kiến), thoát (y) | | 1 | /-i-/ | i (còn lại) | im, đi, nhìn, mình | | 2 | /-e-/ | ê | lên, bên, tênh | | 3 | /-ɛ-/ | e | em, mẹ, kém | | 4 | /-ɯ-/ | ư | từ, chữ, từng | | 5 | /-ɤ-/ | ơ | trơn, mơ, lớp | | 6 | /-a-/ | a | má, mái, qua, lại | | 7 | /-u-/ | u | dù, súng | | 8 | /-o-/ | ô | cổ, bốn, bông | | 8 | /-o-/ | ôô (ít) | bôông | | 9 | /-ɔ-/ | o | con, có, đói | | 9 | /-ɔ-/ | oo (ít) | xoong | | 10 | /-ɤ-/ | â | trần, sân, tầng | | 11 | /-ɛ-/ | a | anh ách, nhanh nhách | | 12 | /-ă-/ | a (+ âm cuối: /-w/, /-j/) | rau, tay, quay | | 12 | /-ă-/ | ă (còn lại) | ăn năn, chăn, đắng | | 13 | /-ɔ-/ | o (+ âm cuối: /-ŋ/, /-k/) | ong óc, mong, móc | | 14 | /-ie-/ | iê (+ âm cuối khác /zero/, âm đệm /zero/) | biển, biếng | | 14 | /-ie-/ | yê (+ âm cuối khác /zero/, âm đệm /-u-/ hoặc âm đầu /ʔ/) | khuyên, yếu, yểng, yểm | | 14 | /-ie-/ | ia (+ âm cuối /zero/, âm đệm /zero/) | bia, mía, tía | | 14 | /-ie-/ | ya (+ âm cuối /zero/, âm đệm /-u-/) | khuya, tuya | | 15 | /-ɯɤ-/ | ươ (+ âm cuối khác /zero/) | ưỡn, lươn, bướng, hươu | | 15 | /-ɯɤ-/ | ưa (+ âm cuối /zero/) | mưa, ưa, chừa | | 16 | /-uo-/ | uô (+ âm cuối khác /zero/) | buồn, uống | | 16 | /-uo-/ | ua (+ âm cuối /zero/) | ùa, chùa |

Hệ thống âm cuối

Hệ thống âm cuối: 6 phụ âm, 2 bán nguyên âm

| STT | Âm vị | Chữ viết (+ bối cảnh sử dụng) | Ví dụ | | --- | ------ | --------------------------------------- | ----------------------------------- | | 1 | /-m/ | m | ôm, nam, nem | | 2 | /-n/ | n | ôn, nan, nến | | 3 | /-p/ | p | ốp, hấp | | 4 | /-t/ | t | tắt, hất | | 5 | /-ŋ/ | nh (sau âm chính: /-i-/, /-e-/, /-ɛ-/) | inh, ênh, anh, xinh, mệnh, xanh | | 5 | /-ŋ/ | ng (còn lại) | ong, ông, ung, ưng, kèng, kiểng | | 6 | /-k/ | ch (sau âm chính: /-i-/, /-e-/, /-ɛ-/) | ich, ếch, ách, thích, chệch, bạch | | 6 | /-k/ | c (còn lại) | óc, úc, ác, cóc, cúc, các, lắc, nấc | | 7 | /-w/ | o (sau âm chính: /-a-/, /-ɛ-/) | áo, éo, báo, béo | | 7 | /-w/ | u (còn lại) | au, eo, êu, iu, cháu, kêu, chịu | | 8 | /-j/ | y (sau âm chính: /-ă-/, /-ɤ-/) | cáy, cấy | | 8 | /-j/ | i (còn lại) | cái, ngoái, cưới, cuối | | 9 | /zero/ | không thể hiện | bà, bố, mẹ |

Syllable Analysis

This project includes a script to analyze Vietnamese syllables from a text file and validate them using phonetic transcription.

To run the analysis, use the following command:

npx tsx src/syllable_analysis.ts

Result:

  • Dictionary (all lines): 8,010

  • Valid syllables (transcribable): 7,413

  • Theoretical combinations: 151,632 [27 initials] × [3 glides] × [24 nuclei] × [13 codas] × [6 tones]

  • Comparisons:

    • Valid vs Dictionary: 92.5%
    • Valid vs Theoretical: 4.89%
    • Dictionary vs Theoretical: 5.28%
  • Differences:

    • Non-transcribable entries: 597
    • Missing from dictionary: 143,622

Why Only 7413 Syllables of Dictionary Entries Are Transcribable?

  1. Foreign Words in the Dictionary
  • Words like: accordeon, acid, albumin, alpha, ampere, antimon, aspirin, atlas. These are borrowed/foreign words that don't follow Vietnamese phonological rules.
  • Your transcript system correctly rejects them as non-Vietnamese syllables.
  1. Technical/Scientific Terms
  • Chemical compounds: aminoacid, ammoniac, amoniac.
  • Technical terms: atlat, atmotphe, apatit.
  • These often retain foreign pronunciation patterns.
  1. Abbreviations & Special Cases
  • Shortened forms: al, ag, as.
  • Currency codes: afghani, balboa, birr.
  • Brand names and proper nouns.

Why Only 1.2% of Theoretical Combinations Exist?

  1. Phonological Constraints
  • Not all consonant-vowel-tone combinations are pronounceable in Vietnamese.
  • Vietnamese has strict rules about which sounds can combine.
  • Example: Some initial consonants cannot precede certain vowels.
  1. Lexical Gaps
  • Even if a combination is pronounceable, it might not form a meaningful word.
  • Vietnamese vocabulary has evolved historically, leaving gaps in the sound space.
  1. Tonal Restrictions
  • Some vowel-consonant combinations are restricted to certain tones.
  • Checked syllables (ending in -p, -t, -c, -ch) can only have tones 1 and 5.
  1. Historical Language Evolution
  • Vietnamese has lost some syllables over time.
  • Sound changes have eliminated certain combinations.
  • Modern Vietnamese is more constrained than the theoretical maximum.

:wave: Contributing

Contributions are always welcome!

Please read the contribution guidelines.

:scroll: Code of Conduct

Please read the Code of Conduct.

:warning: License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License.

License: CC BY-NC-SA 4.0.

See the LICENSE.md file for full details.

:handshake: Contact

Duong Vinh - @duckymomo20012 - [email protected]

Project Link: https://github.com/DuckyMomo20012/vietnamese-phonetic-transcript.