@polyglot-bundles/vi-word-lists 0.2.11 → 0.4.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.
@@ -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
  }
package/src/levels/a1.ts CHANGED
@@ -18,6 +18,6 @@ export {
18
18
  export type {
19
19
  ExamGrade,
20
20
  WordListDifficulty,
21
- WordListItem,
22
- WordListSet,
21
+ PolyglotWordListItem,
22
+ PolyglotWordListSet,
23
23
  } from "../index.js";
@@ -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
+ PolyglotWordListItem,
15
+ PolyglotWordListSet,
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
+ PolyglotWordListItem,
15
+ PolyglotWordListSet,
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
+ PolyglotWordListItem,
15
+ PolyglotWordListSet,
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
+ PolyglotWordListItem,
15
+ PolyglotWordListSet,
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
- }
@@ -1,60 +0,0 @@
1
- {
2
- "id": "a1-food-basics",
3
- "name": "Food Basics",
4
- "desc": "Basic food vocabulary in Vietnamese",
5
- "cat": "food",
6
- "level": "A1",
7
- "difficulty": "beginner",
8
- "words": [
9
- {
10
- "word": "nước",
11
- "translation": "water",
12
- "partOfSpeech": "noun"
13
- },
14
- {
15
- "word": "bánh mì",
16
- "translation": "bread",
17
- "partOfSpeech": "noun"
18
- },
19
- {
20
- "word": "sữa",
21
- "translation": "milk",
22
- "partOfSpeech": "noun"
23
- },
24
- {
25
- "word": "táo",
26
- "translation": "apple",
27
- "partOfSpeech": "noun"
28
- },
29
- {
30
- "word": "cà phê",
31
- "translation": "coffee",
32
- "partOfSpeech": "noun"
33
- },
34
- {
35
- "word": "trà",
36
- "translation": "tea",
37
- "partOfSpeech": "noun"
38
- },
39
- {
40
- "word": "cơm",
41
- "translation": "rice",
42
- "partOfSpeech": "noun"
43
- },
44
- {
45
- "word": "thịt",
46
- "translation": "meat",
47
- "partOfSpeech": "noun"
48
- },
49
- {
50
- "word": "cá",
51
- "translation": "fish",
52
- "partOfSpeech": "noun"
53
- },
54
- {
55
- "word": "rau",
56
- "translation": "vegetables",
57
- "partOfSpeech": "noun"
58
- }
59
- ]
60
- }
@@ -1,60 +0,0 @@
1
- {
2
- "id": "a1-numbers-1-10",
3
- "name": "Numbers 1-10",
4
- "desc": "Numbers one through ten in Vietnamese",
5
- "cat": "numbers",
6
- "level": "A1",
7
- "difficulty": "beginner",
8
- "words": [
9
- {
10
- "word": "một",
11
- "translation": "one",
12
- "partOfSpeech": "number"
13
- },
14
- {
15
- "word": "hai",
16
- "translation": "two",
17
- "partOfSpeech": "number"
18
- },
19
- {
20
- "word": "ba",
21
- "translation": "three",
22
- "partOfSpeech": "number"
23
- },
24
- {
25
- "word": "bốn",
26
- "translation": "four",
27
- "partOfSpeech": "number"
28
- },
29
- {
30
- "word": "năm",
31
- "translation": "five",
32
- "partOfSpeech": "number"
33
- },
34
- {
35
- "word": "sáu",
36
- "translation": "six",
37
- "partOfSpeech": "number"
38
- },
39
- {
40
- "word": "bảy",
41
- "translation": "seven",
42
- "partOfSpeech": "number"
43
- },
44
- {
45
- "word": "tám",
46
- "translation": "eight",
47
- "partOfSpeech": "number"
48
- },
49
- {
50
- "word": "chín",
51
- "translation": "nine",
52
- "partOfSpeech": "number"
53
- },
54
- {
55
- "word": "mười",
56
- "translation": "ten",
57
- "partOfSpeech": "number"
58
- }
59
- ]
60
- }
@@ -1,110 +0,0 @@
1
- {
2
- "id": "a2-body-parts",
3
- "name": "Body Parts",
4
- "desc": "Human body parts and anatomy",
5
- "cat": "anatomy",
6
- "level": "A2",
7
- "difficulty": "intermediate",
8
- "words": [
9
- {
10
- "word": "đầu",
11
- "translation": "head",
12
- "partOfSpeech": "noun"
13
- },
14
- {
15
- "word": "tóc",
16
- "translation": "hair",
17
- "partOfSpeech": "noun"
18
- },
19
- {
20
- "word": "mắt",
21
- "translation": "eye",
22
- "partOfSpeech": "noun"
23
- },
24
- {
25
- "word": "mũi",
26
- "translation": "nose",
27
- "partOfSpeech": "noun"
28
- },
29
- {
30
- "word": "miệng",
31
- "translation": "mouth",
32
- "partOfSpeech": "noun"
33
- },
34
- {
35
- "word": "răng",
36
- "translation": "tooth",
37
- "partOfSpeech": "noun"
38
- },
39
- {
40
- "word": "lưỡi",
41
- "translation": "tongue",
42
- "partOfSpeech": "noun"
43
- },
44
- {
45
- "word": "tai",
46
- "translation": "ear",
47
- "partOfSpeech": "noun"
48
- },
49
- {
50
- "word": "cổ",
51
- "translation": "neck",
52
- "partOfSpeech": "noun"
53
- },
54
- {
55
- "word": "vai",
56
- "translation": "shoulder",
57
- "partOfSpeech": "noun"
58
- },
59
- {
60
- "word": "tay",
61
- "translation": "arm / hand",
62
- "partOfSpeech": "noun"
63
- },
64
- {
65
- "word": "khuỷu tay",
66
- "translation": "elbow",
67
- "partOfSpeech": "noun"
68
- },
69
- {
70
- "word": "ngón tay",
71
- "translation": "finger",
72
- "partOfSpeech": "noun"
73
- },
74
- {
75
- "word": "bụng",
76
- "translation": "stomach / belly",
77
- "partOfSpeech": "noun"
78
- },
79
- {
80
- "word": "chân",
81
- "translation": "leg / foot",
82
- "partOfSpeech": "noun"
83
- },
84
- {
85
- "word": "đầu gối",
86
- "translation": "knee",
87
- "partOfSpeech": "noun"
88
- },
89
- {
90
- "word": "bàn chân",
91
- "translation": "foot",
92
- "partOfSpeech": "noun"
93
- },
94
- {
95
- "word": "ngón chân",
96
- "translation": "toe",
97
- "partOfSpeech": "noun"
98
- },
99
- {
100
- "word": "da",
101
- "translation": "skin",
102
- "partOfSpeech": "noun"
103
- },
104
- {
105
- "word": "xương",
106
- "translation": "bone",
107
- "partOfSpeech": "noun"
108
- }
109
- ]
110
- }