feat: 第 13-16 章正文(Skill 机制 / HTTP 接口层 / 前端 / 基础设施与部署)

This commit is contained in:
2026-10-20 21:56:23 +08:00
parent c7c3fda5eb
commit 64a60383e0
13 changed files with 1038 additions and 65 deletions

View File

@@ -0,0 +1,16 @@
const fs = require('fs');
const h = fs.readFileSync('15-frontend.html', 'utf8');
let art = (h.match(/<article>([\s\S]*)<\/article>/) || [, ''])[1];
art = art.replace(/<pre[\s\S]*?<\/pre>/g, ' ')
.replace(/<nav class="pager">[\s\S]*?<\/nav>/g, ' ')
.replace(/<p class="foot">[\s\S]*?<\/p>/g, ' ')
.replace(/<p class="chapnav">[\s\S]*?<\/p>/g, ' ');
art = art.replace(/<[^>]+>/g, '').replace(/\s+/g, '');
let cjk = 0, ascii = 0, punct = 0, other = 0;
for (const ch of art) {
const c = ch.codePointAt(0);
if (c >= 0x4e00 && c <= 0x9fff) cjk++;
else if (c >= 0x20 && c <= 0x7e) ascii++;
else punct++;
}
console.log({ total: art.length, cjk, ascii, punct });