-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.js
49 lines (32 loc) · 1.23 KB
/
Index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const fs = require('fs').promises;
const PA = require("./Azure PronunciationAssessment/pronunciationAssessmentContinue.js");
const settings = require("./Azure PronunciationAssessment/settings.js");
async function main() {
const files = await fs.readdir("./Input");
const texto_para_2do = await fs.readFile("./Reference texts/2do.txt", 'utf8');
const texto_para_4to = await fs.readFile("./Reference texts/4to.txt", 'utf8');
files.map(async (file, index) => {
let time = 0
if (index === 0) {
time = 0
} else {
time = 150000 * index
}
console.log(time)
setTimeout(() => {
console.log('')
console.log('')
console.log('------------------------------ Translated: \x1b[32m', `${file}\x1b[0m`, '\x1b[0m------------------------------');
console.log('')
console.log('')
settings.filename = `./Input/${file}`
if (file.split(".")[0] < 14) {
settings.reference_text = texto_para_2do
} else {
settings.reference_text = texto_para_4to
}
PA.PronunciationAssessment(settings, file)
}, time);
})
};
main()