vietnamese-name-generator 0.11.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,10 +2,15 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/vietnamese-name-generator)](https://www.npmjs.com/package/vietnamese-name-generator)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/vietnamese-name-generator)](https://www.npmjs.com/package/vietnamese-name-generator)
5
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/vietnamese-name-generator)](https://bundlephobia.com/package/vietnamese-name-generator)
5
6
  [![CI](https://github.com/hungnguyen18/vietnamese-name-generator/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/hungnguyen18/vietnamese-name-generator/actions/workflows/ci.yml)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0%2B-blue)](https://www.typescriptlang.org/)
8
+ [![zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://www.npmjs.com/package/vietnamese-name-generator)
6
9
  [![license](https://img.shields.io/github/license/hungnguyen18/vietnamese-name-generator)](./LICENSE)
7
10
 
8
- The most comprehensive Vietnamese name toolkit for JavaScript/TypeScript. Generate, parse, validate, format, and analyze Vietnamese names with full cultural awareness.
11
+ **[Documentation](https://hungnguyen18.github.io/vietnamese-name-generator/)** | **[Try on StackBlitz](https://stackblitz.com/edit/vietnamese-name-generator-demo?file=index.ts)** | **[API Reference](https://hungnguyen18.github.io/vietnamese-name-generator/api/)**
12
+
13
+ The most comprehensive Vietnamese name toolkit for JavaScript/TypeScript. Generate, parse, validate, format, and analyze Vietnamese names — plus a full **Vietnamese honorific & address system** (xưng hô) with age-based pronouns, 30+ professional/military/political titles, regional dialects, and formality levels.
9
14
 
10
15
  Zero runtime dependencies. Ships as CJS + ESM with full TypeScript declarations.
11
16
 
@@ -16,6 +21,8 @@ Zero runtime dependencies. Ships as CJS + ESM with full TypeScript declarations.
16
21
  - **No npm alternative** for Vietnamese name parsing, gender detection, or validation
17
22
  - **Census-weighted** surname distribution (Nguyễn ~40%, Trần ~11%, Lê ~9%...)
18
23
  - **Culturally correct** -- regional variants (Hoang/Huynh), gender-encoded middle names, proper honorifics
24
+ - **Vietnamese address system (xưng hô)** -- age-based pronoun pairs (con/ông, cháu/chú, em/anh...), the nâng principle, regional dialect variants (Central "o" vs "cô"), and 5 formality levels from "Kính gửi" to "ơi"
25
+ - **30+ professional titles** -- academic (Giáo sư, Tiến sĩ), medical (Bác sĩ, Dược sĩ), legal (Luật sư), military (12 ranks from Đại tướng to Thiếu úy), political (Tổng Bí thư, Chủ tịch, Đồng chí), education (Thầy/Cô)
19
26
  - **i18n-ready** -- NFC normalization, accent-insensitive search, Vietnamese sort order
20
27
  - **Cultural depth** -- Five Elements (Ngu Hanh), Han Viet characters, protective nicknames, pet names
21
28
  - **AI/testing-friendly** -- deterministic seed, batch generation, CSV/JSON export
@@ -35,18 +42,41 @@ import {
35
42
  generate,
36
43
  parseName,
37
44
  detectGender,
45
+ addressCalculate,
46
+ pronounPairGet,
38
47
  salutation,
39
48
  romanize,
40
49
  getHanViet,
41
50
  getBirthYearElement,
42
51
  generatePetName,
43
52
  generateNickname,
53
+ generateGenZNickname,
44
54
  } from 'vietnamese-name-generator';
45
55
 
46
56
  // Generate a realistic Vietnamese name
47
57
  const name = generate({ seed: 42 });
48
58
  // { surname: 'Phan', middleName: 'Ngoc', givenName: 'Kim Trang', ... }
49
59
 
60
+ // Cross-cultural GenZ name (Japanese/Korean/Western influenced)
61
+ generate({ style: 'japanese', seed: 1 });
62
+ // { surname: 'Nguyễn', middleName: 'Minh', givenName: 'Sakura', ... }
63
+
64
+ // GenZ nickname from a Vietnamese name
65
+ generateGenZNickname({ name: 'Trần Thảo Linh', style: 'jp-suffix', seed: 5 });
66
+ // { nickname: 'Linh-chan', style: 'jp-suffix', culturalNote: '...' }
67
+
68
+ // Vietnamese address & honorific system (age-based pronouns)
69
+ addressCalculate('Nguyễn Văn Nam', { speakerAge: 25, addresseeAge: 60 });
70
+ // { honorific: 'Ông', addressTerm: 'Ông Nam', pronounPair: { self: 'con', addressee: 'ông' }, ... }
71
+
72
+ // Professional title addressing
73
+ addressCalculate('Trần Thị Lan', { role: 'doctor' });
74
+ // { honorific: 'Bác sĩ', addressTerm: 'Bác sĩ Lan', category: 'professional', ... }
75
+
76
+ // Get pronoun pair for any age relationship
77
+ pronounPairGet(25, 45, { gender: EGender.Male, region: ERegion.North });
78
+ // { self: 'em', addressee: 'anh' }
79
+
50
80
  // Parse any Vietnamese name into structured parts
51
81
  parseName('Nguyen Van An');
52
82
  // { surname: 'Nguyen', middleName: 'Van', givenName: 'An' }
@@ -108,6 +138,7 @@ npx vietnamese-name-generator --export json --count 50
108
138
  | `generateNickname(options?)` | `INicknameResult` | Traditional protective nickname |
109
139
  | `generatePetName(options?)` | `IPetNameResult` | Vietnamese pet name |
110
140
  | `generateManyPetNames(count, options?)` | `IPetNameResult[]` | Batch pet names |
141
+ | `generateGenZNickname(options?)` | `IGenZNicknameResult` | GenZ nickname (JP/KR/EN influenced) |
111
142
 
112
143
  ### Parsing & Validation
113
144
 
@@ -117,13 +148,20 @@ npx vietnamese-name-generator --export json --count 50
117
148
  | `validateName(input)` | `IValidationResult` | Validate Vietnamese name with specific failure reasons |
118
149
  | `detectGender(input)` | `IGenderResult` | Infer gender from middle + given name signals |
119
150
 
151
+ ### Address & Honorifics
152
+
153
+ | Function | Returns | Description |
154
+ |----------|---------|-------------|
155
+ | `addressCalculate(name, options?)` | `IAddressResult` | Vietnamese address term with pronoun pair (age-based, professional, regional) |
156
+ | `pronounPairGet(speakerAge, addresseeAge, options?)` | `IPronounPair` | Get self/addressee pronoun pair for any age relationship |
157
+ | `salutation(name, options?)` | `ISalutationResult` | Simple Vietnamese honorific (deprecated, use `addressCalculate`) |
158
+
120
159
  ### Formatting & i18n
121
160
 
122
161
  | Function | Returns | Description |
123
162
  |----------|---------|-------------|
124
163
  | `romanize(input)` | `string` | Remove Vietnamese diacritics |
125
164
  | `formatName(parts, format)` | `string` | Format as full/abbreviated/reversed/slug |
126
- | `salutation(name, options?)` | `ISalutationResult` | Culturally correct Vietnamese honorific |
127
165
  | `normalize(input)` | `string` | NFC Unicode normalization |
128
166
  | `accentInsensitiveMatch(text, query)` | `boolean` | Search ignoring diacritics |
129
167
  | `accentInsensitiveEqual(a, b)` | `boolean` | Compare ignoring diacritics |
@@ -161,16 +199,150 @@ fakerVi.internet.email(); // 'an.nguyen@gmail.com'
161
199
  fakerVi.internet.username(); // 'annguyen'
162
200
  ```
163
201
 
164
- ### Enums
202
+ ### Cross-Cultural GenZ Names
165
203
 
166
- | Enum | Values |
167
- |------|--------|
204
+ Generate Vietnamese names influenced by Japanese, Korean, and Western naming trends:
205
+
206
+ ```typescript
207
+ import { generate } from 'vietnamese-name-generator';
208
+
209
+ // Japanese-influenced name
210
+ generate({ style: 'japanese', seed: 1 });
211
+ // { surname: 'Nguyễn', middleName: 'Minh', givenName: 'Sakura', ... }
212
+
213
+ // Korean-influenced name
214
+ generate({ style: 'korean', seed: 2 });
215
+ // { surname: 'Trần', middleName: 'Bảo', givenName: 'Ha-eun', ... }
216
+
217
+ // Western-influenced name
218
+ generate({ style: 'western', seed: 3 });
219
+ // { surname: 'Lê', middleName: 'Gia', givenName: 'Leo', ... }
220
+
221
+ // Hybrid (names that work across VN + foreign contexts)
222
+ generate({ style: 'hybrid', seed: 4 });
223
+ // { surname: 'Phạm', middleName: 'An', givenName: 'Kai', ... }
224
+ ```
225
+
226
+ Each crosscultural name entry includes rich metadata: origin culture, native script (kanji/hangul), meaning, Vietnamese phonetic adaptation, and popularity score.
227
+
228
+ ### GenZ Nickname Generator
229
+
230
+ Generate Vietnamese GenZ-style nicknames with 6 cultural styles:
231
+
232
+ ```typescript
233
+ import { generateGenZNickname } from 'vietnamese-name-generator';
234
+
235
+ // From an existing Vietnamese name
236
+ generateGenZNickname({ name: 'Nguyễn Minh Anh', style: 'jp-suffix', seed: 1 });
237
+ // { nickname: 'Anh-chan', style: 'jp-suffix', origin: 'japanese-honorific', culturalNote: '...' }
238
+
239
+ generateGenZNickname({ name: 'Trần Văn Nam', style: 'english-viet', seed: 2 });
240
+ // { nickname: 'Kevin Tran', style: 'english-viet', origin: 'viet-diaspora-english', ... }
241
+
242
+ // Random mode (no input name)
243
+ generateGenZNickname({ style: 'cute', seed: 3 });
244
+ // { nickname: 'Bé Xoài', style: 'cute', origin: 'vietnamese-cute-tradition', ... }
245
+
246
+ generateGenZNickname({ style: 'social-handle', seed: 4 });
247
+ // { nickname: 'dreamy.linh', style: 'social-handle', ... }
248
+ ```
249
+
250
+ **Nickname styles:**
251
+
252
+ | Style | Description | Examples |
253
+ |-------|-------------|---------|
254
+ | `social-handle` | TikTok/Instagram handles | `minh.03`, `itz.linh`, `_an_` |
255
+ | `jp-suffix` | Japanese honorific suffixes | `Linh-chan`, `Minh-kun`, `An-sama` |
256
+ | `kr-suffix` | Korean honorifics | `Minh oppa`, `Linh unnie`, `An-ah` |
257
+ | `cute` | Vietnamese cute nicknames | `Bé An`, `Mimi`, `Gấu`, `Xoài` |
258
+ | `meme` | Vietnamese internet memes | `Kevin Nguyễn`, `Phở Mai Que` |
259
+ | `english-viet` | English + VN surname | `Jenny Phạm`, `Ryan Trần` |
260
+
261
+ ### Vietnamese Address & Honorific System
262
+
263
+ Vietnamese has no universal "you" or "I" — pronouns encode **age, gender, social status, and emotional distance**. This system implements the full decision tree:
264
+
265
+ ```typescript
266
+ import { addressCalculate, pronounPairGet, EFormality, EGender, ERegion } from 'vietnamese-name-generator';
267
+
268
+ // Age-based addressing: 25-year-old speaking to 60-year-old
269
+ addressCalculate('Nguyễn Văn Nam', {
270
+ speakerAge: 25,
271
+ addresseeAge: 60,
272
+ region: ERegion.North,
273
+ });
274
+ // {
275
+ // honorific: 'Ông',
276
+ // addressTerm: 'Ông Nam',
277
+ // fullAddress: 'Ông Nam',
278
+ // pronounPair: { self: 'con', addressee: 'ông' },
279
+ // category: 'age-based',
280
+ // }
281
+
282
+ // Professional title takes priority over age
283
+ addressCalculate('Trần Thị Lan', {
284
+ role: 'professor',
285
+ speakerAge: 30,
286
+ addresseeAge: 55,
287
+ });
288
+ // { honorific: 'Giáo sư', addressTerm: 'Giáo sư Lan', ... }
289
+
290
+ // Formality levels
291
+ addressCalculate('Lê Minh Tuấn', {
292
+ speakerAge: 30,
293
+ addresseeAge: 50,
294
+ formality: EFormality.WrittenFormal,
295
+ });
296
+ // { fullAddress: 'Kính gửi Chú Tuấn', ... }
297
+
298
+ addressCalculate('Phạm Thảo', {
299
+ formality: EFormality.Intimate,
300
+ });
301
+ // { fullAddress: 'Thảo ơi', ... }
302
+
303
+ // Regional variants (Central Vietnam uses 'o' instead of 'cô')
304
+ pronounPairGet(25, 40, { gender: EGender.Female, region: ERegion.Central });
305
+ // { self: 'em', addressee: 'chị' }
306
+ ```
307
+
308
+ **Age gap → Pronoun mapping:**
309
+
310
+ | Age Gap (addressee - speaker) | Addressee Term | Self Term | Relationship |
311
+ |-------------------------------|---------------|-----------|-------------|
312
+ | +20 or more | Ông/Bà | con | Grandparent generation |
313
+ | +10 to +19 | Chú/Cô | cháu | Parent generation |
314
+ | +3 to +9 | Anh/Chị | em | Older sibling |
315
+ | -2 to +2 | Anh/Chị | em | Same age (nâng principle) |
316
+ | -9 to -3 | Em | anh/chị | Younger sibling |
317
+ | -19 to -10 | Cháu | chú/cô | Child generation |
318
+ | -20 or less | Con | ông/bà | Grandchild generation |
319
+
320
+ **Professional titles (30+ roles across 6 categories):**
321
+
322
+ | Category | Example Roles |
323
+ |----------|--------------|
324
+ | Academic | `professor` (Giáo sư), `phd` (Tiến sĩ), `master` (Thạc sĩ) |
325
+ | Medical | `doctor` (Bác sĩ), `pharmacist` (Dược sĩ), `dentist` (Nha sĩ) |
326
+ | Legal | `lawyer` (Luật sư), `judge` (Thẩm phán) |
327
+ | Military | `general` (Đại tướng) through `second-lieutenant` (Thiếu úy) — 12 ranks |
328
+ | Political | `general-secretary` (Tổng Bí thư), `president` (Chủ tịch), `comrade` (Đồng chí) |
329
+ | Education | `teacher-male` (Thầy), `teacher-female` (Cô) |
330
+
331
+ ### Enums & Types
332
+
333
+ | Enum/Type | Values |
334
+ |-----------|--------|
168
335
  | `EGender` | `male`, `female`, `unisex` |
169
336
  | `ERegion` | `north`, `central`, `south` |
170
337
  | `EEra` | `traditional`, `modern` |
338
+ | `TNameStyle` | `japanese`, `korean`, `western`, `hybrid` |
171
339
  | `EMeaningCategory` | `strength`, `virtue`, `nature`, `precious`, `beauty`, `celestial`, `season`, `intellect`, `prosperity` |
172
340
  | `ENameFormat` | `full`, `abbreviated`, `reversed`, `slug` |
173
341
  | `EElement` | `kim` (Metal), `moc` (Wood), `thuy` (Water), `hoa` (Fire), `tho` (Earth) |
342
+ | `EFormality` | `written-formal`, `spoken-formal`, `professional`, `casual`, `intimate` |
343
+ | `EHonorificCategory` | `royal`, `mandarin`, `scholar`, `family`, `age-based`, `professional`, `religious`, `genz`, `regional` |
344
+ | `EReligion` | `buddhism`, `catholicism`, `cao-dai`, `hoa-hao`, `folk` |
345
+ | `EFeudalRank` | `emperor`, `consort`, `prince`, `princess`, `nobility`, `mandarin`, `scholar` |
174
346
 
175
347
  ---
176
348
 
@@ -255,6 +427,39 @@ Under feudal dynasties, using the emperor's personal name or a near-homophone wa
255
427
 
256
428
  This library includes a protective nickname generator (`generateNickname()`) honoring this tradition.
257
429
 
430
+ ### Cross-Cultural Naming Trends (GenZ/Gen Alpha)
431
+
432
+ Vietnamese naming culture is evolving rapidly under Japanese, Korean, and Western influences:
433
+
434
+ - **Japanese influence (anime/manga):** Names like Sakura (桜), Hana (花), Ren (蓮), Akira (明) are increasingly used by Vietnamese parents. Many Japanese names have phonetic compatibility with Vietnamese (e.g., Mei ≈ Mai, Akira's kanji 明 = Minh in Han Viet).
435
+ - **Korean influence (K-pop/K-drama):** Names like Jimin, Ha-eun, Min-jun are adapted via Han-Viet phonetic mapping (e.g., Ha-eun → Hà Ân, Min-jun → Min Tuấn). Korean naming sites report Vietnamese parents as a significant international audience.
436
+ - **Western influence:** Short, internationally pronounceable names (Leo, Mia, Kai) are popular. The "Kevin Nguyen" meme (from Subtle Asian Traits, 2018) reflects the Viet diaspora naming pattern.
437
+ - **GenZ nickname culture:** Vietnamese GenZ creates nicknames by mixing languages — Japanese suffixes (-chan, -kun), Korean honorifics (oppa, unnie), syllable doubling (Mimi, Nana), cute food/animal names (Xoài, Gấu), and social media handle patterns.
438
+
439
+ Sources: [Kilala.vn](https://kilala.vn), [Huggies.com.vn](https://www.huggies.com.vn), [Vietcetera](https://vietcetera.com/en/how-vietnamese-choose-their-english-names), [korean-name.com](https://korean-name.com)
440
+
441
+ ### The Pronoun System (Xưng Hô)
442
+
443
+ Vietnamese is one of the world's most complex pronoun systems. There is no universal "I" or "you" — speakers must choose from dozens of pronoun pairs based on relative age, social status, gender, and emotional closeness ([Wikipedia: Vietnamese pronouns](https://en.wikipedia.org/wiki/Vietnamese_pronouns), [Vietcetera](https://vietcetera.com)):
444
+
445
+ | Self (Xưng) | Addressee (Hô) | When to use |
446
+ |-------------|----------------|-------------|
447
+ | con | ông/bà | Speaking to grandparent-age person |
448
+ | cháu | chú/cô/bác | Speaking to parent-age person |
449
+ | em | anh/chị | Speaking to someone older (sibling generation) |
450
+ | tôi | anh/chị/ông/bà | Formal/neutral contexts |
451
+ | anh/chị | em | Speaking to someone younger |
452
+ | mình | bạn | Close friends of same age |
453
+
454
+ Key cultural principles:
455
+
456
+ - **Nâng principle (nâng người đối diện):** When ages are similar, Vietnamese speakers default to treating the addressee as older — using "em" (self) and "anh/chị" (addressee) — as a sign of politeness and respect
457
+ - **Professional override:** Professional titles (Bác sĩ, Giáo sư, Thầy/Cô) always take precedence over age-based pronouns in professional contexts
458
+ - **Regional variation:** Central Vietnam uses distinct terms — "o" replaces "cô" (aunt), "mệ" replaces "bà" (grandmother) in some dialects
459
+ - **Formality markers:** "Kính gửi" (written formal), "Thưa" (spoken formal), "ơi" (intimate) modify the address term
460
+
461
+ This library implements the full decision tree via `addressCalculate()` and `pronounPairGet()`.
462
+
258
463
  ### Compound Names (Tên Kép)
259
464
 
260
465
  Two-syllable given names like Bảo Châu, Minh Khôi, or Thanh Hà became popular from the late 20th century. With so few surnames in circulation, compound names reduce ambiguity while adding poetic meaning. Modern compound names often combine two auspicious characters.
@@ -309,6 +514,27 @@ Names are collected from 6 web sources via an automated crawl pipeline, then mer
309
514
  | [PetPress.net](https://petpress.net/vietnamese-dog-names/) | 60 Vietnamese dog names with English meanings |
310
515
  | [WeReAllAboutPets.com](https://wereallaboutpets.com/pet-names/dog/vietnamese) | 90 names with meanings |
311
516
 
517
+ ### GenZ/Cross-Cultural Data
518
+
519
+ | Source | Coverage |
520
+ |--------|----------|
521
+ | [Kilala.vn](https://kilala.vn) | Top Japanese names for Vietnamese parents, annual rankings |
522
+ | [Huggies.com.vn](https://www.huggies.com.vn) | 500+ Japanese names, Korean names, English names for Vietnamese babies |
523
+ | [korean-name.com](https://korean-name.com) | Korean name rankings 2024-2025, meaning data |
524
+ | [Vietcetera](https://vietcetera.com) | How Vietnamese choose English names, GenZ internet slang |
525
+ | [Colosmulti.com.vn](https://colosmulti.com.vn) | 440+ Korean names for Vietnamese children |
526
+ | [Kenh14](https://kenh14.vn) | GenZ Instagram naming formulas |
527
+ | [Know Your Meme](https://knowyourmeme.com/memes/kevin-nguyen) | Kevin Nguyen meme origin and cultural context |
528
+
529
+ ### Honorific & Address Data
530
+
531
+ | Source | Coverage |
532
+ |--------|----------|
533
+ | [Wikipedia: Vietnamese pronouns](https://en.wikipedia.org/wiki/Vietnamese_pronouns) | Pronoun pair rules, age-based addressing system |
534
+ | [Vietcetera](https://vietcetera.com) | Modern usage patterns, formality levels |
535
+ | [Cultural Atlas](https://culturalatlas.sbs.com.au/vietnamese-culture) | Regional variants, kinship terminology |
536
+ | Vietnamese military/political nomenclature | 30+ professional titles across 6 categories |
537
+
312
538
  ### Academic References
313
539
 
314
540
  - Nguyen, V.K. (2024). "Toward an Onomastic Account of Vietnamese Surnames." *Genealogy*, 8(1), 16. [doi:10.3390/genealogy8010016](https://www.mdpi.com/2313-5778/8/1/16)