@domandigital/craft 0.16.0 → 0.17.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.
- package/CHANGELOG.md +11 -0
- package/CHARACTER.md +23 -6
- package/COPY.md +5 -0
- package/README.md +8 -0
- package/REGISTERS.md +163 -0
- package/dist/{audit-UJCUWORL.js → audit-4SFSLCKY.js} +3 -2
- package/dist/audit.cjs +1 -1
- package/dist/audit.d.cts +7 -0
- package/dist/audit.d.ts +7 -0
- package/dist/audit.js +1 -1
- package/dist/chunk-4QWEAL4G.js +1595 -0
- package/dist/{chunk-WAV6AKR4.js → chunk-6TSDYETQ.js} +4 -2
- package/dist/{chunk-TQKDCA4V.js → chunk-DARKHE6A.js} +7 -5
- package/dist/{chunk-LXDNIJFG.js → chunk-O5B5ELJH.js} +28 -20
- package/dist/chunk-QIEDBL4J.js +9 -0
- package/dist/{chunk-CVG5GSMN.js → chunk-RJVG5KA6.js} +8 -6
- package/dist/{chunk-YK2FFL6Z.js → chunk-SL5VZJ2J.js} +1 -1
- package/dist/{chunk-B2MJLGF6.js → chunk-WFB6F3BN.js} +65 -1633
- package/dist/{chunk-LWVGIJ5A.js → chunk-ZUYERAFM.js} +11 -6
- package/dist/{cli-AVYNHBFJ.js → cli-BN4IT6N2.js} +5 -3
- package/dist/{cli-PEATEW57.js → cli-GXIW7F3E.js} +7 -5
- package/dist/cli-JB4X5LAG.js +1573 -0
- package/dist/{cli-52M62QBN.js → cli-JZRQBCD4.js} +7 -5
- package/dist/{cli-3GQROFCB.js → cli-MDW7JTEF.js} +15 -10
- package/dist/{cli-CWORJYOU.js → cli-V44QEVS6.js} +12 -9
- package/dist/{cli-K4LSRYBE.js → cli-Y7Y5IROK.js} +8 -5
- package/dist/cli.js +4 -2
- package/dist/index.cjs +1306 -9
- package/dist/index.d.cts +163 -1
- package/dist/index.d.ts +163 -1
- package/dist/index.js +1290 -9
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -4466,7 +4466,7 @@ var SPECIFICITY_COPY_TELLS = [
|
|
|
4466
4466
|
},
|
|
4467
4467
|
rendered: {
|
|
4468
4468
|
detect: (s) => {
|
|
4469
|
-
if (!s.firstScreenText || !HOME_URL.test(s.url)) return [];
|
|
4469
|
+
if (!s.firstScreenText || !(s.home ?? HOME_URL.test(s.url))) return [];
|
|
4470
4470
|
const text = s.firstScreenText.join("\n");
|
|
4471
4471
|
if (!text.trim() || !specificity(text).generic) return [];
|
|
4472
4472
|
const h1 = s.headings.find((h) => h.level === 1 && h.top < s.viewport.height);
|
|
@@ -6244,6 +6244,1270 @@ function lexicalOf(text, brief) {
|
|
|
6244
6244
|
};
|
|
6245
6245
|
}
|
|
6246
6246
|
|
|
6247
|
+
// src/register/features.ts
|
|
6248
|
+
var REGISTER_FEATURES = [
|
|
6249
|
+
"meanSentenceWords",
|
|
6250
|
+
"contractionsPer100",
|
|
6251
|
+
"youPer100",
|
|
6252
|
+
"firstPersonPer100",
|
|
6253
|
+
"passiveShare",
|
|
6254
|
+
"meanWordLength"
|
|
6255
|
+
];
|
|
6256
|
+
var norm = (w) => w.toLowerCase().replace(/’/g, "'");
|
|
6257
|
+
var YOU = /* @__PURE__ */ new Set(["you", "your", "yours", "yourself", "yourselves", "you'll", "you're", "you've", "you'd"]);
|
|
6258
|
+
var FIRST = /* @__PURE__ */ new Set(["i", "me", "my", "mine", "we", "us", "our", "ours", "i'm", "i'll", "i've", "i'd", "we're", "we'll", "we've", "we'd"]);
|
|
6259
|
+
var CONTRACTION2 = /^[a-z]+(?:n't|'ll|'re|'ve|'d|'m)$|^(?:it|that|there|here|what|who|where|how|he|she|let)'s$/;
|
|
6260
|
+
var BE = "(?:am|is|are|was|were|be|been|being|'s|'re|'m)";
|
|
6261
|
+
var IRREGULAR = "(?:made|done|given|taken|seen|known|shown|written|built|sent|paid|held|told|found|kept|left|brought|bought|thought|taught|caught|sold|put|set|run|cut|chosen|driven|eaten|fallen|forgotten|hidden|broken|spoken|stolen|worn|torn|grown|drawn|thrown|flown|begun|sung|won|lost|met|led|read|heard|meant|spent|built|lent|dealt|felt|sought|fed|bred|laid|said|struck|hung|shut|hit|hurt|let|quit|spread|bound|wound|ground|understood|withdrawn|overseen|undertaken)";
|
|
6262
|
+
var PASSIVE = new RegExp(`\\b${BE}\\s+(?:[a-z]+ly\\s+)?(?:[a-z]+ed|[a-z]+en|${IRREGULAR})\\b`, "i");
|
|
6263
|
+
var ADJECTIVAL = /* @__PURE__ */ new Set([
|
|
6264
|
+
"tired",
|
|
6265
|
+
"interested",
|
|
6266
|
+
"excited",
|
|
6267
|
+
"pleased",
|
|
6268
|
+
"worried",
|
|
6269
|
+
"concerned",
|
|
6270
|
+
"surprised",
|
|
6271
|
+
"bored",
|
|
6272
|
+
"scared",
|
|
6273
|
+
"married",
|
|
6274
|
+
"qualified",
|
|
6275
|
+
"experienced",
|
|
6276
|
+
"based",
|
|
6277
|
+
"located",
|
|
6278
|
+
"committed",
|
|
6279
|
+
"dedicated",
|
|
6280
|
+
"delighted",
|
|
6281
|
+
"disappointed",
|
|
6282
|
+
"involved",
|
|
6283
|
+
"prepared",
|
|
6284
|
+
"supposed",
|
|
6285
|
+
"used",
|
|
6286
|
+
"open",
|
|
6287
|
+
"often",
|
|
6288
|
+
"even",
|
|
6289
|
+
"seven",
|
|
6290
|
+
"eleven",
|
|
6291
|
+
"listen",
|
|
6292
|
+
"happen",
|
|
6293
|
+
"then",
|
|
6294
|
+
"when",
|
|
6295
|
+
"ten",
|
|
6296
|
+
"garden",
|
|
6297
|
+
"kitchen",
|
|
6298
|
+
"children",
|
|
6299
|
+
"women",
|
|
6300
|
+
"men",
|
|
6301
|
+
"red",
|
|
6302
|
+
"bed",
|
|
6303
|
+
"need",
|
|
6304
|
+
"indeed",
|
|
6305
|
+
"shed",
|
|
6306
|
+
"seed",
|
|
6307
|
+
"feed",
|
|
6308
|
+
"speed",
|
|
6309
|
+
"hundred"
|
|
6310
|
+
]);
|
|
6311
|
+
function isPassive(sentence) {
|
|
6312
|
+
const re = new RegExp(PASSIVE.source, "gi");
|
|
6313
|
+
for (const m of sentence.matchAll(re)) {
|
|
6314
|
+
const last = norm(m[0].trim().split(/\s+/).pop() ?? "");
|
|
6315
|
+
if (last === "given" && /given\s+that\b/i.test(sentence.slice(m.index ?? 0))) continue;
|
|
6316
|
+
if (!ADJECTIVAL.has(last)) return true;
|
|
6317
|
+
}
|
|
6318
|
+
return false;
|
|
6319
|
+
}
|
|
6320
|
+
function registerOf(text) {
|
|
6321
|
+
const ss = splitSentences(text);
|
|
6322
|
+
const ws = words(text).map(norm);
|
|
6323
|
+
const n = ws.length;
|
|
6324
|
+
const per100 = (k) => n === 0 ? 0 : 100 * k / n;
|
|
6325
|
+
const letters = ws.reduce((s, w) => s + w.replace(/[^a-z]/g, "").length, 0);
|
|
6326
|
+
return {
|
|
6327
|
+
meanSentenceWords: ss.length === 0 ? 0 : n / ss.length,
|
|
6328
|
+
contractionsPer100: per100(ws.filter((w) => CONTRACTION2.test(w)).length),
|
|
6329
|
+
youPer100: per100(ws.filter((w) => YOU.has(w)).length),
|
|
6330
|
+
firstPersonPer100: per100(ws.filter((w) => FIRST.has(w)).length),
|
|
6331
|
+
passiveShare: ss.length === 0 ? 0 : ss.filter(isPassive).length / ss.length,
|
|
6332
|
+
meanWordLength: n === 0 ? 0 : letters / n
|
|
6333
|
+
};
|
|
6334
|
+
}
|
|
6335
|
+
|
|
6336
|
+
// src/register/registers.ts
|
|
6337
|
+
var GOVUK = "GOV.UK writing guidelines";
|
|
6338
|
+
var MAILCHIMP = "Mailchimp Content Style Guide";
|
|
6339
|
+
var OGILVY = "Ogilvy, Ogilvy on Advertising (1983)";
|
|
6340
|
+
var CAPLES = "Caples, Tested Advertising Methods";
|
|
6341
|
+
var HOUSE2 = "house judgement";
|
|
6342
|
+
var ALWAYS = "Every register keeps the COPY.md blocking tier and the proof rule. Draft first, then run `craft copy <file>` on the draft.";
|
|
6343
|
+
var REGISTERS = [
|
|
6344
|
+
{
|
|
6345
|
+
id: "plain",
|
|
6346
|
+
name: "Plain and trustworthy",
|
|
6347
|
+
useFor: "Forms, policies, terms, instructions, and professional services where the reader must act correctly.",
|
|
6348
|
+
directives: [
|
|
6349
|
+
{ text: "Put the most important information first, then taper down to the detail.", from: GOVUK },
|
|
6350
|
+
{ text: "Split any sentence over 25 words into two.", from: GOVUK },
|
|
6351
|
+
{ text: "Choose the short, common word: buy, help, about.", from: GOVUK },
|
|
6352
|
+
{ text: "Write in the active voice, so the reader sees who does what.", from: GOVUK },
|
|
6353
|
+
{ text: 'Address the reader as "you", as one person you can actually help.', from: GOVUK },
|
|
6354
|
+
{ text: `Use positive contractions such as "you'll", and write negatives out in full: "do not", "cannot".`, from: GOVUK },
|
|
6355
|
+
{ text: "Write headings that say what the section tells the reader, starting with a verb where you can.", from: GOVUK },
|
|
6356
|
+
{ text: "Give each paragraph one job.", from: HOUSE2 }
|
|
6357
|
+
],
|
|
6358
|
+
example: {
|
|
6359
|
+
before: "Should you wish to apply for a residents' parking permit, an application form must be completed and submitted to the council prior to the commencement of the permit period.",
|
|
6360
|
+
after: "Apply for a residents' parking permit before you need it. Fill in the form online. It takes about 10 minutes.",
|
|
6361
|
+
why: "The action comes first, the council is no longer the subject, and each sentence does one thing."
|
|
6362
|
+
},
|
|
6363
|
+
sources: [
|
|
6364
|
+
{
|
|
6365
|
+
name: GOVUK,
|
|
6366
|
+
url: "https://guidance.publishing.service.gov.uk/writing-to-gov-uk-standards/writing-guidelines/",
|
|
6367
|
+
note: 'Clear language (the 25-word split, short words, active voice, contractions), clear structure (most important first, headings) and right tone (address the user as "you"). Checked against the live pages on 2026-09-30.'
|
|
6368
|
+
}
|
|
6369
|
+
]
|
|
6370
|
+
},
|
|
6371
|
+
{
|
|
6372
|
+
id: "persuasive",
|
|
6373
|
+
name: "Persuasive and concise",
|
|
6374
|
+
useFor: "Landing pages, service pages, adverts and sales emails: copy whose job is one action.",
|
|
6375
|
+
directives: [
|
|
6376
|
+
{ text: "Put the promise in the headline: what the reader gets, in words they would use.", from: OGILVY },
|
|
6377
|
+
{ text: "Back each claim with something the reader can check: a number, a name, a date, a price.", from: "COPY.md" },
|
|
6378
|
+
{ text: 'Write to one reader, as "you", about their problem before your service.', from: CAPLES },
|
|
6379
|
+
{ text: "Name the mechanism: how it works, how long it takes, what it costs.", from: "COPY.md" },
|
|
6380
|
+
{ text: "Answer the objection the reader already has, with evidence, in the sentence that follows the claim.", from: HOUSE2 },
|
|
6381
|
+
{ text: "Let the copy run as long as the facts last, and cut each sentence that carries none.", from: OGILVY },
|
|
6382
|
+
{ text: "Close with one specific action and what happens straight after it.", from: "COPY.md" }
|
|
6383
|
+
],
|
|
6384
|
+
example: {
|
|
6385
|
+
before: "Transform your garden with our premium landscaping solutions. Quality you can trust.",
|
|
6386
|
+
after: "We lay a 40 square metre Indian sandstone patio in three days, for \xA34,800 fitted. Every job since 2014 is on our reviews page. Book a free site visit and get a fixed quote within 48 hours.",
|
|
6387
|
+
why: "Size, material, time and price replace the adjectives, the proof sits next to the claim, and the close says what happens next. Fictional business."
|
|
6388
|
+
},
|
|
6389
|
+
sources: [
|
|
6390
|
+
{
|
|
6391
|
+
name: OGILVY,
|
|
6392
|
+
note: "Headlines carry the promise because far more people read the headline than the body; specific, informative copy outsells vague copy. Taken from the widely quoted principles; a page-by-page check against the book is still to do."
|
|
6393
|
+
},
|
|
6394
|
+
{
|
|
6395
|
+
name: CAPLES,
|
|
6396
|
+
note: "Headlines that appeal to the reader's self-interest, and copy judged by tested response rather than taste. A page-by-page check against the book is still to do."
|
|
6397
|
+
},
|
|
6398
|
+
{
|
|
6399
|
+
name: "COPY.md",
|
|
6400
|
+
note: "Writing directives (lead with the fact, name the mechanism, persuade with something checkable) and the CTA rule."
|
|
6401
|
+
}
|
|
6402
|
+
]
|
|
6403
|
+
},
|
|
6404
|
+
{
|
|
6405
|
+
id: "warm",
|
|
6406
|
+
name: "Warm and conversational",
|
|
6407
|
+
useFor: "Customer emails, replies to enquiries, newsletters and small-business updates.",
|
|
6408
|
+
directives: [
|
|
6409
|
+
{ text: "Write the way you would talk to a customer you like: contractions, everyday words.", from: MAILCHIMP },
|
|
6410
|
+
{ text: "Keep words and sentences simple; being clear matters more than being entertaining.", from: MAILCHIMP },
|
|
6411
|
+
{ text: "Say what the reader can do, in positive language.", from: MAILCHIMP },
|
|
6412
|
+
{ text: "Use the active voice.", from: MAILCHIMP },
|
|
6413
|
+
{ text: "Match the tone to how the reader feels right now: lighter for good news, calm and direct for a problem.", from: MAILCHIMP },
|
|
6414
|
+
{ text: "Keep humour dry and occasional, and only where it comes naturally.", from: MAILCHIMP },
|
|
6415
|
+
{ text: "Sign off as a person, with a name.", from: HOUSE2 }
|
|
6416
|
+
],
|
|
6417
|
+
example: {
|
|
6418
|
+
before: "Dear Valued Customer, We wish to inform you that your order has been dispatched and will be delivered in due course.",
|
|
6419
|
+
after: "Hi Sam, your order's on its way. It left our Leicester workshop this morning and should reach you on Thursday. Any questions, just reply to this email. Priya",
|
|
6420
|
+
why: 'A name at each end, a real day and place instead of "in due course", and a next step. Fictional business.'
|
|
6421
|
+
},
|
|
6422
|
+
sources: [
|
|
6423
|
+
{
|
|
6424
|
+
name: MAILCHIMP,
|
|
6425
|
+
url: "https://styleguide.mailchimp.com/voice-and-tone/",
|
|
6426
|
+
note: "Voice and tone (plainspoken, genuine, dry humour; clear before entertaining; adjust tone to the reader's state) and grammar and mechanics (active voice, contractions, positive language). Its allowance for emoji does not apply: emoji block under COPY.md. Checked against the live pages on 2026-09-30."
|
|
6427
|
+
}
|
|
6428
|
+
]
|
|
6429
|
+
},
|
|
6430
|
+
{
|
|
6431
|
+
id: "literary",
|
|
6432
|
+
name: "Elegant and literary",
|
|
6433
|
+
useFor: "Premium brands, makers, hospitality and anything sold on craft and taste rather than price.",
|
|
6434
|
+
directives: [
|
|
6435
|
+
{ text: "Choose one precise noun over two adjectives.", from: HOUSE2 },
|
|
6436
|
+
{ text: "Let sentence length follow the thought: a long sentence to build, a short one to land.", from: "COPY.md" },
|
|
6437
|
+
{ text: "Carry the detail in concrete facts: material, place, process, time.", from: HOUSE2 },
|
|
6438
|
+
{ text: "Trust the reader with one image, state it once, and move on.", from: HOUSE2 },
|
|
6439
|
+
{ text: "Keep claims quiet and exact, and let the facts carry the prestige.", from: HOUSE2 },
|
|
6440
|
+
{ text: "Draw any metaphor from the maker's own work, and hold it for the whole piece.", from: HOUSE2 },
|
|
6441
|
+
{ text: "Read the draft aloud and rework each line that trips the breath.", from: HOUSE2 }
|
|
6442
|
+
],
|
|
6443
|
+
example: {
|
|
6444
|
+
before: "Our luxurious, handcrafted candles create an unforgettable ambience of elegance and sophistication.",
|
|
6445
|
+
after: "Each candle is poured by hand in our Hebden Bridge workshop, forty to a batch. The wax is English rapeseed and the scent is cedar, cut with a little smoke. It burns for sixty hours, and the glass is yours to keep.",
|
|
6446
|
+
why: "Place, material, scent and burn time do the work the adjectives claimed. Fictional business."
|
|
6447
|
+
},
|
|
6448
|
+
sources: [
|
|
6449
|
+
{
|
|
6450
|
+
name: HOUSE2,
|
|
6451
|
+
note: "No public style authority exists for premium-brand prose. These directives are house judgement, to be revised as the estate grows."
|
|
6452
|
+
},
|
|
6453
|
+
{
|
|
6454
|
+
name: "Register separation, 2026-09-29",
|
|
6455
|
+
url: "calibration/copy-shape/report-registers.md",
|
|
6456
|
+
note: "Literary prose (Gutenberg) carries about twice the comma density of the other human registers, the one feature that separated it from all four. Longer, jointed sentences are normal here."
|
|
6457
|
+
}
|
|
6458
|
+
]
|
|
6459
|
+
}
|
|
6460
|
+
];
|
|
6461
|
+
var REGISTER_IDS = REGISTERS.map((r) => r.id);
|
|
6462
|
+
function getRegister(id) {
|
|
6463
|
+
return REGISTERS.find((r) => r.id === id);
|
|
6464
|
+
}
|
|
6465
|
+
function registerBrief(id) {
|
|
6466
|
+
const r = getRegister(id);
|
|
6467
|
+
if (!r) throw new Error(`unknown register "${id}". Registers: ${REGISTER_IDS.join(", ")}`);
|
|
6468
|
+
const lines = [`Register: ${r.name} (${r.id})`, `Use for: ${r.useFor}`, "", "Before you draft:"];
|
|
6469
|
+
r.directives.forEach((d, i) => lines.push(` ${i + 1}. ${d.text} [${d.from}]`));
|
|
6470
|
+
lines.push("", "Example (fictional):", ` Before: ${r.example.before}`, ` After: ${r.example.after}`, ` Why: ${r.example.why}`);
|
|
6471
|
+
lines.push("", "Sources:");
|
|
6472
|
+
for (const s of r.sources) lines.push(` - ${s.name}${s.url ? ` (${s.url})` : ""}: ${s.note}`);
|
|
6473
|
+
lines.push("", `Always: ${ALWAYS}`);
|
|
6474
|
+
return lines.join("\n");
|
|
6475
|
+
}
|
|
6476
|
+
function registersDoc() {
|
|
6477
|
+
const out = [];
|
|
6478
|
+
for (const r of REGISTERS) {
|
|
6479
|
+
out.push(`## ${r.name} (\`${r.id}\`)`, "", `**Use for:** ${r.useFor}`, "", "**Before you draft:**", "");
|
|
6480
|
+
r.directives.forEach((d, i) => out.push(`${i + 1}. ${d.text} *(${d.from})*`));
|
|
6481
|
+
out.push("", "**Example (fictional):**", "", `- Before: ${r.example.before}`, `- After: ${r.example.after}`, `- Why: ${r.example.why}`);
|
|
6482
|
+
out.push("", "**Sources:**", "");
|
|
6483
|
+
for (const s of r.sources) out.push(`- ${s.url ? `[${s.name}](${s.url})` : s.name}: ${s.note}`);
|
|
6484
|
+
out.push("");
|
|
6485
|
+
}
|
|
6486
|
+
out.push(`**Always:** ${ALWAYS}`);
|
|
6487
|
+
return out.join("\n");
|
|
6488
|
+
}
|
|
6489
|
+
|
|
6490
|
+
// src/register/check.ts
|
|
6491
|
+
var REGISTER_BASELINE = {
|
|
6492
|
+
plain: {
|
|
6493
|
+
baseline: "institutional",
|
|
6494
|
+
note: "Compared with Hansard: edited parliamentary debate, the closest free UK source, not plain writing itself."
|
|
6495
|
+
},
|
|
6496
|
+
persuasive: {
|
|
6497
|
+
baseline: "marketing",
|
|
6498
|
+
note: "Compared with 715 passages from UK small-business websites before 2021: a small sample."
|
|
6499
|
+
},
|
|
6500
|
+
warm: {
|
|
6501
|
+
baseline: "business-email",
|
|
6502
|
+
note: "Compared with Enron sent email, 1999 to 2002: corporate and American, not small-business email."
|
|
6503
|
+
},
|
|
6504
|
+
literary: {
|
|
6505
|
+
baseline: "literary",
|
|
6506
|
+
note: "Compared with English fiction and essays, 1726 to 1925: older than any premium brand's copy."
|
|
6507
|
+
}
|
|
6508
|
+
};
|
|
6509
|
+
var MIN_PARAGRAPHS = 5;
|
|
6510
|
+
var CONTENT_FEATURES = /* @__PURE__ */ new Set(["hardPer100", "specificsPer100", "tradePer100", "figures", "names", "generic"]);
|
|
6511
|
+
var usable = (f4, b) => !CONTENT_FEATURES.has(f4) && b.p90 > b.p10;
|
|
6512
|
+
var LABELS = {
|
|
6513
|
+
meanSentenceWords: "Words per sentence",
|
|
6514
|
+
contractionsPer100: "Contractions per 100 words",
|
|
6515
|
+
youPer100: '"You" per 100 words',
|
|
6516
|
+
firstPersonPer100: '"I" and "we" per 100 words',
|
|
6517
|
+
passiveShare: "Share of sentences in the passive",
|
|
6518
|
+
meanWordLength: "Letters per word",
|
|
6519
|
+
commasPer100: "Commas per 100 words",
|
|
6520
|
+
commasPerSentence: "Commas per sentence",
|
|
6521
|
+
clauseDepth: "Clauses per sentence",
|
|
6522
|
+
nominalisationRate: 'Nominalisations ("the provision of") per 100 words',
|
|
6523
|
+
pronounOpenerShare: "Share of sentences opening with a pronoun",
|
|
6524
|
+
impersonalOpenerShare: 'Share of sentences opening impersonally ("It is", "There are")',
|
|
6525
|
+
coordinationRate: 'Paired phrases ("fast and friendly") per 100 words',
|
|
6526
|
+
participialRate: '"-ing" clauses per sentence',
|
|
6527
|
+
tricolons: "Lists of three",
|
|
6528
|
+
sentenceCv: "Spread of sentence lengths",
|
|
6529
|
+
skeletonRepeat: "Repeated sentence patterns",
|
|
6530
|
+
hardPer100: "Hard specifics (names, figures, dates) per 100 words",
|
|
6531
|
+
specificsPer100: "Specifics of any kind per 100 words",
|
|
6532
|
+
tradePer100: "Trade nouns per 100 words",
|
|
6533
|
+
figures: "Figures per paragraph",
|
|
6534
|
+
names: "Names per paragraph",
|
|
6535
|
+
generic: "Share of paragraphs with no specific at all"
|
|
6536
|
+
};
|
|
6537
|
+
var featureLabel = (f4) => LABELS[f4] ?? f4;
|
|
6538
|
+
function documentParagraphs(text) {
|
|
6539
|
+
return text.replace(/\r\n?/g, "\n").split(/\n\s*\n/).map((p) => p.replace(/\s*\n\s*/g, " ").trim()).filter((p) => p && !/^#{1,6}\s/.test(p));
|
|
6540
|
+
}
|
|
6541
|
+
function measure(paragraph) {
|
|
6542
|
+
const out = {};
|
|
6543
|
+
for (const [k, v] of Object.entries(shapeOf(paragraph))) out[k] = typeof v === "boolean" ? v ? 1 : 0 : v;
|
|
6544
|
+
for (const [k, v] of Object.entries(lexicalOf(paragraph))) out[k] = v;
|
|
6545
|
+
for (const [k, v] of Object.entries(registerOf(paragraph))) out[k] = v;
|
|
6546
|
+
return out;
|
|
6547
|
+
}
|
|
6548
|
+
var fmt = (x) => Math.abs(x) >= 10 ? x.toFixed(0) : x.toFixed(Math.abs(x) >= 1 ? 1 : 2);
|
|
6549
|
+
function checkRegister(text, id, profile) {
|
|
6550
|
+
const reg = getRegister(id);
|
|
6551
|
+
if (!reg) throw new Error(`unknown register "${id}"`);
|
|
6552
|
+
const { baseline, note } = REGISTER_BASELINE[id];
|
|
6553
|
+
const target2 = profile[baseline];
|
|
6554
|
+
if (!target2) throw new Error(`no baseline profile for "${baseline}"`);
|
|
6555
|
+
const kept = documentParagraphs(text).filter((p) => isBlurb(shapeOf(p)));
|
|
6556
|
+
const base = { register: id, baseline, paragraphs: kept.length, note };
|
|
6557
|
+
if (kept.length < MIN_PARAGRAPHS) {
|
|
6558
|
+
return {
|
|
6559
|
+
...base,
|
|
6560
|
+
measured: false,
|
|
6561
|
+
means: {},
|
|
6562
|
+
outside: [],
|
|
6563
|
+
nearest: [],
|
|
6564
|
+
summary: `Only ${kept.length} paragraph${kept.length === 1 ? "" : "s"} of 2 to 8 sentences. The registers overlap too much to place anything shorter than ${MIN_PARAGRAPHS}; read it against the brief instead.`
|
|
6565
|
+
};
|
|
6566
|
+
}
|
|
6567
|
+
const rows = kept.map(measure);
|
|
6568
|
+
const features = [...new Set(Object.values(profile).flatMap((p) => Object.keys(p)))];
|
|
6569
|
+
const means = {};
|
|
6570
|
+
for (const f4 of features) {
|
|
6571
|
+
const xs = rows.map((r) => r[f4]).filter((x) => typeof x === "number" && Number.isFinite(x));
|
|
6572
|
+
if (xs.length) means[f4] = xs.reduce((s, x) => s + x, 0) / xs.length;
|
|
6573
|
+
}
|
|
6574
|
+
const outside = [];
|
|
6575
|
+
for (const [f4, b] of Object.entries(target2)) {
|
|
6576
|
+
const v = means[f4];
|
|
6577
|
+
if (v === void 0 || b.separates.length === 0 || !usable(f4, b)) continue;
|
|
6578
|
+
if (v >= b.p10 && v <= b.p90) continue;
|
|
6579
|
+
const direction = v > b.p90 ? "higher" : "lower";
|
|
6580
|
+
outside.push({
|
|
6581
|
+
feature: f4,
|
|
6582
|
+
value: v,
|
|
6583
|
+
band: [b.p10, b.p90],
|
|
6584
|
+
direction,
|
|
6585
|
+
sentence: `${featureLabel(f4)}: ${fmt(v)}. ${reg.name} writing in the baseline runs ${fmt(b.p10)} to ${fmt(b.p90)}, so this is ${direction}.`
|
|
6586
|
+
});
|
|
6587
|
+
}
|
|
6588
|
+
const nearest2 = Object.entries(profile).map(([register, bands]) => {
|
|
6589
|
+
const zs = Object.entries(bands).filter(([f4, b]) => means[f4] !== void 0 && b.sd > 0 && usable(f4, b)).map(([f4, b]) => ((means[f4] - b.p50) / b.sd) ** 2);
|
|
6590
|
+
return { register, distance: zs.length ? Math.sqrt(zs.reduce((s, z) => s + z, 0) / zs.length) : Infinity };
|
|
6591
|
+
}).filter((n) => Number.isFinite(n.distance)).sort((a, b) => a.distance - b.distance);
|
|
6592
|
+
const closest = nearest2[0]?.register;
|
|
6593
|
+
const summary = (outside.length === 0 ? `All ${Object.entries(target2).filter(([f4, b]) => b.separates.length && usable(f4, b)).length} measured features sit inside the usual range for ${reg.name.toLowerCase()} writing.` : `${outside.length} feature${outside.length === 1 ? "" : "s"} outside the usual range for ${reg.name.toLowerCase()} writing.`) + (closest && closest !== baseline ? ` It reads closest to the ${closest} baseline.` : "");
|
|
6594
|
+
return { ...base, measured: true, means, outside, nearest: nearest2, summary };
|
|
6595
|
+
}
|
|
6596
|
+
|
|
6597
|
+
// src/register/profile.ts
|
|
6598
|
+
var PROFILE_PARAGRAPHS = 5;
|
|
6599
|
+
var PROFILE_MEASURED = "2026-09-30";
|
|
6600
|
+
var PROFILE = {
|
|
6601
|
+
"business-email": {
|
|
6602
|
+
"clauseDepth": {
|
|
6603
|
+
"p10": 0.36,
|
|
6604
|
+
"p50": 0.673,
|
|
6605
|
+
"p90": 1.113,
|
|
6606
|
+
"sd": 0.307,
|
|
6607
|
+
"separates": [
|
|
6608
|
+
"explanatory",
|
|
6609
|
+
"institutional",
|
|
6610
|
+
"literary"
|
|
6611
|
+
]
|
|
6612
|
+
},
|
|
6613
|
+
"commasPer100": {
|
|
6614
|
+
"p10": 1.424,
|
|
6615
|
+
"p50": 3.19,
|
|
6616
|
+
"p90": 5.154,
|
|
6617
|
+
"sd": 1.529,
|
|
6618
|
+
"separates": [
|
|
6619
|
+
"institutional",
|
|
6620
|
+
"literary"
|
|
6621
|
+
]
|
|
6622
|
+
},
|
|
6623
|
+
"commasPerSentence": {
|
|
6624
|
+
"p10": 0.2,
|
|
6625
|
+
"p50": 0.467,
|
|
6626
|
+
"p90": 0.826,
|
|
6627
|
+
"sd": 0.262,
|
|
6628
|
+
"separates": [
|
|
6629
|
+
"explanatory",
|
|
6630
|
+
"institutional",
|
|
6631
|
+
"literary",
|
|
6632
|
+
"marketing"
|
|
6633
|
+
]
|
|
6634
|
+
},
|
|
6635
|
+
"coordinationRate": {
|
|
6636
|
+
"p10": 0,
|
|
6637
|
+
"p50": 0.743,
|
|
6638
|
+
"p90": 1.712,
|
|
6639
|
+
"sd": 0.666,
|
|
6640
|
+
"separates": [
|
|
6641
|
+
"marketing"
|
|
6642
|
+
]
|
|
6643
|
+
},
|
|
6644
|
+
"figures": {
|
|
6645
|
+
"p10": 0.2,
|
|
6646
|
+
"p50": 0.8,
|
|
6647
|
+
"p90": 1.8,
|
|
6648
|
+
"sd": 0.725,
|
|
6649
|
+
"separates": [
|
|
6650
|
+
"literary"
|
|
6651
|
+
]
|
|
6652
|
+
},
|
|
6653
|
+
"firstPersonPer100": {
|
|
6654
|
+
"p10": 3.718,
|
|
6655
|
+
"p50": 5.968,
|
|
6656
|
+
"p90": 8.375,
|
|
6657
|
+
"sd": 1.825,
|
|
6658
|
+
"separates": [
|
|
6659
|
+
"explanatory"
|
|
6660
|
+
]
|
|
6661
|
+
},
|
|
6662
|
+
"generic": {
|
|
6663
|
+
"p10": 0,
|
|
6664
|
+
"p50": 0,
|
|
6665
|
+
"p90": 0.2,
|
|
6666
|
+
"sd": 0.138,
|
|
6667
|
+
"separates": [
|
|
6668
|
+
"explanatory"
|
|
6669
|
+
]
|
|
6670
|
+
},
|
|
6671
|
+
"hardPer100": {
|
|
6672
|
+
"p10": 4.289,
|
|
6673
|
+
"p50": 7.127,
|
|
6674
|
+
"p90": 11.308,
|
|
6675
|
+
"sd": 2.843,
|
|
6676
|
+
"separates": [
|
|
6677
|
+
"explanatory",
|
|
6678
|
+
"institutional",
|
|
6679
|
+
"literary"
|
|
6680
|
+
]
|
|
6681
|
+
},
|
|
6682
|
+
"impersonalOpenerShare": {
|
|
6683
|
+
"p10": 0,
|
|
6684
|
+
"p50": 0,
|
|
6685
|
+
"p90": 0.067,
|
|
6686
|
+
"sd": 0.031,
|
|
6687
|
+
"separates": [
|
|
6688
|
+
"explanatory"
|
|
6689
|
+
]
|
|
6690
|
+
},
|
|
6691
|
+
"meanSentenceWords": {
|
|
6692
|
+
"p10": 11.417,
|
|
6693
|
+
"p50": 14.25,
|
|
6694
|
+
"p90": 17.87,
|
|
6695
|
+
"sd": 2.656,
|
|
6696
|
+
"separates": [
|
|
6697
|
+
"explanatory",
|
|
6698
|
+
"literary"
|
|
6699
|
+
]
|
|
6700
|
+
},
|
|
6701
|
+
"meanWordLength": {
|
|
6702
|
+
"p10": 3.858,
|
|
6703
|
+
"p50": 4.16,
|
|
6704
|
+
"p90": 4.459,
|
|
6705
|
+
"sd": 0.231,
|
|
6706
|
+
"separates": [
|
|
6707
|
+
"explanatory"
|
|
6708
|
+
]
|
|
6709
|
+
},
|
|
6710
|
+
"names": {
|
|
6711
|
+
"p10": 1.2,
|
|
6712
|
+
"p50": 2.4,
|
|
6713
|
+
"p90": 3.6,
|
|
6714
|
+
"sd": 0.965,
|
|
6715
|
+
"separates": [
|
|
6716
|
+
"explanatory",
|
|
6717
|
+
"institutional"
|
|
6718
|
+
]
|
|
6719
|
+
},
|
|
6720
|
+
"nominalisationRate": {
|
|
6721
|
+
"p10": 0.625,
|
|
6722
|
+
"p50": 1.93,
|
|
6723
|
+
"p90": 3.831,
|
|
6724
|
+
"sd": 1.264,
|
|
6725
|
+
"separates": [
|
|
6726
|
+
"institutional",
|
|
6727
|
+
"marketing"
|
|
6728
|
+
]
|
|
6729
|
+
},
|
|
6730
|
+
"participialRate": {
|
|
6731
|
+
"p10": 0,
|
|
6732
|
+
"p50": 0,
|
|
6733
|
+
"p90": 0.05,
|
|
6734
|
+
"sd": 0.035,
|
|
6735
|
+
"separates": [
|
|
6736
|
+
"literary"
|
|
6737
|
+
]
|
|
6738
|
+
},
|
|
6739
|
+
"pronounOpenerShare": {
|
|
6740
|
+
"p10": 0,
|
|
6741
|
+
"p50": 0.05,
|
|
6742
|
+
"p90": 0.15,
|
|
6743
|
+
"sd": 0.068,
|
|
6744
|
+
"separates": [
|
|
6745
|
+
"marketing"
|
|
6746
|
+
]
|
|
6747
|
+
},
|
|
6748
|
+
"sentenceCv": {
|
|
6749
|
+
"p10": 0.344,
|
|
6750
|
+
"p50": 0.468,
|
|
6751
|
+
"p90": 0.6,
|
|
6752
|
+
"sd": 0.099,
|
|
6753
|
+
"separates": [
|
|
6754
|
+
"marketing"
|
|
6755
|
+
]
|
|
6756
|
+
},
|
|
6757
|
+
"skeletonRepeat": {
|
|
6758
|
+
"p10": 0,
|
|
6759
|
+
"p50": 0.017,
|
|
6760
|
+
"p90": 0.063,
|
|
6761
|
+
"sd": 0.031,
|
|
6762
|
+
"separates": [
|
|
6763
|
+
"institutional"
|
|
6764
|
+
]
|
|
6765
|
+
},
|
|
6766
|
+
"specificsPer100": {
|
|
6767
|
+
"p10": 4.22,
|
|
6768
|
+
"p50": 7.34,
|
|
6769
|
+
"p90": 11.46,
|
|
6770
|
+
"sd": 2.892,
|
|
6771
|
+
"separates": [
|
|
6772
|
+
"explanatory",
|
|
6773
|
+
"institutional",
|
|
6774
|
+
"literary"
|
|
6775
|
+
]
|
|
6776
|
+
},
|
|
6777
|
+
"tradePer100": {
|
|
6778
|
+
"p10": 0,
|
|
6779
|
+
"p50": 0,
|
|
6780
|
+
"p90": 0.588,
|
|
6781
|
+
"sd": 0.287,
|
|
6782
|
+
"separates": [
|
|
6783
|
+
"marketing"
|
|
6784
|
+
]
|
|
6785
|
+
},
|
|
6786
|
+
"tricolons": {
|
|
6787
|
+
"p10": 0,
|
|
6788
|
+
"p50": 0,
|
|
6789
|
+
"p90": 0.2,
|
|
6790
|
+
"sd": 0.142,
|
|
6791
|
+
"separates": [
|
|
6792
|
+
"institutional",
|
|
6793
|
+
"literary",
|
|
6794
|
+
"marketing"
|
|
6795
|
+
]
|
|
6796
|
+
}
|
|
6797
|
+
},
|
|
6798
|
+
"explanatory": {
|
|
6799
|
+
"clauseDepth": {
|
|
6800
|
+
"p10": 0.78,
|
|
6801
|
+
"p50": 1.194,
|
|
6802
|
+
"p90": 1.733,
|
|
6803
|
+
"sd": 0.383,
|
|
6804
|
+
"separates": [
|
|
6805
|
+
"business-email",
|
|
6806
|
+
"literary"
|
|
6807
|
+
]
|
|
6808
|
+
},
|
|
6809
|
+
"commasPer100": {
|
|
6810
|
+
"p10": 2.579,
|
|
6811
|
+
"p50": 4.164,
|
|
6812
|
+
"p90": 6.089,
|
|
6813
|
+
"sd": 1.423,
|
|
6814
|
+
"separates": [
|
|
6815
|
+
"literary"
|
|
6816
|
+
]
|
|
6817
|
+
},
|
|
6818
|
+
"commasPerSentence": {
|
|
6819
|
+
"p10": 0.448,
|
|
6820
|
+
"p50": 0.77,
|
|
6821
|
+
"p90": 1.2,
|
|
6822
|
+
"sd": 0.309,
|
|
6823
|
+
"separates": [
|
|
6824
|
+
"business-email",
|
|
6825
|
+
"literary"
|
|
6826
|
+
]
|
|
6827
|
+
},
|
|
6828
|
+
"coordinationRate": {
|
|
6829
|
+
"p10": 0.323,
|
|
6830
|
+
"p50": 0.973,
|
|
6831
|
+
"p90": 1.862,
|
|
6832
|
+
"sd": 0.612,
|
|
6833
|
+
"separates": [
|
|
6834
|
+
"marketing"
|
|
6835
|
+
]
|
|
6836
|
+
},
|
|
6837
|
+
"figures": {
|
|
6838
|
+
"p10": 0,
|
|
6839
|
+
"p50": 0.4,
|
|
6840
|
+
"p90": 1.4,
|
|
6841
|
+
"sd": 0.631,
|
|
6842
|
+
"separates": [
|
|
6843
|
+
"literary"
|
|
6844
|
+
]
|
|
6845
|
+
},
|
|
6846
|
+
"firstPersonPer100": {
|
|
6847
|
+
"p10": 0.27,
|
|
6848
|
+
"p50": 1.282,
|
|
6849
|
+
"p90": 3.114,
|
|
6850
|
+
"sd": 1.181,
|
|
6851
|
+
"separates": [
|
|
6852
|
+
"business-email",
|
|
6853
|
+
"literary"
|
|
6854
|
+
]
|
|
6855
|
+
},
|
|
6856
|
+
"generic": {
|
|
6857
|
+
"p10": 0,
|
|
6858
|
+
"p50": 0.4,
|
|
6859
|
+
"p90": 0.6,
|
|
6860
|
+
"sd": 0.214,
|
|
6861
|
+
"separates": [
|
|
6862
|
+
"business-email",
|
|
6863
|
+
"institutional"
|
|
6864
|
+
]
|
|
6865
|
+
},
|
|
6866
|
+
"hardPer100": {
|
|
6867
|
+
"p10": 0.988,
|
|
6868
|
+
"p50": 2.62,
|
|
6869
|
+
"p90": 5.171,
|
|
6870
|
+
"sd": 1.713,
|
|
6871
|
+
"separates": [
|
|
6872
|
+
"business-email",
|
|
6873
|
+
"institutional",
|
|
6874
|
+
"marketing"
|
|
6875
|
+
]
|
|
6876
|
+
},
|
|
6877
|
+
"impersonalOpenerShare": {
|
|
6878
|
+
"p10": 0,
|
|
6879
|
+
"p50": 0.04,
|
|
6880
|
+
"p90": 0.14,
|
|
6881
|
+
"sd": 0.061,
|
|
6882
|
+
"separates": [
|
|
6883
|
+
"business-email"
|
|
6884
|
+
]
|
|
6885
|
+
},
|
|
6886
|
+
"meanSentenceWords": {
|
|
6887
|
+
"p10": 14.973,
|
|
6888
|
+
"p50": 18.31,
|
|
6889
|
+
"p90": 22.533,
|
|
6890
|
+
"sd": 3.013,
|
|
6891
|
+
"separates": [
|
|
6892
|
+
"business-email"
|
|
6893
|
+
]
|
|
6894
|
+
},
|
|
6895
|
+
"meanWordLength": {
|
|
6896
|
+
"p10": 4.207,
|
|
6897
|
+
"p50": 4.466,
|
|
6898
|
+
"p90": 4.752,
|
|
6899
|
+
"sd": 0.213,
|
|
6900
|
+
"separates": [
|
|
6901
|
+
"business-email",
|
|
6902
|
+
"literary"
|
|
6903
|
+
]
|
|
6904
|
+
},
|
|
6905
|
+
"names": {
|
|
6906
|
+
"p10": 0.4,
|
|
6907
|
+
"p50": 1.2,
|
|
6908
|
+
"p90": 2.6,
|
|
6909
|
+
"sd": 0.941,
|
|
6910
|
+
"separates": [
|
|
6911
|
+
"business-email",
|
|
6912
|
+
"institutional"
|
|
6913
|
+
]
|
|
6914
|
+
},
|
|
6915
|
+
"nominalisationRate": {
|
|
6916
|
+
"p10": 0.766,
|
|
6917
|
+
"p50": 1.823,
|
|
6918
|
+
"p90": 3.416,
|
|
6919
|
+
"sd": 1.061,
|
|
6920
|
+
"separates": [
|
|
6921
|
+
"institutional",
|
|
6922
|
+
"marketing"
|
|
6923
|
+
]
|
|
6924
|
+
},
|
|
6925
|
+
"participialRate": {
|
|
6926
|
+
"p10": 0,
|
|
6927
|
+
"p50": 0,
|
|
6928
|
+
"p90": 0.1,
|
|
6929
|
+
"sd": 0.045,
|
|
6930
|
+
"separates": []
|
|
6931
|
+
},
|
|
6932
|
+
"pronounOpenerShare": {
|
|
6933
|
+
"p10": 0,
|
|
6934
|
+
"p50": 0.033,
|
|
6935
|
+
"p90": 0.124,
|
|
6936
|
+
"sd": 0.056,
|
|
6937
|
+
"separates": [
|
|
6938
|
+
"marketing"
|
|
6939
|
+
]
|
|
6940
|
+
},
|
|
6941
|
+
"sentenceCv": {
|
|
6942
|
+
"p10": 0.337,
|
|
6943
|
+
"p50": 0.441,
|
|
6944
|
+
"p90": 0.57,
|
|
6945
|
+
"sd": 0.092,
|
|
6946
|
+
"separates": []
|
|
6947
|
+
},
|
|
6948
|
+
"skeletonRepeat": {
|
|
6949
|
+
"p10": 9e-3,
|
|
6950
|
+
"p50": 0.039,
|
|
6951
|
+
"p90": 0.091,
|
|
6952
|
+
"sd": 0.036,
|
|
6953
|
+
"separates": []
|
|
6954
|
+
},
|
|
6955
|
+
"specificsPer100": {
|
|
6956
|
+
"p10": 1.04,
|
|
6957
|
+
"p50": 2.7,
|
|
6958
|
+
"p90": 5.36,
|
|
6959
|
+
"sd": 1.731,
|
|
6960
|
+
"separates": [
|
|
6961
|
+
"business-email",
|
|
6962
|
+
"institutional",
|
|
6963
|
+
"marketing"
|
|
6964
|
+
]
|
|
6965
|
+
},
|
|
6966
|
+
"tradePer100": {
|
|
6967
|
+
"p10": 0,
|
|
6968
|
+
"p50": 0,
|
|
6969
|
+
"p90": 0.427,
|
|
6970
|
+
"sd": 0.216,
|
|
6971
|
+
"separates": [
|
|
6972
|
+
"marketing"
|
|
6973
|
+
]
|
|
6974
|
+
},
|
|
6975
|
+
"tricolons": {
|
|
6976
|
+
"p10": 0,
|
|
6977
|
+
"p50": 0.2,
|
|
6978
|
+
"p90": 0.6,
|
|
6979
|
+
"sd": 0.222,
|
|
6980
|
+
"separates": []
|
|
6981
|
+
}
|
|
6982
|
+
},
|
|
6983
|
+
"institutional": {
|
|
6984
|
+
"clauseDepth": {
|
|
6985
|
+
"p10": 0.792,
|
|
6986
|
+
"p50": 1.233,
|
|
6987
|
+
"p90": 1.76,
|
|
6988
|
+
"sd": 0.377,
|
|
6989
|
+
"separates": [
|
|
6990
|
+
"business-email",
|
|
6991
|
+
"literary"
|
|
6992
|
+
]
|
|
6993
|
+
},
|
|
6994
|
+
"commasPer100": {
|
|
6995
|
+
"p10": 3.03,
|
|
6996
|
+
"p50": 4.435,
|
|
6997
|
+
"p90": 5.941,
|
|
6998
|
+
"sd": 1.165,
|
|
6999
|
+
"separates": [
|
|
7000
|
+
"business-email",
|
|
7001
|
+
"literary"
|
|
7002
|
+
]
|
|
7003
|
+
},
|
|
7004
|
+
"commasPerSentence": {
|
|
7005
|
+
"p10": 0.61,
|
|
7006
|
+
"p50": 0.96,
|
|
7007
|
+
"p90": 1.375,
|
|
7008
|
+
"sd": 0.307,
|
|
7009
|
+
"separates": [
|
|
7010
|
+
"business-email",
|
|
7011
|
+
"literary"
|
|
7012
|
+
]
|
|
7013
|
+
},
|
|
7014
|
+
"coordinationRate": {
|
|
7015
|
+
"p10": 0.323,
|
|
7016
|
+
"p50": 0.949,
|
|
7017
|
+
"p90": 1.752,
|
|
7018
|
+
"sd": 0.559,
|
|
7019
|
+
"separates": [
|
|
7020
|
+
"marketing"
|
|
7021
|
+
]
|
|
7022
|
+
},
|
|
7023
|
+
"figures": {
|
|
7024
|
+
"p10": 0,
|
|
7025
|
+
"p50": 0.6,
|
|
7026
|
+
"p90": 1.4,
|
|
7027
|
+
"sd": 0.56,
|
|
7028
|
+
"separates": [
|
|
7029
|
+
"literary"
|
|
7030
|
+
]
|
|
7031
|
+
},
|
|
7032
|
+
"generic": {
|
|
7033
|
+
"p10": 0,
|
|
7034
|
+
"p50": 0,
|
|
7035
|
+
"p90": 0.2,
|
|
7036
|
+
"sd": 0.114,
|
|
7037
|
+
"separates": [
|
|
7038
|
+
"explanatory",
|
|
7039
|
+
"literary",
|
|
7040
|
+
"marketing"
|
|
7041
|
+
]
|
|
7042
|
+
},
|
|
7043
|
+
"hardPer100": {
|
|
7044
|
+
"p10": 3.41,
|
|
7045
|
+
"p50": 5.135,
|
|
7046
|
+
"p90": 7.304,
|
|
7047
|
+
"sd": 1.573,
|
|
7048
|
+
"separates": [
|
|
7049
|
+
"business-email",
|
|
7050
|
+
"explanatory",
|
|
7051
|
+
"literary"
|
|
7052
|
+
]
|
|
7053
|
+
},
|
|
7054
|
+
"impersonalOpenerShare": {
|
|
7055
|
+
"p10": 0,
|
|
7056
|
+
"p50": 0.033,
|
|
7057
|
+
"p90": 0.109,
|
|
7058
|
+
"sd": 0.051,
|
|
7059
|
+
"separates": []
|
|
7060
|
+
},
|
|
7061
|
+
"names": {
|
|
7062
|
+
"p10": 2,
|
|
7063
|
+
"p50": 3.2,
|
|
7064
|
+
"p90": 4.8,
|
|
7065
|
+
"sd": 1.113,
|
|
7066
|
+
"separates": [
|
|
7067
|
+
"business-email",
|
|
7068
|
+
"explanatory",
|
|
7069
|
+
"literary",
|
|
7070
|
+
"marketing"
|
|
7071
|
+
]
|
|
7072
|
+
},
|
|
7073
|
+
"nominalisationRate": {
|
|
7074
|
+
"p10": 1.992,
|
|
7075
|
+
"p50": 3.391,
|
|
7076
|
+
"p90": 5.008,
|
|
7077
|
+
"sd": 1.147,
|
|
7078
|
+
"separates": [
|
|
7079
|
+
"business-email",
|
|
7080
|
+
"explanatory",
|
|
7081
|
+
"literary"
|
|
7082
|
+
]
|
|
7083
|
+
},
|
|
7084
|
+
"participialRate": {
|
|
7085
|
+
"p10": 0,
|
|
7086
|
+
"p50": 0,
|
|
7087
|
+
"p90": 0.1,
|
|
7088
|
+
"sd": 0.044,
|
|
7089
|
+
"separates": [
|
|
7090
|
+
"literary"
|
|
7091
|
+
]
|
|
7092
|
+
},
|
|
7093
|
+
"pronounOpenerShare": {
|
|
7094
|
+
"p10": 0,
|
|
7095
|
+
"p50": 0.05,
|
|
7096
|
+
"p90": 0.164,
|
|
7097
|
+
"sd": 0.068,
|
|
7098
|
+
"separates": [
|
|
7099
|
+
"marketing"
|
|
7100
|
+
]
|
|
7101
|
+
},
|
|
7102
|
+
"sentenceCv": {
|
|
7103
|
+
"p10": 0.386,
|
|
7104
|
+
"p50": 0.512,
|
|
7105
|
+
"p90": 0.639,
|
|
7106
|
+
"sd": 0.097,
|
|
7107
|
+
"separates": [
|
|
7108
|
+
"marketing"
|
|
7109
|
+
]
|
|
7110
|
+
},
|
|
7111
|
+
"skeletonRepeat": {
|
|
7112
|
+
"p10": 0.018,
|
|
7113
|
+
"p50": 0.048,
|
|
7114
|
+
"p90": 0.087,
|
|
7115
|
+
"sd": 0.028,
|
|
7116
|
+
"separates": [
|
|
7117
|
+
"business-email"
|
|
7118
|
+
]
|
|
7119
|
+
},
|
|
7120
|
+
"specificsPer100": {
|
|
7121
|
+
"p10": 3.36,
|
|
7122
|
+
"p50": 5.2,
|
|
7123
|
+
"p90": 7.4,
|
|
7124
|
+
"sd": 1.612,
|
|
7125
|
+
"separates": [
|
|
7126
|
+
"business-email",
|
|
7127
|
+
"explanatory",
|
|
7128
|
+
"literary"
|
|
7129
|
+
]
|
|
7130
|
+
},
|
|
7131
|
+
"tradePer100": {
|
|
7132
|
+
"p10": 0,
|
|
7133
|
+
"p50": 0,
|
|
7134
|
+
"p90": 0.157,
|
|
7135
|
+
"sd": 0.101,
|
|
7136
|
+
"separates": [
|
|
7137
|
+
"marketing"
|
|
7138
|
+
]
|
|
7139
|
+
},
|
|
7140
|
+
"tricolons": {
|
|
7141
|
+
"p10": 0,
|
|
7142
|
+
"p50": 0.2,
|
|
7143
|
+
"p90": 0.6,
|
|
7144
|
+
"sd": 0.233,
|
|
7145
|
+
"separates": [
|
|
7146
|
+
"business-email"
|
|
7147
|
+
]
|
|
7148
|
+
}
|
|
7149
|
+
},
|
|
7150
|
+
"literary": {
|
|
7151
|
+
"clauseDepth": {
|
|
7152
|
+
"p10": 1.333,
|
|
7153
|
+
"p50": 2.017,
|
|
7154
|
+
"p90": 2.933,
|
|
7155
|
+
"sd": 0.626,
|
|
7156
|
+
"separates": [
|
|
7157
|
+
"business-email",
|
|
7158
|
+
"explanatory",
|
|
7159
|
+
"institutional",
|
|
7160
|
+
"marketing"
|
|
7161
|
+
]
|
|
7162
|
+
},
|
|
7163
|
+
"commasPer100": {
|
|
7164
|
+
"p10": 5.997,
|
|
7165
|
+
"p50": 8.1,
|
|
7166
|
+
"p90": 10.586,
|
|
7167
|
+
"sd": 1.815,
|
|
7168
|
+
"separates": [
|
|
7169
|
+
"business-email",
|
|
7170
|
+
"explanatory",
|
|
7171
|
+
"institutional",
|
|
7172
|
+
"marketing"
|
|
7173
|
+
]
|
|
7174
|
+
},
|
|
7175
|
+
"commasPerSentence": {
|
|
7176
|
+
"p10": 1.067,
|
|
7177
|
+
"p50": 1.667,
|
|
7178
|
+
"p90": 2.435,
|
|
7179
|
+
"sd": 0.541,
|
|
7180
|
+
"separates": [
|
|
7181
|
+
"business-email",
|
|
7182
|
+
"explanatory",
|
|
7183
|
+
"institutional",
|
|
7184
|
+
"marketing"
|
|
7185
|
+
]
|
|
7186
|
+
},
|
|
7187
|
+
"coordinationRate": {
|
|
7188
|
+
"p10": 0.194,
|
|
7189
|
+
"p50": 0.814,
|
|
7190
|
+
"p90": 1.633,
|
|
7191
|
+
"sd": 0.572,
|
|
7192
|
+
"separates": [
|
|
7193
|
+
"marketing"
|
|
7194
|
+
]
|
|
7195
|
+
},
|
|
7196
|
+
"figures": {
|
|
7197
|
+
"p10": 0,
|
|
7198
|
+
"p50": 0,
|
|
7199
|
+
"p90": 0,
|
|
7200
|
+
"sd": 0.079,
|
|
7201
|
+
"separates": [
|
|
7202
|
+
"business-email",
|
|
7203
|
+
"explanatory",
|
|
7204
|
+
"institutional",
|
|
7205
|
+
"marketing"
|
|
7206
|
+
]
|
|
7207
|
+
},
|
|
7208
|
+
"firstPersonPer100": {
|
|
7209
|
+
"p10": 2.207,
|
|
7210
|
+
"p50": 4.67,
|
|
7211
|
+
"p90": 7.486,
|
|
7212
|
+
"sd": 2.027,
|
|
7213
|
+
"separates": [
|
|
7214
|
+
"explanatory"
|
|
7215
|
+
]
|
|
7216
|
+
},
|
|
7217
|
+
"generic": {
|
|
7218
|
+
"p10": 0,
|
|
7219
|
+
"p50": 0.2,
|
|
7220
|
+
"p90": 0.4,
|
|
7221
|
+
"sd": 0.178,
|
|
7222
|
+
"separates": [
|
|
7223
|
+
"institutional"
|
|
7224
|
+
]
|
|
7225
|
+
},
|
|
7226
|
+
"hardPer100": {
|
|
7227
|
+
"p10": 1.632,
|
|
7228
|
+
"p50": 3.076,
|
|
7229
|
+
"p90": 5.154,
|
|
7230
|
+
"sd": 1.367,
|
|
7231
|
+
"separates": [
|
|
7232
|
+
"business-email",
|
|
7233
|
+
"institutional"
|
|
7234
|
+
]
|
|
7235
|
+
},
|
|
7236
|
+
"impersonalOpenerShare": {
|
|
7237
|
+
"p10": 0,
|
|
7238
|
+
"p50": 0,
|
|
7239
|
+
"p90": 0.067,
|
|
7240
|
+
"sd": 0.039,
|
|
7241
|
+
"separates": []
|
|
7242
|
+
},
|
|
7243
|
+
"meanSentenceWords": {
|
|
7244
|
+
"p10": 15.083,
|
|
7245
|
+
"p50": 20.35,
|
|
7246
|
+
"p90": 27.027,
|
|
7247
|
+
"sd": 4.744,
|
|
7248
|
+
"separates": [
|
|
7249
|
+
"business-email"
|
|
7250
|
+
]
|
|
7251
|
+
},
|
|
7252
|
+
"meanWordLength": {
|
|
7253
|
+
"p10": 3.958,
|
|
7254
|
+
"p50": 4.186,
|
|
7255
|
+
"p90": 4.409,
|
|
7256
|
+
"sd": 0.175,
|
|
7257
|
+
"separates": [
|
|
7258
|
+
"explanatory"
|
|
7259
|
+
]
|
|
7260
|
+
},
|
|
7261
|
+
"names": {
|
|
7262
|
+
"p10": 1,
|
|
7263
|
+
"p50": 1.8,
|
|
7264
|
+
"p90": 3,
|
|
7265
|
+
"sd": 0.816,
|
|
7266
|
+
"separates": [
|
|
7267
|
+
"institutional"
|
|
7268
|
+
]
|
|
7269
|
+
},
|
|
7270
|
+
"nominalisationRate": {
|
|
7271
|
+
"p10": 0.444,
|
|
7272
|
+
"p50": 1.334,
|
|
7273
|
+
"p90": 2.486,
|
|
7274
|
+
"sd": 0.817,
|
|
7275
|
+
"separates": [
|
|
7276
|
+
"institutional",
|
|
7277
|
+
"marketing"
|
|
7278
|
+
]
|
|
7279
|
+
},
|
|
7280
|
+
"participialRate": {
|
|
7281
|
+
"p10": 0,
|
|
7282
|
+
"p50": 0.067,
|
|
7283
|
+
"p90": 0.2,
|
|
7284
|
+
"sd": 0.089,
|
|
7285
|
+
"separates": [
|
|
7286
|
+
"business-email",
|
|
7287
|
+
"institutional"
|
|
7288
|
+
]
|
|
7289
|
+
},
|
|
7290
|
+
"pronounOpenerShare": {
|
|
7291
|
+
"p10": 0,
|
|
7292
|
+
"p50": 0.025,
|
|
7293
|
+
"p90": 0.12,
|
|
7294
|
+
"sd": 0.058,
|
|
7295
|
+
"separates": [
|
|
7296
|
+
"marketing"
|
|
7297
|
+
]
|
|
7298
|
+
},
|
|
7299
|
+
"sentenceCv": {
|
|
7300
|
+
"p10": 0.367,
|
|
7301
|
+
"p50": 0.485,
|
|
7302
|
+
"p90": 0.625,
|
|
7303
|
+
"sd": 0.1,
|
|
7304
|
+
"separates": [
|
|
7305
|
+
"marketing"
|
|
7306
|
+
]
|
|
7307
|
+
},
|
|
7308
|
+
"skeletonRepeat": {
|
|
7309
|
+
"p10": 5e-3,
|
|
7310
|
+
"p50": 0.029,
|
|
7311
|
+
"p90": 0.07,
|
|
7312
|
+
"sd": 0.028,
|
|
7313
|
+
"separates": []
|
|
7314
|
+
},
|
|
7315
|
+
"specificsPer100": {
|
|
7316
|
+
"p10": 1.8,
|
|
7317
|
+
"p50": 3.28,
|
|
7318
|
+
"p90": 5.24,
|
|
7319
|
+
"sd": 1.365,
|
|
7320
|
+
"separates": [
|
|
7321
|
+
"business-email",
|
|
7322
|
+
"institutional",
|
|
7323
|
+
"marketing"
|
|
7324
|
+
]
|
|
7325
|
+
},
|
|
7326
|
+
"tradePer100": {
|
|
7327
|
+
"p10": 0,
|
|
7328
|
+
"p50": 0,
|
|
7329
|
+
"p90": 0.508,
|
|
7330
|
+
"sd": 0.275,
|
|
7331
|
+
"separates": [
|
|
7332
|
+
"marketing"
|
|
7333
|
+
]
|
|
7334
|
+
},
|
|
7335
|
+
"tricolons": {
|
|
7336
|
+
"p10": 0,
|
|
7337
|
+
"p50": 0.4,
|
|
7338
|
+
"p90": 0.8,
|
|
7339
|
+
"sd": 0.314,
|
|
7340
|
+
"separates": [
|
|
7341
|
+
"business-email"
|
|
7342
|
+
]
|
|
7343
|
+
}
|
|
7344
|
+
},
|
|
7345
|
+
"marketing": {
|
|
7346
|
+
"clauseDepth": {
|
|
7347
|
+
"p10": 0.567,
|
|
7348
|
+
"p50": 0.967,
|
|
7349
|
+
"p90": 1.56,
|
|
7350
|
+
"sd": 0.413,
|
|
7351
|
+
"separates": [
|
|
7352
|
+
"literary"
|
|
7353
|
+
]
|
|
7354
|
+
},
|
|
7355
|
+
"commasPer100": {
|
|
7356
|
+
"p10": 2.169,
|
|
7357
|
+
"p50": 4.087,
|
|
7358
|
+
"p90": 6.434,
|
|
7359
|
+
"sd": 1.667,
|
|
7360
|
+
"separates": [
|
|
7361
|
+
"literary"
|
|
7362
|
+
]
|
|
7363
|
+
},
|
|
7364
|
+
"commasPerSentence": {
|
|
7365
|
+
"p10": 0.4,
|
|
7366
|
+
"p50": 0.8,
|
|
7367
|
+
"p90": 1.35,
|
|
7368
|
+
"sd": 0.402,
|
|
7369
|
+
"separates": [
|
|
7370
|
+
"business-email",
|
|
7371
|
+
"literary"
|
|
7372
|
+
]
|
|
7373
|
+
},
|
|
7374
|
+
"coordinationRate": {
|
|
7375
|
+
"p10": 1.087,
|
|
7376
|
+
"p50": 2.236,
|
|
7377
|
+
"p90": 3.473,
|
|
7378
|
+
"sd": 0.931,
|
|
7379
|
+
"separates": [
|
|
7380
|
+
"business-email",
|
|
7381
|
+
"explanatory",
|
|
7382
|
+
"institutional",
|
|
7383
|
+
"literary"
|
|
7384
|
+
]
|
|
7385
|
+
},
|
|
7386
|
+
"figures": {
|
|
7387
|
+
"p10": 0,
|
|
7388
|
+
"p50": 0.4,
|
|
7389
|
+
"p90": 1,
|
|
7390
|
+
"sd": 0.427,
|
|
7391
|
+
"separates": [
|
|
7392
|
+
"literary"
|
|
7393
|
+
]
|
|
7394
|
+
},
|
|
7395
|
+
"generic": {
|
|
7396
|
+
"p10": 0,
|
|
7397
|
+
"p50": 0.2,
|
|
7398
|
+
"p90": 0.6,
|
|
7399
|
+
"sd": 0.206,
|
|
7400
|
+
"separates": [
|
|
7401
|
+
"institutional"
|
|
7402
|
+
]
|
|
7403
|
+
},
|
|
7404
|
+
"hardPer100": {
|
|
7405
|
+
"p10": 1.899,
|
|
7406
|
+
"p50": 4.549,
|
|
7407
|
+
"p90": 8.227,
|
|
7408
|
+
"sd": 2.655,
|
|
7409
|
+
"separates": [
|
|
7410
|
+
"explanatory"
|
|
7411
|
+
]
|
|
7412
|
+
},
|
|
7413
|
+
"impersonalOpenerShare": {
|
|
7414
|
+
"p10": 0,
|
|
7415
|
+
"p50": 0,
|
|
7416
|
+
"p90": 0.1,
|
|
7417
|
+
"sd": 0.047,
|
|
7418
|
+
"separates": []
|
|
7419
|
+
},
|
|
7420
|
+
"names": {
|
|
7421
|
+
"p10": 0.6,
|
|
7422
|
+
"p50": 1.8,
|
|
7423
|
+
"p90": 3.4,
|
|
7424
|
+
"sd": 1.21,
|
|
7425
|
+
"separates": [
|
|
7426
|
+
"institutional"
|
|
7427
|
+
]
|
|
7428
|
+
},
|
|
7429
|
+
"nominalisationRate": {
|
|
7430
|
+
"p10": 1.576,
|
|
7431
|
+
"p50": 3.222,
|
|
7432
|
+
"p90": 5.534,
|
|
7433
|
+
"sd": 1.6,
|
|
7434
|
+
"separates": [
|
|
7435
|
+
"business-email",
|
|
7436
|
+
"explanatory",
|
|
7437
|
+
"literary"
|
|
7438
|
+
]
|
|
7439
|
+
},
|
|
7440
|
+
"participialRate": {
|
|
7441
|
+
"p10": 0,
|
|
7442
|
+
"p50": 0,
|
|
7443
|
+
"p90": 0.133,
|
|
7444
|
+
"sd": 0.062,
|
|
7445
|
+
"separates": []
|
|
7446
|
+
},
|
|
7447
|
+
"pronounOpenerShare": {
|
|
7448
|
+
"p10": 0.067,
|
|
7449
|
+
"p50": 0.213,
|
|
7450
|
+
"p90": 0.4,
|
|
7451
|
+
"sd": 0.136,
|
|
7452
|
+
"separates": [
|
|
7453
|
+
"business-email",
|
|
7454
|
+
"explanatory",
|
|
7455
|
+
"institutional",
|
|
7456
|
+
"literary"
|
|
7457
|
+
]
|
|
7458
|
+
},
|
|
7459
|
+
"sentenceCv": {
|
|
7460
|
+
"p10": 0.275,
|
|
7461
|
+
"p50": 0.377,
|
|
7462
|
+
"p90": 0.52,
|
|
7463
|
+
"sd": 0.096,
|
|
7464
|
+
"separates": [
|
|
7465
|
+
"business-email",
|
|
7466
|
+
"institutional",
|
|
7467
|
+
"literary"
|
|
7468
|
+
]
|
|
7469
|
+
},
|
|
7470
|
+
"skeletonRepeat": {
|
|
7471
|
+
"p10": 0,
|
|
7472
|
+
"p50": 0.031,
|
|
7473
|
+
"p90": 0.081,
|
|
7474
|
+
"sd": 0.038,
|
|
7475
|
+
"separates": []
|
|
7476
|
+
},
|
|
7477
|
+
"specificsPer100": {
|
|
7478
|
+
"p10": 2.54,
|
|
7479
|
+
"p50": 5.2,
|
|
7480
|
+
"p90": 9.18,
|
|
7481
|
+
"sd": 2.733,
|
|
7482
|
+
"separates": [
|
|
7483
|
+
"explanatory",
|
|
7484
|
+
"literary"
|
|
7485
|
+
]
|
|
7486
|
+
},
|
|
7487
|
+
"tradePer100": {
|
|
7488
|
+
"p10": 0,
|
|
7489
|
+
"p50": 0.592,
|
|
7490
|
+
"p90": 1.515,
|
|
7491
|
+
"sd": 0.612,
|
|
7492
|
+
"separates": [
|
|
7493
|
+
"business-email",
|
|
7494
|
+
"explanatory",
|
|
7495
|
+
"institutional",
|
|
7496
|
+
"literary"
|
|
7497
|
+
]
|
|
7498
|
+
},
|
|
7499
|
+
"tricolons": {
|
|
7500
|
+
"p10": 0,
|
|
7501
|
+
"p50": 0.4,
|
|
7502
|
+
"p90": 0.8,
|
|
7503
|
+
"sd": 0.309,
|
|
7504
|
+
"separates": [
|
|
7505
|
+
"business-email"
|
|
7506
|
+
]
|
|
7507
|
+
}
|
|
7508
|
+
}
|
|
7509
|
+
};
|
|
7510
|
+
|
|
6247
7511
|
// src/character/baseline.ts
|
|
6248
7512
|
var BASELINE_VERSION = 1;
|
|
6249
7513
|
function fnv1a(text) {
|
|
@@ -7551,10 +8815,11 @@ function choiceOfShared(part) {
|
|
|
7551
8815
|
}
|
|
7552
8816
|
|
|
7553
8817
|
// src/calibrate/index.ts
|
|
7554
|
-
var
|
|
8818
|
+
var LABELS2 = ["ai", "ai-looking", "human"];
|
|
7555
8819
|
var FLAGGED_TARGET = 0.9;
|
|
7556
8820
|
var HUMAN_TYPICAL_TARGET = 0.1;
|
|
7557
8821
|
var SURFACE = new Map(CATALOGUE.map((t) => [t.id, t.surface]));
|
|
8822
|
+
var GENERATION = new Map(CATALOGUE.map((t) => [t.id, t.generation]));
|
|
7558
8823
|
function designTells(tells) {
|
|
7559
8824
|
return tells.filter((t) => SURFACE.has(t) && SURFACE.get(t) !== "copy");
|
|
7560
8825
|
}
|
|
@@ -7583,15 +8848,15 @@ function flaggedTarget(target2, s, missing) {
|
|
|
7583
8848
|
}
|
|
7584
8849
|
function calibrate(pages, unmeasured = []) {
|
|
7585
8850
|
const typicality2 = pages.length > 0 && pages.every((p) => p.typicality !== void 0);
|
|
7586
|
-
const labels =
|
|
8851
|
+
const labels = LABELS2.map((l) => summarise(l, pages, typicality2));
|
|
7587
8852
|
const byLabel = Object.fromEntries(labels.map((s) => [s.label, s]));
|
|
7588
8853
|
const missing = (l) => unmeasured.filter((u) => u.label === l).length;
|
|
7589
8854
|
const positives = pages.filter((p) => positive(p.label)).length;
|
|
7590
8855
|
const fired = new Set(pages.flatMap((p) => p.tells));
|
|
7591
8856
|
const tells = [...fired].map((tell) => {
|
|
7592
|
-
const hits = Object.fromEntries(
|
|
8857
|
+
const hits = Object.fromEntries(LABELS2.map((l) => [l, pages.filter((p) => p.label === l && p.tells.includes(tell)).length]));
|
|
7593
8858
|
const on = hits.ai + hits["ai-looking"];
|
|
7594
|
-
return { tell, hits, precision: round2(on / (on + hits.human)), recall: positives ? round2(on / positives) : null };
|
|
8859
|
+
return { tell, generation: GENERATION.get(tell) ?? null, hits, precision: round2(on / (on + hits.human)), recall: positives ? round2(on / positives) : null };
|
|
7595
8860
|
}).sort((a, b) => b.hits.ai + b.hits["ai-looking"] + b.hits.human - (a.hits.ai + a.hits["ai-looking"] + a.hits.human) || a.tell.localeCompare(b.tell));
|
|
7596
8861
|
const human = byLabel.human;
|
|
7597
8862
|
const humanNote = missing("human") ? `; ${missing("human")} not measured, counted neither way` : "";
|
|
@@ -7623,18 +8888,18 @@ function formatCalibration(c, notes = []) {
|
|
|
7623
8888
|
lines.push("", `Not measured: ${c.unmeasured.length}. A page not measured never counts as a pass.`);
|
|
7624
8889
|
for (const u of c.unmeasured) lines.push(` ${u.id} (${u.label}): ${u.reason}`);
|
|
7625
8890
|
}
|
|
7626
|
-
lines.push("", "Targets");
|
|
8891
|
+
lines.push("", "Flagged is a look-closer signal, not a verdict that a site is AI-made. Nothing gates on it.", "", "Targets");
|
|
7627
8892
|
for (const t of c.targets) lines.push(` ${t.target.padEnd(50)} ${t.met === null ? "not known" : t.met ? "met" : "NOT MET"}`, ` ${t.detail}`);
|
|
7628
8893
|
lines.push("", ` ${"label".padEnd(11)} ${"pages".padStart(5)} ${"flagged".padStart(8)} ${"typical".padStart(8)} ${"tell-heavy".padStart(11)} ${"blocking".padStart(9)}`);
|
|
7629
8894
|
for (const s of c.labels) {
|
|
7630
8895
|
lines.push(` ${s.label.padEnd(11)} ${String(s.pages).padStart(5)} ${String(s.flagged).padStart(8)} ${String(s.typical ?? "-").padStart(8)} ${String(s.tellHeavy).padStart(11)} ${String(s.blocking).padStart(9)}`);
|
|
7631
8896
|
}
|
|
7632
8897
|
lines.push("", "Per tell. A hit on ai or ai-looking counts for the tell; a hit on human counts against it.");
|
|
7633
|
-
lines.push(` ${"tell".padEnd(28)} ${"ai".padStart(7)} ${"ai-looking".padStart(10)} ${"human".padStart(7)} ${"precision".padStart(9)} ${"recall".padStart(7)}`);
|
|
8898
|
+
lines.push(` ${"tell".padEnd(28)} ${"gen".padStart(3)} ${"ai".padStart(7)} ${"ai-looking".padStart(10)} ${"human".padStart(7)} ${"precision".padStart(9)} ${"recall".padStart(7)}`);
|
|
7634
8899
|
const of = (l) => c.labels.find((s) => s.label === l)?.pages ?? 0;
|
|
7635
8900
|
for (const t of c.tells) {
|
|
7636
8901
|
lines.push(
|
|
7637
|
-
` ${t.tell.padEnd(28)} ${`${t.hits.ai}/${of("ai")}`.padStart(7)} ${`${t.hits["ai-looking"]}/${of("ai-looking")}`.padStart(10)} ${`${t.hits.human}/${of("human")}`.padStart(7)} ${t.precision.toFixed(2).padStart(9)} ${(t.recall === null ? "-" : t.recall.toFixed(2)).padStart(7)}`
|
|
8902
|
+
` ${t.tell.padEnd(28)} ${String(t.generation ?? "-").padStart(3)} ${`${t.hits.ai}/${of("ai")}`.padStart(7)} ${`${t.hits["ai-looking"]}/${of("ai-looking")}`.padStart(10)} ${`${t.hits.human}/${of("human")}`.padStart(7)} ${t.precision.toFixed(2).padStart(9)} ${(t.recall === null ? "-" : t.recall.toFixed(2)).padStart(7)}`
|
|
7638
8903
|
);
|
|
7639
8904
|
}
|
|
7640
8905
|
if (!c.tells.length) lines.push(" no tell fired");
|
|
@@ -7763,6 +9028,7 @@ export {
|
|
|
7763
9028
|
CHOICE_KEYS,
|
|
7764
9029
|
COMPONENT_ROLES,
|
|
7765
9030
|
CONSIDERATION,
|
|
9031
|
+
CONTENT_FEATURES,
|
|
7766
9032
|
CONVENTION,
|
|
7767
9033
|
CUSTOMER_KINDS,
|
|
7768
9034
|
DEFAULT_IGNORE,
|
|
@@ -7793,11 +9059,12 @@ export {
|
|
|
7793
9059
|
HUMAN_TYPICAL_TARGET,
|
|
7794
9060
|
IMAGERY_TELLS,
|
|
7795
9061
|
JSON_SCHEMA_VERSION,
|
|
7796
|
-
LABELS,
|
|
9062
|
+
LABELS2 as LABELS,
|
|
7797
9063
|
LEXICAL_FEATURES,
|
|
7798
9064
|
LICENCES,
|
|
7799
9065
|
LIGHTNESS_CURVE,
|
|
7800
9066
|
MIN_DECIDED,
|
|
9067
|
+
MIN_PARAGRAPHS,
|
|
7801
9068
|
MIN_RUNS,
|
|
7802
9069
|
MOOD,
|
|
7803
9070
|
NEGATIVE_REASSURANCE,
|
|
@@ -7806,6 +9073,9 @@ export {
|
|
|
7806
9073
|
PILL_LIMIT,
|
|
7807
9074
|
PLAINER_WORDS,
|
|
7808
9075
|
PREFERENCE,
|
|
9076
|
+
PROFILE,
|
|
9077
|
+
PROFILE_MEASURED,
|
|
9078
|
+
PROFILE_PARAGRAPHS,
|
|
7809
9079
|
PROMO_BADGE,
|
|
7810
9080
|
PROOF_NAMES,
|
|
7811
9081
|
PROPOSED,
|
|
@@ -7814,6 +9084,10 @@ export {
|
|
|
7814
9084
|
READABLE_SNAPSHOT_VERSIONS,
|
|
7815
9085
|
REFLEX_FONTS_1,
|
|
7816
9086
|
REFLEX_FONTS_2,
|
|
9087
|
+
REGISTERS,
|
|
9088
|
+
REGISTER_BASELINE,
|
|
9089
|
+
REGISTER_FEATURES,
|
|
9090
|
+
REGISTER_IDS,
|
|
7817
9091
|
RENDERED_PATHS,
|
|
7818
9092
|
RENDERED_TELLS,
|
|
7819
9093
|
REVEAL_LIMIT,
|
|
@@ -7856,6 +9130,7 @@ export {
|
|
|
7856
9130
|
checkOrder,
|
|
7857
9131
|
checkPair,
|
|
7858
9132
|
checkReason,
|
|
9133
|
+
checkRegister,
|
|
7859
9134
|
checkRestraint,
|
|
7860
9135
|
choicesOf,
|
|
7861
9136
|
clauseDepth,
|
|
@@ -7880,6 +9155,7 @@ export {
|
|
|
7880
9155
|
densityCss,
|
|
7881
9156
|
densityTokens,
|
|
7882
9157
|
designTells,
|
|
9158
|
+
documentParagraphs,
|
|
7883
9159
|
emitCss,
|
|
7884
9160
|
emptyEstate,
|
|
7885
9161
|
estateComponentPairs,
|
|
@@ -7887,6 +9163,7 @@ export {
|
|
|
7887
9163
|
exitDuration,
|
|
7888
9164
|
extractHtml,
|
|
7889
9165
|
faceLicence,
|
|
9166
|
+
featureLabel,
|
|
7890
9167
|
findClaims,
|
|
7891
9168
|
findColours,
|
|
7892
9169
|
findingKey,
|
|
@@ -7903,6 +9180,7 @@ export {
|
|
|
7903
9180
|
formatDirectionMatches,
|
|
7904
9181
|
formatHex,
|
|
7905
9182
|
formatReport,
|
|
9183
|
+
getRegister,
|
|
7906
9184
|
globToRegExp,
|
|
7907
9185
|
groundName,
|
|
7908
9186
|
harvest,
|
|
@@ -7949,6 +9227,9 @@ export {
|
|
|
7949
9227
|
ramp,
|
|
7950
9228
|
rampFromAnchors,
|
|
7951
9229
|
readSnapshot,
|
|
9230
|
+
registerBrief,
|
|
9231
|
+
registerOf,
|
|
9232
|
+
registersDoc,
|
|
7952
9233
|
renderedOrder,
|
|
7953
9234
|
researchPrompt,
|
|
7954
9235
|
retrofitPlan,
|