234234234

网页歌词翻译匹配校验器

import * as fs from 'fs';

// 读取HTML文件
const t1 = fs.readFileSync('./txt1.txt').toString();
const t2 = fs.readFileSync('./txt2.txt').toString()

// console.log(t1, t2);

const t1Lines = t1.split('\n');
const t2Lines = t2.split('\n');
// console.log(t1Lines)

for (let i = 0; i < t1Lines.length; i++) {
    const line1 = t1Lines[i].match(/\[\d{1,2}:\d{1,2}\.\d{1,3}\]/g) || [];
    const line2 = t2Lines[i].match(/\[\d{1,2}:\d{1,2}\.\d{1,3}\]/g) || [];


    if (line1[0] !== line2[0]) {
        console.log(t1Lines[i], ':', t2Lines[i]);
    }
}

 

posted @ 2024-04-15 11:08  你若愿意,我一定去  阅读(10)  评论(0编辑  收藏  举报
23423423423