vietnamese-phonetic-transcript 1.0.0 → 1.0.1
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 +30 -3
- package/dist/index.cjs +765 -268
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -23
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +768 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +38 -37
- package/dist/index.d.ts +0 -27
- package/dist/index.js +0 -245
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<!-- Table of Contents -->
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
## :notebook_with_decorative_cover: Table of Contents
|
|
47
47
|
|
|
48
48
|
- [Getting Started](#toolbox-getting-started)
|
|
49
49
|
- [Prerequisites](#bangbang-prerequisites)
|
|
@@ -200,6 +200,31 @@ Hệ thống âm cuối: 6 phụ âm, 2 bán nguyên âm
|
|
|
200
200
|
| 8 | /-j/ | i (còn lại) | cái, ngoái, cưới, cuối |
|
|
201
201
|
| 9 | /zero/ | không thể hiện | bà, bố, mẹ |
|
|
202
202
|
|
|
203
|
+
### Phonetic Transcription Script
|
|
204
|
+
|
|
205
|
+
To transcribe Vietnamese text to its phonetic representation, you can use
|
|
206
|
+
function `phoneticTranscriptWord` for individual words or
|
|
207
|
+
`phoneticTranscriptSentence` for entire sentences.
|
|
208
|
+
Here's how to use these functions:
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import {
|
|
212
|
+
phoneticTranscriptSentence,
|
|
213
|
+
phoneticTranscriptWord,
|
|
214
|
+
} from 'vietnamese-phonetic-transcript'
|
|
215
|
+
// Transcribe a single word
|
|
216
|
+
const word = 'chào'
|
|
217
|
+
const phoneticWord = phoneticTranscriptWord(word)
|
|
218
|
+
console.log(`Phonetic transcription of "${word}": ${phoneticWord}`)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
// Transcribe a full sentence
|
|
223
|
+
const sentence = 'Xin chào, bạn có khỏe không?'
|
|
224
|
+
const phoneticSentence = phoneticTranscriptSentence(sentence)
|
|
225
|
+
console.log(`Phonetic transcription of the sentence: ${phoneticSentence}`)
|
|
226
|
+
```
|
|
227
|
+
|
|
203
228
|
### Syllable Analysis
|
|
204
229
|
|
|
205
230
|
This project includes a script to analyze Vietnamese syllables from a text file
|
|
@@ -208,7 +233,7 @@ and validate them using phonetic transcription.
|
|
|
208
233
|
To run the analysis, use the following command:
|
|
209
234
|
|
|
210
235
|
```bash
|
|
211
|
-
npx tsx
|
|
236
|
+
npx tsx lib/syllable_analysis.ts
|
|
212
237
|
```
|
|
213
238
|
|
|
214
239
|
Result:
|
|
@@ -281,7 +306,9 @@ Why Only 1.2% of Theoretical Combinations Exist?
|
|
|
281
306
|
## :wave: Contributing
|
|
282
307
|
|
|
283
308
|
<a href="https://github.com/DuckyMomo20012/vietnamese-phonetic-transcript/graphs/contributors">
|
|
284
|
-
<img
|
|
309
|
+
<img
|
|
310
|
+
src="https://contrib.rocks/image?repo=DuckyMomo20012/vietnamese-phonetic-transcript"
|
|
311
|
+
alt="contributors" />
|
|
285
312
|
</a>
|
|
286
313
|
|
|
287
314
|
Contributions are always welcome!
|