@polyglot-bundles/vi-word-lists 0.2.11 → 0.3.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.
@@ -0,0 +1,115 @@
1
+ {
2
+ "id": "b1-weather",
3
+ "name": "Weather",
4
+ "description": "Weather and climate terms",
5
+ "examGrade": "B1",
6
+ "difficulty": "intermediate",
7
+ "category": "nature",
8
+ "words": [
9
+ {
10
+ "id": "vi:vocab:b1:weather:1",
11
+ "word": "thời tiết",
12
+ "translation": "weather",
13
+ "partOfSpeech": "noun",
14
+ "examGrade": "B1"
15
+ },
16
+ {
17
+ "id": "vi:vocab:b1:weather:2",
18
+ "word": "nắng",
19
+ "translation": "sunny",
20
+ "partOfSpeech": "adjective",
21
+ "examGrade": "B1"
22
+ },
23
+ {
24
+ "id": "vi:vocab:b1:weather:3",
25
+ "word": "mưa",
26
+ "translation": "rain / rainy",
27
+ "partOfSpeech": "noun / verb",
28
+ "examGrade": "B1"
29
+ },
30
+ {
31
+ "id": "vi:vocab:b1:weather:4",
32
+ "word": "gió",
33
+ "translation": "wind / windy",
34
+ "partOfSpeech": "noun",
35
+ "examGrade": "B1"
36
+ },
37
+ {
38
+ "id": "vi:vocab:b1:weather:5",
39
+ "word": "lạnh",
40
+ "translation": "cold",
41
+ "partOfSpeech": "adjective",
42
+ "examGrade": "B1"
43
+ },
44
+ {
45
+ "id": "vi:vocab:b1:weather:6",
46
+ "word": "nóng",
47
+ "translation": "hot",
48
+ "partOfSpeech": "adjective",
49
+ "examGrade": "B1"
50
+ },
51
+ {
52
+ "id": "vi:vocab:b1:weather:7",
53
+ "word": "ấm",
54
+ "translation": "warm",
55
+ "partOfSpeech": "adjective",
56
+ "examGrade": "B1"
57
+ },
58
+ {
59
+ "id": "vi:vocab:b1:weather:8",
60
+ "word": "mát",
61
+ "translation": "cool",
62
+ "partOfSpeech": "adjective",
63
+ "examGrade": "B1"
64
+ },
65
+ {
66
+ "id": "vi:vocab:b1:weather:9",
67
+ "word": "bão",
68
+ "translation": "storm / typhoon",
69
+ "partOfSpeech": "noun",
70
+ "examGrade": "B1"
71
+ },
72
+ {
73
+ "id": "vi:vocab:b1:weather:10",
74
+ "word": "tuyết",
75
+ "translation": "snow",
76
+ "partOfSpeech": "noun",
77
+ "examGrade": "B1"
78
+ },
79
+ {
80
+ "id": "vi:vocab:b1:weather:11",
81
+ "word": "sương mù",
82
+ "translation": "fog / foggy",
83
+ "partOfSpeech": "noun",
84
+ "examGrade": "B1"
85
+ },
86
+ {
87
+ "id": "vi:vocab:b1:weather:12",
88
+ "word": "mây",
89
+ "translation": "cloud / cloudy",
90
+ "partOfSpeech": "noun",
91
+ "examGrade": "B1"
92
+ },
93
+ {
94
+ "id": "vi:vocab:b1:weather:13",
95
+ "word": "sấm",
96
+ "translation": "thunder",
97
+ "partOfSpeech": "noun",
98
+ "examGrade": "B1"
99
+ },
100
+ {
101
+ "id": "vi:vocab:b1:weather:14",
102
+ "word": "sét",
103
+ "translation": "lightning",
104
+ "partOfSpeech": "noun",
105
+ "examGrade": "B1"
106
+ },
107
+ {
108
+ "id": "vi:vocab:b1:weather:15",
109
+ "word": "lũ lụt",
110
+ "translation": "flood",
111
+ "partOfSpeech": "noun",
112
+ "examGrade": "B1"
113
+ }
114
+ ]
115
+ }
@@ -1,85 +1,115 @@
1
1
  {
2
2
  "id": "b2-abstract-concepts",
3
3
  "name": "Abstract Concepts",
4
- "desc": "Abstract philosophical and social concepts",
5
- "cat": "abstract",
6
- "level": "B2",
4
+ "description": "Abstract philosophical and social concepts",
5
+ "examGrade": "B2",
7
6
  "difficulty": "advanced",
7
+ "category": "abstract",
8
8
  "words": [
9
9
  {
10
+ "id": "vi:vocab:b2:abstract-concepts:1",
10
11
  "word": "tự do",
11
12
  "translation": "freedom / liberty",
12
- "partOfSpeech": "noun"
13
+ "partOfSpeech": "noun",
14
+ "examGrade": "B2"
13
15
  },
14
16
  {
17
+ "id": "vi:vocab:b2:abstract-concepts:2",
15
18
  "word": "hòa bình",
16
19
  "translation": "peace",
17
- "partOfSpeech": "noun"
20
+ "partOfSpeech": "noun",
21
+ "examGrade": "B2"
18
22
  },
19
23
  {
24
+ "id": "vi:vocab:b2:abstract-concepts:3",
20
25
  "word": "công bằng",
21
26
  "translation": "justice / fairness",
22
- "partOfSpeech": "noun / adjective"
27
+ "partOfSpeech": "noun / adjective",
28
+ "examGrade": "B2"
23
29
  },
24
30
  {
31
+ "id": "vi:vocab:b2:abstract-concepts:4",
25
32
  "word": "sự thật",
26
33
  "translation": "truth",
27
- "partOfSpeech": "noun"
34
+ "partOfSpeech": "noun",
35
+ "examGrade": "B2"
28
36
  },
29
37
  {
38
+ "id": "vi:vocab:b2:abstract-concepts:5",
30
39
  "word": "niềm tin",
31
40
  "translation": "belief / faith",
32
- "partOfSpeech": "noun"
41
+ "partOfSpeech": "noun",
42
+ "examGrade": "B2"
33
43
  },
34
44
  {
45
+ "id": "vi:vocab:b2:abstract-concepts:6",
35
46
  "word": "hy vọng",
36
47
  "translation": "hope",
37
- "partOfSpeech": "noun"
48
+ "partOfSpeech": "noun",
49
+ "examGrade": "B2"
38
50
  },
39
51
  {
52
+ "id": "vi:vocab:b2:abstract-concepts:7",
40
53
  "word": "ước mơ",
41
54
  "translation": "dream / aspiration",
42
- "partOfSpeech": "noun"
55
+ "partOfSpeech": "noun",
56
+ "examGrade": "B2"
43
57
  },
44
58
  {
59
+ "id": "vi:vocab:b2:abstract-concepts:8",
45
60
  "word": "trách nhiệm",
46
61
  "translation": "responsibility",
47
- "partOfSpeech": "noun"
62
+ "partOfSpeech": "noun",
63
+ "examGrade": "B2"
48
64
  },
49
65
  {
66
+ "id": "vi:vocab:b2:abstract-concepts:9",
50
67
  "word": "nghĩa vụ",
51
68
  "translation": "duty / obligation",
52
- "partOfSpeech": "noun"
69
+ "partOfSpeech": "noun",
70
+ "examGrade": "B2"
53
71
  },
54
72
  {
73
+ "id": "vi:vocab:b2:abstract-concepts:10",
55
74
  "word": "quyền lợi",
56
75
  "translation": "right / benefit",
57
- "partOfSpeech": "noun"
76
+ "partOfSpeech": "noun",
77
+ "examGrade": "B2"
58
78
  },
59
79
  {
80
+ "id": "vi:vocab:b2:abstract-concepts:11",
60
81
  "word": "dân chủ",
61
82
  "translation": "democracy",
62
- "partOfSpeech": "noun"
83
+ "partOfSpeech": "noun",
84
+ "examGrade": "B2"
63
85
  },
64
86
  {
87
+ "id": "vi:vocab:b2:abstract-concepts:12",
65
88
  "word": "độc lập",
66
89
  "translation": "independence",
67
- "partOfSpeech": "noun / adjective"
90
+ "partOfSpeech": "noun / adjective",
91
+ "examGrade": "B2"
68
92
  },
69
93
  {
94
+ "id": "vi:vocab:b2:abstract-concepts:13",
70
95
  "word": "phát triển",
71
96
  "translation": "development",
72
- "partOfSpeech": "noun / verb"
97
+ "partOfSpeech": "noun / verb",
98
+ "examGrade": "B2"
73
99
  },
74
100
  {
101
+ "id": "vi:vocab:b2:abstract-concepts:14",
75
102
  "word": "tiến bộ",
76
103
  "translation": "progress",
77
- "partOfSpeech": "noun / adjective"
104
+ "partOfSpeech": "noun / adjective",
105
+ "examGrade": "B2"
78
106
  },
79
107
  {
108
+ "id": "vi:vocab:b2:abstract-concepts:15",
80
109
  "word": "thành công",
81
110
  "translation": "success",
82
- "partOfSpeech": "noun / adjective"
111
+ "partOfSpeech": "noun / adjective",
112
+ "examGrade": "B2"
83
113
  }
84
114
  ]
85
115
  }
@@ -1,100 +1,136 @@
1
1
  {
2
2
  "id": "pre-a1-survival-phrases",
3
3
  "name": "Survival Phrases",
4
- "desc": "Essential yes/no, greetings, and basic commands",
5
- "cat": "survival",
6
- "level": "Pre-A1",
4
+ "description": "Essential yes/no, greetings, and basic commands",
5
+ "examGrade": "Pre-A1",
7
6
  "difficulty": "beginner",
7
+ "category": "survival",
8
8
  "words": [
9
9
  {
10
+ "id": "vi:vocab:pre-a1:survival-phrases:1",
10
11
  "word": "vâng",
11
12
  "translation": "Yes",
12
- "partOfSpeech": "interjection"
13
+ "partOfSpeech": "interjection",
14
+ "examGrade": "Pre-A1"
13
15
  },
14
16
  {
17
+ "id": "vi:vocab:pre-a1:survival-phrases:2",
15
18
  "word": "không",
16
19
  "translation": "No",
17
- "partOfSpeech": "interjection"
20
+ "partOfSpeech": "interjection",
21
+ "examGrade": "Pre-A1"
18
22
  },
19
23
  {
24
+ "id": "vi:vocab:pre-a1:survival-phrases:3",
20
25
  "word": "được",
21
26
  "translation": "Okay / Agreed",
22
- "partOfSpeech": "interjection"
27
+ "partOfSpeech": "interjection",
28
+ "examGrade": "Pre-A1"
23
29
  },
24
30
  {
31
+ "id": "vi:vocab:pre-a1:survival-phrases:4",
25
32
  "word": "cảm ơn",
26
33
  "translation": "Thank you",
27
- "partOfSpeech": "phrase"
34
+ "partOfSpeech": "phrase",
35
+ "examGrade": "Pre-A1"
28
36
  },
29
37
  {
38
+ "id": "vi:vocab:pre-a1:survival-phrases:5",
30
39
  "word": "xin lỗi",
31
40
  "translation": "Sorry / Excuse me",
32
- "partOfSpeech": "phrase"
41
+ "partOfSpeech": "phrase",
42
+ "examGrade": "Pre-A1"
33
43
  },
34
44
  {
45
+ "id": "vi:vocab:pre-a1:survival-phrases:6",
35
46
  "word": "xin chào",
36
47
  "translation": "Hello",
37
- "partOfSpeech": "phrase"
48
+ "partOfSpeech": "phrase",
49
+ "examGrade": "Pre-A1"
38
50
  },
39
51
  {
52
+ "id": "vi:vocab:pre-a1:survival-phrases:7",
40
53
  "word": "tạm biệt",
41
54
  "translation": "Goodbye",
42
- "partOfSpeech": "phrase"
55
+ "partOfSpeech": "phrase",
56
+ "examGrade": "Pre-A1"
43
57
  },
44
58
  {
59
+ "id": "vi:vocab:pre-a1:survival-phrases:8",
45
60
  "word": "đi",
46
61
  "translation": "Go",
47
- "partOfSpeech": "verb"
62
+ "partOfSpeech": "verb",
63
+ "examGrade": "Pre-A1"
48
64
  },
49
65
  {
66
+ "id": "vi:vocab:pre-a1:survival-phrases:9",
50
67
  "word": "đến",
51
68
  "translation": "Come",
52
- "partOfSpeech": "verb"
69
+ "partOfSpeech": "verb",
70
+ "examGrade": "Pre-A1"
53
71
  },
54
72
  {
73
+ "id": "vi:vocab:pre-a1:survival-phrases:10",
55
74
  "word": "ăn",
56
75
  "translation": "Eat",
57
- "partOfSpeech": "verb"
76
+ "partOfSpeech": "verb",
77
+ "examGrade": "Pre-A1"
58
78
  },
59
79
  {
80
+ "id": "vi:vocab:pre-a1:survival-phrases:11",
60
81
  "word": "uống",
61
82
  "translation": "Drink",
62
- "partOfSpeech": "verb"
83
+ "partOfSpeech": "verb",
84
+ "examGrade": "Pre-A1"
63
85
  },
64
86
  {
87
+ "id": "vi:vocab:pre-a1:survival-phrases:12",
65
88
  "word": "ngủ",
66
89
  "translation": "Sleep",
67
- "partOfSpeech": "verb"
90
+ "partOfSpeech": "verb",
91
+ "examGrade": "Pre-A1"
68
92
  },
69
93
  {
94
+ "id": "vi:vocab:pre-a1:survival-phrases:13",
70
95
  "word": "gì?",
71
96
  "translation": "What?",
72
- "partOfSpeech": "phrase"
97
+ "partOfSpeech": "phrase",
98
+ "examGrade": "Pre-A1"
73
99
  },
74
100
  {
101
+ "id": "vi:vocab:pre-a1:survival-phrases:14",
75
102
  "word": "ai?",
76
103
  "translation": "Who?",
77
- "partOfSpeech": "phrase"
104
+ "partOfSpeech": "phrase",
105
+ "examGrade": "Pre-A1"
78
106
  },
79
107
  {
108
+ "id": "vi:vocab:pre-a1:survival-phrases:15",
80
109
  "word": "đâu?",
81
110
  "translation": "Where?",
82
- "partOfSpeech": "phrase"
111
+ "partOfSpeech": "phrase",
112
+ "examGrade": "Pre-A1"
83
113
  },
84
114
  {
115
+ "id": "vi:vocab:pre-a1:survival-phrases:16",
85
116
  "word": "khi nào?",
86
117
  "translation": "When?",
87
- "partOfSpeech": "phrase"
118
+ "partOfSpeech": "phrase",
119
+ "examGrade": "Pre-A1"
88
120
  },
89
121
  {
122
+ "id": "vi:vocab:pre-a1:survival-phrases:17",
90
123
  "word": "tại sao?",
91
124
  "translation": "Why?",
92
- "partOfSpeech": "phrase"
125
+ "partOfSpeech": "phrase",
126
+ "examGrade": "Pre-A1"
93
127
  },
94
128
  {
129
+ "id": "vi:vocab:pre-a1:survival-phrases:18",
95
130
  "word": "như thế nào",
96
131
  "translation": "How?",
97
- "partOfSpeech": "phrase"
132
+ "partOfSpeech": "phrase",
133
+ "examGrade": "Pre-A1"
98
134
  }
99
135
  ]
100
136
  }
@@ -0,0 +1,16 @@
1
+ import { vietnameseWordListCatalog } from "../index.js";
2
+
3
+ export const a2Descriptors = vietnameseWordListCatalog.getDescriptorsByExamGrade("A2");
4
+
5
+ export {
6
+ getDescriptorById,
7
+ getDescriptorsByCategory,
8
+ getDescriptorsByDifficulty,
9
+ } from "../index.js";
10
+
11
+ export type {
12
+ ExamGrade,
13
+ WordListDifficulty,
14
+ WordListItem,
15
+ WordListSet,
16
+ } from "../index.js";
@@ -0,0 +1,16 @@
1
+ import { vietnameseWordListCatalog } from "../index.js";
2
+
3
+ export const b1Descriptors = vietnameseWordListCatalog.getDescriptorsByExamGrade("B1");
4
+
5
+ export {
6
+ getDescriptorById,
7
+ getDescriptorsByCategory,
8
+ getDescriptorsByDifficulty,
9
+ } from "../index.js";
10
+
11
+ export type {
12
+ ExamGrade,
13
+ WordListDifficulty,
14
+ WordListItem,
15
+ WordListSet,
16
+ } from "../index.js";
@@ -0,0 +1,16 @@
1
+ import { vietnameseWordListCatalog } from "../index.js";
2
+
3
+ export const b2Descriptors = vietnameseWordListCatalog.getDescriptorsByExamGrade("B2");
4
+
5
+ export {
6
+ getDescriptorById,
7
+ getDescriptorsByCategory,
8
+ getDescriptorsByDifficulty,
9
+ } from "../index.js";
10
+
11
+ export type {
12
+ ExamGrade,
13
+ WordListDifficulty,
14
+ WordListItem,
15
+ WordListSet,
16
+ } from "../index.js";
@@ -0,0 +1,16 @@
1
+ import { vietnameseWordListCatalog } from "../index.js";
2
+
3
+ export const preA1Descriptors = vietnameseWordListCatalog.getDescriptorsByExamGrade("Pre-A1");
4
+
5
+ export {
6
+ getDescriptorById,
7
+ getDescriptorsByCategory,
8
+ getDescriptorsByDifficulty,
9
+ } from "../index.js";
10
+
11
+ export type {
12
+ ExamGrade,
13
+ WordListDifficulty,
14
+ WordListItem,
15
+ WordListSet,
16
+ } from "../index.js";
package/src/vocab.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { vietnameseWordListCatalog } from "./index.js";
2
+ import type { WordListItem } from "@syllst/word-lists";
3
+
4
+ export type VocabEntry = WordListItem & { id: string };
5
+
6
+ export async function getVocabById(id: string): Promise<VocabEntry | undefined> {
7
+ for (const descriptor of vietnameseWordListCatalog.descriptors) {
8
+ const set = await descriptor.load();
9
+ const word = set.words.find((w) => w.id === id);
10
+ if (word?.id) return word as VocabEntry;
11
+ }
12
+ return undefined;
13
+ }
14
+
15
+ export async function getAllVocabEntries(): Promise<VocabEntry[]> {
16
+ const seen = new Set<string>();
17
+ const entries: VocabEntry[] = [];
18
+ for (const descriptor of vietnameseWordListCatalog.descriptors) {
19
+ const set = await descriptor.load();
20
+ for (const word of set.words) {
21
+ if (word.id && !seen.has(word.id)) {
22
+ seen.add(word.id);
23
+ entries.push(word as VocabEntry);
24
+ }
25
+ }
26
+ }
27
+ return entries;
28
+ }
@@ -1,60 +0,0 @@
1
- {
2
- "id": "a1-basic-greetings",
3
- "name": "Basic Greetings",
4
- "desc": "Basic greeting phrases in Vietnamese",
5
- "cat": "greetings",
6
- "level": "A1",
7
- "difficulty": "beginner",
8
- "words": [
9
- {
10
- "word": "xin chào",
11
- "translation": "hello",
12
- "partOfSpeech": "phrase"
13
- },
14
- {
15
- "word": "chào buổi sáng",
16
- "translation": "good morning",
17
- "partOfSpeech": "phrase"
18
- },
19
- {
20
- "word": "chào buổi tối",
21
- "translation": "good evening",
22
- "partOfSpeech": "phrase"
23
- },
24
- {
25
- "word": "chúc ngủ ngon",
26
- "translation": "good night",
27
- "partOfSpeech": "phrase"
28
- },
29
- {
30
- "word": "tạm biệt",
31
- "translation": "goodbye",
32
- "partOfSpeech": "phrase"
33
- },
34
- {
35
- "word": "hẹn gặp lại",
36
- "translation": "see you again",
37
- "partOfSpeech": "phrase"
38
- },
39
- {
40
- "word": "cảm ơn",
41
- "translation": "thank you",
42
- "partOfSpeech": "phrase"
43
- },
44
- {
45
- "word": "làm ơn",
46
- "translation": "please",
47
- "partOfSpeech": "phrase"
48
- },
49
- {
50
- "word": "xin lỗi",
51
- "translation": "sorry",
52
- "partOfSpeech": "phrase"
53
- },
54
- {
55
- "word": "vâng",
56
- "translation": "yes",
57
- "partOfSpeech": "interjection"
58
- }
59
- ]
60
- }
@@ -1,60 +0,0 @@
1
- {
2
- "id": "a1-colors",
3
- "name": "Colors",
4
- "desc": "Basic color words in Vietnamese",
5
- "cat": "colors",
6
- "level": "A1",
7
- "difficulty": "beginner",
8
- "words": [
9
- {
10
- "word": "đỏ",
11
- "translation": "red",
12
- "partOfSpeech": "adjective"
13
- },
14
- {
15
- "word": "xanh dương",
16
- "translation": "blue",
17
- "partOfSpeech": "adjective"
18
- },
19
- {
20
- "word": "xanh lá",
21
- "translation": "green",
22
- "partOfSpeech": "adjective"
23
- },
24
- {
25
- "word": "vàng",
26
- "translation": "yellow",
27
- "partOfSpeech": "adjective"
28
- },
29
- {
30
- "word": "đen",
31
- "translation": "black",
32
- "partOfSpeech": "adjective"
33
- },
34
- {
35
- "word": "trắng",
36
- "translation": "white",
37
- "partOfSpeech": "adjective"
38
- },
39
- {
40
- "word": "cam",
41
- "translation": "orange",
42
- "partOfSpeech": "adjective"
43
- },
44
- {
45
- "word": "tím",
46
- "translation": "purple",
47
- "partOfSpeech": "adjective"
48
- },
49
- {
50
- "word": "hồng",
51
- "translation": "pink",
52
- "partOfSpeech": "adjective"
53
- },
54
- {
55
- "word": "nâu",
56
- "translation": "brown",
57
- "partOfSpeech": "adjective"
58
- }
59
- ]
60
- }
@@ -1,50 +0,0 @@
1
- {
2
- "id": "a1-family-members",
3
- "name": "Family Members",
4
- "desc": "Family member words in Vietnamese",
5
- "cat": "family",
6
- "level": "A1",
7
- "difficulty": "beginner",
8
- "words": [
9
- {
10
- "word": "mẹ",
11
- "translation": "mother",
12
- "partOfSpeech": "noun"
13
- },
14
- {
15
- "word": "bố",
16
- "translation": "father",
17
- "partOfSpeech": "noun"
18
- },
19
- {
20
- "word": "chị gái",
21
- "translation": "older sister",
22
- "partOfSpeech": "noun"
23
- },
24
- {
25
- "word": "anh trai",
26
- "translation": "older brother",
27
- "partOfSpeech": "noun"
28
- },
29
- {
30
- "word": "con gái",
31
- "translation": "daughter",
32
- "partOfSpeech": "noun"
33
- },
34
- {
35
- "word": "con trai",
36
- "translation": "son",
37
- "partOfSpeech": "noun"
38
- },
39
- {
40
- "word": "bà",
41
- "translation": "grandmother",
42
- "partOfSpeech": "noun"
43
- },
44
- {
45
- "word": "ông",
46
- "translation": "grandfather",
47
- "partOfSpeech": "noun"
48
- }
49
- ]
50
- }