chaffjs 0.38.0 → 0.40.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/README.ja.md +21 -4
- package/README.md +20 -2
- package/checks/ai-tells.yaml +153 -0
- package/dist/acronym-expansion.d.ts +4 -0
- package/dist/acronym-expansion.d.ts.map +1 -0
- package/dist/acronym-expansion.js +46 -0
- package/dist/acronym-expansion.js.map +1 -0
- package/dist/ai-score/human-shares.d.ts.map +1 -1
- package/dist/ai-score/human-shares.js +54 -12
- package/dist/ai-score/human-shares.js.map +1 -1
- package/dist/ai-score/of-document.d.ts.map +1 -1
- package/dist/ai-score/of-document.js +4 -2
- package/dist/ai-score/of-document.js.map +1 -1
- package/dist/alternative-words.d.ts +6 -0
- package/dist/alternative-words.d.ts.map +1 -1
- package/dist/alternative-words.js +10 -0
- package/dist/alternative-words.js.map +1 -1
- package/dist/body-section.d.ts +3 -1
- package/dist/body-section.d.ts.map +1 -1
- package/dist/body-section.js +9 -2
- package/dist/body-section.js.map +1 -1
- package/dist/capitals-with-small.d.ts +5 -0
- package/dist/capitals-with-small.d.ts.map +1 -1
- package/dist/capitals-with-small.js +15 -0
- package/dist/capitals-with-small.js.map +1 -1
- package/dist/checks.d.ts +11 -0
- package/dist/checks.d.ts.map +1 -1
- package/dist/checks.js +27 -1
- package/dist/checks.js.map +1 -1
- package/dist/cli-args.js +1 -1
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +4 -0
- package/dist/cli-text.js.map +1 -1
- package/dist/closing-code.d.ts +8 -0
- package/dist/closing-code.d.ts.map +1 -0
- package/dist/closing-code.js +18 -0
- package/dist/closing-code.js.map +1 -0
- package/dist/commands/fix-plan.d.ts.map +1 -1
- package/dist/commands/fix-plan.js +64 -4
- package/dist/commands/fix-plan.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +16 -2
- package/dist/commands/test.js.map +1 -1
- package/dist/date-format.d.ts +19 -1
- package/dist/date-format.d.ts.map +1 -1
- package/dist/date-format.js +41 -5
- package/dist/date-format.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +5 -2
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +19 -4
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +25 -0
- package/dist/detectors/acronym-expansion.js.map +1 -1
- package/dist/detectors/acronym-gloss.d.ts +19 -0
- package/dist/detectors/acronym-gloss.d.ts.map +1 -1
- package/dist/detectors/acronym-gloss.js +115 -0
- package/dist/detectors/acronym-gloss.js.map +1 -1
- package/dist/detectors/acronym-mention.d.ts +5 -0
- package/dist/detectors/acronym-mention.d.ts.map +1 -1
- package/dist/detectors/acronym-mention.js +16 -0
- package/dist/detectors/acronym-mention.js.map +1 -1
- package/dist/detectors/acronym-name.d.ts +14 -2
- package/dist/detectors/acronym-name.d.ts.map +1 -1
- package/dist/detectors/acronym-name.js +28 -3
- package/dist/detectors/acronym-name.js.map +1 -1
- package/dist/detectors/acronym-series.d.ts +7 -0
- package/dist/detectors/acronym-series.d.ts.map +1 -0
- package/dist/detectors/acronym-series.js +25 -0
- package/dist/detectors/acronym-series.js.map +1 -0
- package/dist/detectors/ai-phrasing.d.ts +3 -6
- package/dist/detectors/ai-phrasing.d.ts.map +1 -1
- package/dist/detectors/ai-phrasing.js +17 -16
- package/dist/detectors/ai-phrasing.js.map +1 -1
- package/dist/detectors/ai-structure.d.ts +1 -0
- package/dist/detectors/ai-structure.d.ts.map +1 -1
- package/dist/detectors/ai-structure.js +15 -4
- package/dist/detectors/ai-structure.js.map +1 -1
- package/dist/detectors/alnum-number.d.ts +1 -0
- package/dist/detectors/alnum-number.d.ts.map +1 -1
- package/dist/detectors/alnum-number.js +7 -3
- package/dist/detectors/alnum-number.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts +6 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +31 -12
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-runs.d.ts +12 -0
- package/dist/detectors/blank-runs.d.ts.map +1 -0
- package/dist/detectors/blank-runs.js +27 -0
- package/dist/detectors/blank-runs.js.map +1 -0
- package/dist/detectors/bold-emphasis-form.d.ts +8 -0
- package/dist/detectors/bold-emphasis-form.d.ts.map +1 -0
- package/dist/detectors/bold-emphasis-form.js +40 -0
- package/dist/detectors/bold-emphasis-form.js.map +1 -0
- package/dist/detectors/bold-emphasis.d.ts +0 -1
- package/dist/detectors/bold-emphasis.d.ts.map +1 -1
- package/dist/detectors/bold-emphasis.js +14 -12
- package/dist/detectors/bold-emphasis.js.map +1 -1
- package/dist/detectors/bold-label.d.ts +3 -1
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +16 -6
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/capitalised-term.d.ts.map +1 -1
- package/dist/detectors/capitalised-term.js +28 -9
- package/dist/detectors/capitalised-term.js.map +1 -1
- package/dist/detectors/caps-caption.d.ts +5 -0
- package/dist/detectors/caps-caption.d.ts.map +1 -1
- package/dist/detectors/caps-caption.js +20 -2
- package/dist/detectors/caps-caption.js.map +1 -1
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +86 -27
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/chat-log-line.d.ts +8 -0
- package/dist/detectors/chat-log-line.d.ts.map +1 -0
- package/dist/detectors/chat-log-line.js +13 -0
- package/dist/detectors/chat-log-line.js.map +1 -0
- package/dist/detectors/citation-string.d.ts +9 -0
- package/dist/detectors/citation-string.d.ts.map +1 -0
- package/dist/detectors/citation-string.js +86 -0
- package/dist/detectors/citation-string.js.map +1 -0
- package/dist/detectors/closing-cliche.d.ts +18 -0
- package/dist/detectors/closing-cliche.d.ts.map +1 -0
- package/dist/detectors/closing-cliche.js +58 -0
- package/dist/detectors/closing-cliche.js.map +1 -0
- package/dist/detectors/closing-exhortation.d.ts +18 -0
- package/dist/detectors/closing-exhortation.d.ts.map +1 -0
- package/dist/detectors/closing-exhortation.js +55 -0
- package/dist/detectors/closing-exhortation.js.map +1 -0
- package/dist/detectors/cold-open.d.ts +25 -0
- package/dist/detectors/cold-open.d.ts.map +1 -0
- package/dist/detectors/cold-open.js +121 -0
- package/dist/detectors/cold-open.js.map +1 -0
- package/dist/detectors/comparative-context.d.ts +21 -0
- package/dist/detectors/comparative-context.d.ts.map +1 -0
- package/dist/detectors/comparative-context.js +57 -0
- package/dist/detectors/comparative-context.js.map +1 -0
- package/dist/detectors/concrete-evidence-density.d.ts +3 -0
- package/dist/detectors/concrete-evidence-density.d.ts.map +1 -0
- package/dist/detectors/concrete-evidence-density.js +75 -0
- package/dist/detectors/concrete-evidence-density.js.map +1 -0
- package/dist/detectors/concrete-evidence.d.ts +14 -0
- package/dist/detectors/concrete-evidence.d.ts.map +1 -1
- package/dist/detectors/concrete-evidence.js +24 -0
- package/dist/detectors/concrete-evidence.js.map +1 -1
- package/dist/detectors/contraction-emphasis.d.ts +3 -0
- package/dist/detectors/contraction-emphasis.d.ts.map +1 -0
- package/dist/detectors/contraction-emphasis.js +24 -0
- package/dist/detectors/contraction-emphasis.js.map +1 -0
- package/dist/detectors/contraction-mention.d.ts +12 -1
- package/dist/detectors/contraction-mention.d.ts.map +1 -1
- package/dist/detectors/contraction-mention.js +39 -6
- package/dist/detectors/contraction-mention.js.map +1 -1
- package/dist/detectors/contraction-mix.d.ts +3 -0
- package/dist/detectors/contraction-mix.d.ts.map +1 -0
- package/dist/detectors/contraction-mix.js +69 -0
- package/dist/detectors/contraction-mix.js.map +1 -0
- package/dist/detectors/contrast-frame.d.ts +5 -0
- package/dist/detectors/contrast-frame.d.ts.map +1 -1
- package/dist/detectors/contrast-frame.js +53 -6
- package/dist/detectors/contrast-frame.js.map +1 -1
- package/dist/detectors/coordinate-adjective.d.ts +2 -1
- package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
- package/dist/detectors/coordinate-adjective.js +4 -2
- package/dist/detectors/coordinate-adjective.js.map +1 -1
- package/dist/detectors/date-format.d.ts.map +1 -1
- package/dist/detectors/date-format.js +13 -1
- package/dist/detectors/date-format.js.map +1 -1
- package/dist/detectors/duplicate-definition.d.ts +3 -0
- package/dist/detectors/duplicate-definition.d.ts.map +1 -0
- package/dist/detectors/duplicate-definition.js +16 -0
- package/dist/detectors/duplicate-definition.js.map +1 -0
- package/dist/detectors/duplicate-heading.d.ts +4 -2
- package/dist/detectors/duplicate-heading.d.ts.map +1 -1
- package/dist/detectors/duplicate-heading.js +35 -11
- package/dist/detectors/duplicate-heading.js.map +1 -1
- package/dist/detectors/email-frame-words.d.ts +10 -0
- package/dist/detectors/email-frame-words.d.ts.map +1 -0
- package/dist/detectors/email-frame-words.js +34 -0
- package/dist/detectors/email-frame-words.js.map +1 -0
- package/dist/detectors/email-letter.d.ts +3 -7
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +13 -21
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/final-period-captions.d.ts +15 -0
- package/dist/detectors/final-period-captions.d.ts.map +1 -0
- package/dist/detectors/final-period-captions.js +61 -0
- package/dist/detectors/final-period-captions.js.map +1 -0
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +20 -4
- package/dist/detectors/fullwidth-alnum.js.map +1 -1
- package/dist/detectors/gram-furniture.d.ts +18 -1
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +71 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-openers.d.ts +16 -0
- package/dist/detectors/gram-openers.d.ts.map +1 -1
- package/dist/detectors/gram-openers.js +52 -0
- package/dist/detectors/gram-openers.js.map +1 -1
- package/dist/detectors/gram-predicate.d.ts.map +1 -1
- package/dist/detectors/gram-predicate.js +40 -7
- package/dist/detectors/gram-predicate.js.map +1 -1
- package/dist/detectors/gram-repetition.d.ts +3 -0
- package/dist/detectors/gram-repetition.d.ts.map +1 -0
- package/dist/detectors/gram-repetition.js +158 -0
- package/dist/detectors/gram-repetition.js.map +1 -0
- package/dist/detectors/heading-level-skip.d.ts +6 -0
- package/dist/detectors/heading-level-skip.d.ts.map +1 -1
- package/dist/detectors/heading-level-skip.js +24 -1
- package/dist/detectors/heading-level-skip.js.map +1 -1
- package/dist/detectors/heading-numbering.js +2 -2
- package/dist/detectors/heading-numbering.js.map +1 -1
- package/dist/detectors/heading-sentences.d.ts +10 -0
- package/dist/detectors/heading-sentences.d.ts.map +1 -0
- package/dist/detectors/heading-sentences.js +32 -0
- package/dist/detectors/heading-sentences.js.map +1 -0
- package/dist/detectors/hyphen-copied-text.d.ts +3 -0
- package/dist/detectors/hyphen-copied-text.d.ts.map +1 -0
- package/dist/detectors/hyphen-copied-text.js +49 -0
- package/dist/detectors/hyphen-copied-text.js.map +1 -0
- package/dist/detectors/kanji-name-edge.d.ts +15 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
- package/dist/detectors/kanji-name-edge.js +30 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -1
- package/dist/detectors/kanji-run-pieces.d.ts +7 -0
- package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
- package/dist/detectors/kanji-run-pieces.js +14 -4
- package/dist/detectors/kanji-run-pieces.js.map +1 -1
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +22 -4
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lead-in-dash.d.ts +5 -0
- package/dist/detectors/lead-in-dash.d.ts.map +1 -1
- package/dist/detectors/lead-in-dash.js +9 -0
- package/dist/detectors/lead-in-dash.js.map +1 -1
- package/dist/detectors/letter-joined-name.d.ts +2 -0
- package/dist/detectors/letter-joined-name.d.ts.map +1 -1
- package/dist/detectors/letter-joined-name.js +8 -0
- package/dist/detectors/letter-joined-name.js.map +1 -1
- package/dist/detectors/lexicon.d.ts +1 -2
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +16 -57
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/list-item.d.ts +14 -0
- package/dist/detectors/list-item.d.ts.map +1 -1
- package/dist/detectors/list-item.js +30 -1
- package/dist/detectors/list-item.js.map +1 -1
- package/dist/detectors/list-items.d.ts +1 -1
- package/dist/detectors/list-items.d.ts.map +1 -1
- package/dist/detectors/list-items.js +2 -0
- package/dist/detectors/list-items.js.map +1 -1
- package/dist/detectors/list-joint.d.ts +18 -0
- package/dist/detectors/list-joint.d.ts.map +1 -0
- package/dist/detectors/list-joint.js +42 -0
- package/dist/detectors/list-joint.js.map +1 -0
- package/dist/detectors/list-layout.d.ts +14 -0
- package/dist/detectors/list-layout.d.ts.map +1 -0
- package/dist/detectors/list-layout.js +29 -0
- package/dist/detectors/list-layout.js.map +1 -0
- package/dist/detectors/list-lead-in.d.ts +7 -2
- package/dist/detectors/list-lead-in.d.ts.map +1 -1
- package/dist/detectors/list-lead-in.js +67 -6
- package/dist/detectors/list-lead-in.js.map +1 -1
- package/dist/detectors/list-parallel.d.ts +6 -0
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +106 -13
- package/dist/detectors/list-parallel.js.map +1 -1
- package/dist/detectors/list-run.d.ts +13 -0
- package/dist/detectors/list-run.d.ts.map +1 -0
- package/dist/detectors/list-run.js +80 -0
- package/dist/detectors/list-run.js.map +1 -0
- package/dist/detectors/list-sentence.d.ts +11 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -1
- package/dist/detectors/list-sentence.js +1 -0
- package/dist/detectors/list-sentence.js.map +1 -1
- package/dist/detectors/mark-shape.d.ts +2 -1
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +10 -6
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +3 -1
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-run.d.ts +2 -0
- package/dist/detectors/name-run.d.ts.map +1 -1
- package/dist/detectors/name-run.js +1 -1
- package/dist/detectors/name-run.js.map +1 -1
- package/dist/detectors/name-variant-two-things.d.ts +18 -0
- package/dist/detectors/name-variant-two-things.d.ts.map +1 -0
- package/dist/detectors/name-variant-two-things.js +84 -0
- package/dist/detectors/name-variant-two-things.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +14 -15
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/numbering-readings.d.ts +2 -2
- package/dist/detectors/numbering-readings.d.ts.map +1 -1
- package/dist/detectors/numbering-readings.js +7 -0
- package/dist/detectors/numbering-readings.js.map +1 -1
- package/dist/detectors/open-end-anaphor.d.ts +8 -0
- package/dist/detectors/open-end-anaphor.d.ts.map +1 -0
- package/dist/detectors/open-end-anaphor.js +22 -0
- package/dist/detectors/open-end-anaphor.js.map +1 -0
- package/dist/detectors/open-end-lead.d.ts +4 -0
- package/dist/detectors/open-end-lead.d.ts.map +1 -0
- package/dist/detectors/open-end-lead.js +34 -0
- package/dist/detectors/open-end-lead.js.map +1 -0
- package/dist/detectors/open-end-scope.d.ts.map +1 -1
- package/dist/detectors/open-end-scope.js +7 -1
- package/dist/detectors/open-end-scope.js.map +1 -1
- package/dist/detectors/ordinal-run-gaps.d.ts +1 -0
- package/dist/detectors/ordinal-run-gaps.d.ts.map +1 -1
- package/dist/detectors/ordinal-run-gaps.js +1 -1
- package/dist/detectors/ordinal-run-gaps.js.map +1 -1
- package/dist/detectors/organisation-run.d.ts +6 -0
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +26 -2
- package/dist/detectors/organisation-run.js.map +1 -1
- package/dist/detectors/orthographic-variant-open.d.ts +37 -0
- package/dist/detectors/orthographic-variant-open.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-open.js +81 -0
- package/dist/detectors/orthographic-variant-open.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +55 -59
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +14 -5
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/over-general-claim.d.ts.map +1 -1
- package/dist/detectors/over-general-claim.js +82 -4
- package/dist/detectors/over-general-claim.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +61 -27
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/particle-run-names.d.ts +8 -0
- package/dist/detectors/particle-run-names.d.ts.map +1 -0
- package/dist/detectors/particle-run-names.js +17 -0
- package/dist/detectors/particle-run-names.js.map +1 -0
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +14 -2
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/proper-noun-density.d.ts +13 -0
- package/dist/detectors/proper-noun-density.d.ts.map +1 -0
- package/dist/detectors/proper-noun-density.js +97 -0
- package/dist/detectors/proper-noun-density.js.map +1 -0
- package/dist/detectors/quote-without-source.d.ts +6 -2
- package/dist/detectors/quote-without-source.d.ts.map +1 -1
- package/dist/detectors/quote-without-source.js +33 -8
- package/dist/detectors/quote-without-source.js.map +1 -1
- package/dist/detectors/quoted-excerpt.d.ts +13 -0
- package/dist/detectors/quoted-excerpt.d.ts.map +1 -0
- package/dist/detectors/quoted-excerpt.js +53 -0
- package/dist/detectors/quoted-excerpt.js.map +1 -0
- package/dist/detectors/reference-entry.d.ts +7 -0
- package/dist/detectors/reference-entry.d.ts.map +1 -0
- package/dist/detectors/reference-entry.js +35 -0
- package/dist/detectors/reference-entry.js.map +1 -0
- package/dist/detectors/register-neutral-shape.d.ts +5 -2
- package/dist/detectors/register-neutral-shape.d.ts.map +1 -1
- package/dist/detectors/register-neutral-shape.js +21 -4
- package/dist/detectors/register-neutral-shape.js.map +1 -1
- package/dist/detectors/register-separate-part.d.ts +7 -0
- package/dist/detectors/register-separate-part.d.ts.map +1 -0
- package/dist/detectors/register-separate-part.js +32 -0
- package/dist/detectors/register-separate-part.js.map +1 -0
- package/dist/detectors/register-set-apart.d.ts +24 -0
- package/dist/detectors/register-set-apart.d.ts.map +1 -0
- package/dist/detectors/register-set-apart.js +102 -0
- package/dist/detectors/register-set-apart.js.map +1 -0
- package/dist/detectors/register-voice.d.ts +14 -0
- package/dist/detectors/register-voice.d.ts.map +1 -0
- package/dist/detectors/register-voice.js +47 -0
- package/dist/detectors/register-voice.js.map +1 -0
- package/dist/detectors/register.d.ts +5 -0
- package/dist/detectors/register.d.ts.map +1 -1
- package/dist/detectors/register.js +13 -0
- package/dist/detectors/register.js.map +1 -1
- package/dist/detectors/registry/closing-cliche.d.ts +3 -0
- package/dist/detectors/registry/closing-cliche.d.ts.map +1 -0
- package/dist/detectors/registry/closing-cliche.js +3 -0
- package/dist/detectors/registry/closing-cliche.js.map +1 -0
- package/dist/detectors/registry/closing-exhortation.d.ts +3 -0
- package/dist/detectors/registry/closing-exhortation.d.ts.map +1 -0
- package/dist/detectors/registry/closing-exhortation.js +3 -0
- package/dist/detectors/registry/closing-exhortation.js.map +1 -0
- package/dist/detectors/registry/cold-open.d.ts +3 -0
- package/dist/detectors/registry/cold-open.d.ts.map +1 -0
- package/dist/detectors/registry/cold-open.js +3 -0
- package/dist/detectors/registry/cold-open.js.map +1 -0
- package/dist/detectors/registry/colon-lead-in.js +1 -1
- package/dist/detectors/registry/colon-lead-in.js.map +1 -1
- package/dist/detectors/registry/concrete-evidence.js +1 -1
- package/dist/detectors/registry/concrete-evidence.js.map +1 -1
- package/dist/detectors/registry/contraction-mix.js +1 -1
- package/dist/detectors/registry/contraction-mix.js.map +1 -1
- package/dist/detectors/registry/duplicate-definition.js +1 -1
- package/dist/detectors/registry/duplicate-definition.js.map +1 -1
- package/dist/detectors/registry/ngram-repetition.js +1 -1
- package/dist/detectors/registry/ngram-repetition.js.map +1 -1
- package/dist/detectors/registry/proper-noun-density.js +1 -1
- package/dist/detectors/registry/proper-noun-density.js.map +1 -1
- package/dist/detectors/registry/topic-predicate-distance.js +1 -1
- package/dist/detectors/registry/topic-predicate-distance.js.map +1 -1
- package/dist/detectors/registry/unprompted-denial.d.ts +3 -0
- package/dist/detectors/registry/unprompted-denial.d.ts.map +1 -0
- package/dist/detectors/registry/unprompted-denial.js +3 -0
- package/dist/detectors/registry/unprompted-denial.js.map +1 -0
- package/dist/detectors/reproduced-text.d.ts +5 -0
- package/dist/detectors/reproduced-text.d.ts.map +1 -0
- package/dist/detectors/reproduced-text.js +19 -0
- package/dist/detectors/reproduced-text.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +2 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +31 -7
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/requirement-smell.d.ts.map +1 -1
- package/dist/detectors/requirement-smell.js +16 -5
- package/dist/detectors/requirement-smell.js.map +1 -1
- package/dist/detectors/sentence-counts.d.ts +2 -1
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +23 -7
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +7 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +47 -11
- package/dist/detectors/sentence-ending.js.map +1 -1
- package/dist/detectors/sentence-length.d.ts.map +1 -1
- package/dist/detectors/sentence-length.js +37 -12
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-load.d.ts +5 -3
- package/dist/detectors/sentence-load.d.ts.map +1 -1
- package/dist/detectors/sentence-load.js +3 -5
- package/dist/detectors/sentence-load.js.map +1 -1
- package/dist/detectors/sentence-parts.d.ts +11 -0
- package/dist/detectors/sentence-parts.d.ts.map +1 -0
- package/dist/detectors/sentence-parts.js +64 -0
- package/dist/detectors/sentence-parts.js.map +1 -0
- package/dist/detectors/sentence-title.d.ts +3 -0
- package/dist/detectors/sentence-title.d.ts.map +1 -1
- package/dist/detectors/sentence-title.js +10 -0
- package/dist/detectors/sentence-title.js.map +1 -1
- package/dist/detectors/signals.d.ts +0 -2
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +18 -167
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/spelling-variety.d.ts.map +1 -1
- package/dist/detectors/spelling-variety.js +20 -2
- package/dist/detectors/spelling-variety.js.map +1 -1
- package/dist/detectors/structure-tree.d.ts +2 -1
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +3 -8
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts +9 -1
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +43 -16
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/superlative-clause.d.ts.map +1 -1
- package/dist/detectors/superlative-clause.js +19 -2
- package/dist/detectors/superlative-clause.js.map +1 -1
- package/dist/detectors/superlative-context.d.ts +35 -0
- package/dist/detectors/superlative-context.d.ts.map +1 -0
- package/dist/detectors/superlative-context.js +71 -0
- package/dist/detectors/superlative-context.js.map +1 -0
- package/dist/detectors/superlative-scope.d.ts +6 -2
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +20 -6
- package/dist/detectors/superlative-scope.js.map +1 -1
- package/dist/detectors/team.d.ts +0 -1
- package/dist/detectors/team.d.ts.map +1 -1
- package/dist/detectors/team.js +0 -46
- package/dist/detectors/team.js.map +1 -1
- package/dist/detectors/titled-code-citation.d.ts +12 -0
- package/dist/detectors/titled-code-citation.d.ts.map +1 -0
- package/dist/detectors/titled-code-citation.js +11 -0
- package/dist/detectors/titled-code-citation.js.map +1 -0
- package/dist/detectors/titled-run.d.ts +8 -1
- package/dist/detectors/titled-run.d.ts.map +1 -1
- package/dist/detectors/titled-run.js +14 -4
- package/dist/detectors/titled-run.js.map +1 -1
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +33 -16
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/topic-predicate-distance.d.ts +4 -0
- package/dist/detectors/topic-predicate-distance.d.ts.map +1 -0
- package/dist/detectors/topic-predicate-distance.js +22 -0
- package/dist/detectors/topic-predicate-distance.js.map +1 -0
- package/dist/detectors/undefined-term.d.ts +5 -0
- package/dist/detectors/undefined-term.d.ts.map +1 -1
- package/dist/detectors/undefined-term.js +22 -1
- package/dist/detectors/undefined-term.js.map +1 -1
- package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
- package/dist/detectors/unfilled-placeholder.js +15 -1
- package/dist/detectors/unfilled-placeholder.js.map +1 -1
- package/dist/detectors/unknown-word-context.d.ts +35 -0
- package/dist/detectors/unknown-word-context.d.ts.map +1 -0
- package/dist/detectors/unknown-word-context.js +100 -0
- package/dist/detectors/unknown-word-context.js.map +1 -0
- package/dist/detectors/unknown-word.d.ts +0 -5
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +17 -19
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/unprompted-denial.d.ts +25 -0
- package/dist/detectors/unprompted-denial.d.ts.map +1 -0
- package/dist/detectors/unprompted-denial.js +100 -0
- package/dist/detectors/unprompted-denial.js.map +1 -0
- package/dist/document-sections.d.ts.map +1 -1
- package/dist/document-sections.js +3 -1
- package/dist/document-sections.js.map +1 -1
- package/dist/fix-plan/all-signs.d.ts +17 -0
- package/dist/fix-plan/all-signs.d.ts.map +1 -0
- package/dist/fix-plan/all-signs.js +26 -0
- package/dist/fix-plan/all-signs.js.map +1 -0
- package/dist/fix-plan/plan.d.ts +31 -0
- package/dist/fix-plan/plan.d.ts.map +1 -1
- package/dist/fix-plan/plan.js +23 -3
- package/dist/fix-plan/plan.js.map +1 -1
- package/dist/fix-plan/render.d.ts.map +1 -1
- package/dist/fix-plan/render.js +31 -2
- package/dist/fix-plan/render.js.map +1 -1
- package/dist/fix-plan/risen.d.ts +10 -0
- package/dist/fix-plan/risen.d.ts.map +1 -0
- package/dist/fix-plan/risen.js +7 -0
- package/dist/fix-plan/risen.js.map +1 -0
- package/dist/fix-plan/text.d.ts +15 -0
- package/dist/fix-plan/text.d.ts.map +1 -1
- package/dist/fix-plan/text.js +38 -2
- package/dist/fix-plan/text.js.map +1 -1
- package/dist/heading-numbering.d.ts +2 -1
- package/dist/heading-numbering.d.ts.map +1 -1
- package/dist/heading-numbering.js +40 -10
- package/dist/heading-numbering.js.map +1 -1
- package/dist/html/html-site-chrome.d.ts.map +1 -1
- package/dist/html/html-site-chrome.js +7 -2
- package/dist/html/html-site-chrome.js.map +1 -1
- package/dist/latin-spacing-source.d.ts +12 -0
- package/dist/latin-spacing-source.d.ts.map +1 -0
- package/dist/latin-spacing-source.js +25 -0
- package/dist/latin-spacing-source.js.map +1 -0
- package/dist/law-title.d.ts +7 -0
- package/dist/law-title.d.ts.map +1 -0
- package/dist/law-title.js +29 -0
- package/dist/law-title.js.map +1 -0
- package/dist/name-ending-run.d.ts +11 -0
- package/dist/name-ending-run.d.ts.map +1 -0
- package/dist/name-ending-run.js +37 -0
- package/dist/name-ending-run.js.map +1 -0
- package/dist/name-separator.d.ts.map +1 -1
- package/dist/name-separator.js +4 -1
- package/dist/name-separator.js.map +1 -1
- package/dist/name-title-slip.d.ts +11 -0
- package/dist/name-title-slip.d.ts.map +1 -0
- package/dist/name-title-slip.js +51 -0
- package/dist/name-title-slip.js.map +1 -0
- package/dist/name-variant-shapes.d.ts +14 -0
- package/dist/name-variant-shapes.d.ts.map +1 -0
- package/dist/name-variant-shapes.js +43 -0
- package/dist/name-variant-shapes.js.map +1 -0
- package/dist/name-word-use.d.ts +5 -0
- package/dist/name-word-use.d.ts.map +1 -0
- package/dist/name-word-use.js +12 -0
- package/dist/name-word-use.js.map +1 -0
- package/dist/opening-passage.d.ts +8 -0
- package/dist/opening-passage.d.ts.map +1 -0
- package/dist/opening-passage.js +24 -0
- package/dist/opening-passage.js.map +1 -0
- package/dist/paragraph-length.d.ts +14 -0
- package/dist/paragraph-length.d.ts.map +1 -1
- package/dist/paragraph-length.js +25 -0
- package/dist/paragraph-length.js.map +1 -1
- package/dist/paragraph-runs.d.ts +2 -2
- package/dist/paragraph-runs.d.ts.map +1 -1
- package/dist/paragraph-runs.js +65 -14
- package/dist/paragraph-runs.js.map +1 -1
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/quote-echo.d.ts +6 -0
- package/dist/quote-echo.d.ts.map +1 -0
- package/dist/quote-echo.js +14 -0
- package/dist/quote-echo.js.map +1 -0
- package/dist/quote-gloss.d.ts +4 -0
- package/dist/quote-gloss.d.ts.map +1 -0
- package/dist/quote-gloss.js +7 -0
- package/dist/quote-gloss.js.map +1 -0
- package/dist/quoted-spelling.d.ts +17 -0
- package/dist/quoted-spelling.d.ts.map +1 -0
- package/dist/quoted-spelling.js +27 -0
- package/dist/quoted-spelling.js.map +1 -0
- package/dist/render/semantic.d.ts +1 -1
- package/dist/render/semantic.d.ts.map +1 -1
- package/dist/render/semantic.js +2 -1
- package/dist/render/semantic.js.map +1 -1
- package/dist/rule-of-three.d.ts +19 -0
- package/dist/rule-of-three.d.ts.map +1 -0
- package/dist/rule-of-three.js +33 -0
- package/dist/rule-of-three.js.map +1 -0
- package/dist/run-semantic.d.ts.map +1 -1
- package/dist/run-semantic.js +2 -2
- package/dist/run-semantic.js.map +1 -1
- package/dist/section-levels.d.ts +18 -0
- package/dist/section-levels.d.ts.map +1 -0
- package/dist/section-levels.js +80 -0
- package/dist/section-levels.js.map +1 -0
- package/dist/semantic.d.ts +2 -0
- package/dist/semantic.d.ts.map +1 -1
- package/dist/semantic.js +15 -2
- package/dist/semantic.js.map +1 -1
- package/dist/sentence-load.d.ts +2 -1
- package/dist/sentence-load.d.ts.map +1 -1
- package/dist/sentence-load.js +4 -2
- package/dist/sentence-load.js.map +1 -1
- package/dist/set-phrase-particles.d.ts +4 -0
- package/dist/set-phrase-particles.d.ts.map +1 -0
- package/dist/set-phrase-particles.js +26 -0
- package/dist/set-phrase-particles.js.map +1 -0
- package/dist/spelling.d.ts +11 -0
- package/dist/spelling.d.ts.map +1 -1
- package/dist/spelling.js +19 -5
- package/dist/spelling.js.map +1 -1
- package/dist/structure/alternative-clause.d.ts +7 -0
- package/dist/structure/alternative-clause.d.ts.map +1 -1
- package/dist/structure/alternative-clause.js +23 -8
- package/dist/structure/alternative-clause.js.map +1 -1
- package/dist/structure/cited-document-section.d.ts +2 -0
- package/dist/structure/cited-document-section.d.ts.map +1 -1
- package/dist/structure/cited-document-section.js +23 -1
- package/dist/structure/cited-document-section.js.map +1 -1
- package/dist/structure/issues.d.ts +4 -2
- package/dist/structure/issues.d.ts.map +1 -1
- package/dist/structure/issues.js +17 -9
- package/dist/structure/issues.js.map +1 -1
- package/dist/structure/numbering.d.ts +10 -1
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +41 -4
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/unread-label.d.ts +13 -0
- package/dist/structure/unread-label.d.ts.map +1 -0
- package/dist/structure/unread-label.js +70 -0
- package/dist/structure/unread-label.js.map +1 -0
- package/dist/structure-shape/template-outline.d.ts +11 -0
- package/dist/structure-shape/template-outline.d.ts.map +1 -0
- package/dist/structure-shape/template-outline.js +25 -0
- package/dist/structure-shape/template-outline.js.map +1 -0
- package/dist/title-case-name.d.ts +12 -0
- package/dist/title-case-name.d.ts.map +1 -0
- package/dist/title-case-name.js +37 -0
- package/dist/title-case-name.js.map +1 -0
- package/dist/topic-clause.d.ts +6 -1
- package/dist/topic-clause.d.ts.map +1 -1
- package/dist/topic-clause.js +90 -3
- package/dist/topic-clause.js.map +1 -1
- package/dist/word-use.d.ts +12 -4
- package/dist/word-use.d.ts.map +1 -1
- package/dist/word-use.js +47 -5
- package/dist/word-use.js.map +1 -1
- package/package.json +4 -3
- package/rules/ai-generated-composite.yaml +12 -3
- package/rules/ai-structure.yaml +7 -6
- package/rules/ai-tell.yaml +10 -6
- package/rules/all-caps-shouting.yaml +2 -2
- package/rules/bold-emphasis.yaml +5 -4
- package/rules/bold-label-list.yaml +6 -6
- package/rules/closing-cliche.yaml +4 -5
- package/rules/closing-exhortation.yaml +74 -0
- package/rules/cold-open.yaml +95 -0
- package/rules/colon-lead-in.yaml +68 -10
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +2 -2
- package/rules/contraction-consistency.yaml +2 -2
- package/rules/contrast-framing.yaml +16 -13
- package/rules/dangling-reference.yaml +2 -2
- package/rules/date-format-consistency.yaml +2 -2
- package/rules/duplicate-definition.yaml +2 -2
- package/rules/duplicate-heading.yaml +5 -2
- package/rules/email-greeting-closing.yaml +2 -2
- package/rules/email-stock-courtesy.yaml +62 -0
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/generic-opening.yaml +63 -0
- package/rules/heading-level-skip.yaml +2 -2
- package/rules/heading-numbering-mix.yaml +20 -20
- package/rules/honesty-marker.yaml +84 -0
- package/rules/hyphen-as-dash.yaml +2 -2
- package/rules/kutoten-consistency.yaml +4 -4
- package/rules/latin-spacing.yaml +6 -4
- package/rules/list-item-form-mix.yaml +2 -2
- package/rules/max-kanji-continuous.yaml +7 -3
- package/rules/max-paragraph-length.yaml +2 -2
- package/rules/max-sentence-length.yaml +6 -2
- package/rules/missing-final-period.yaml +2 -2
- package/rules/name-variant.yaml +5 -2
- package/rules/ngram-repetition.yaml +2 -2
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-em-dash.yaml +2 -2
- package/rules/no-mixed-desumasu.yaml +16 -3
- package/rules/nominalization.yaml +1 -1
- package/rules/numbering-gap.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +2 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +2 -2
- package/rules/oxford-comma-consistency.yaml +15 -3
- package/rules/proper-noun-density.yaml +14 -7
- package/rules/quote-without-source.yaml +2 -2
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/requirement-smell.yaml +2 -2
- package/rules/rule-of-three.yaml +3 -3
- package/rules/section-length-uniformity.yaml +2 -2
- package/rules/spelling-consistency.yaml +4 -4
- package/rules/teki-overuse.yaml +2 -2
- package/rules/topic-predicate-distance.yaml +3 -2
- package/rules/undefined-acronym.yaml +9 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +2 -2
- package/rules/unknown-word.yaml +2 -2
- package/rules/unprompted-denial.yaml +88 -0
- package/rules/unqualified-superlative.yaml +8 -2
- package/skills/chaff/SKILL.md +39 -6
- package/src/acronym-expansion.ts +57 -0
- package/src/ai-score/human-shares.ts +54 -12
- package/src/ai-score/of-document.ts +5 -2
- package/src/alternative-words.ts +15 -0
- package/src/body-section.ts +11 -2
- package/src/capitals-with-small.ts +16 -0
- package/src/checks.ts +32 -1
- package/src/cli-args.ts +1 -1
- package/src/cli-text.ts +4 -0
- package/src/closing-code.ts +21 -0
- package/src/commands/fix-plan.ts +72 -5
- package/src/commands/test.ts +18 -2
- package/src/date-format.ts +54 -7
- package/src/detectors/acronym-context.ts +23 -4
- package/src/detectors/acronym-expansion.ts +26 -0
- package/src/detectors/acronym-gloss.ts +123 -0
- package/src/detectors/acronym-mention.ts +17 -0
- package/src/detectors/acronym-name.ts +40 -3
- package/src/detectors/acronym-series.ts +27 -0
- package/src/detectors/ai-phrasing.ts +18 -17
- package/src/detectors/ai-structure.ts +23 -6
- package/src/detectors/alnum-number.ts +8 -3
- package/src/detectors/bare-comparative.ts +41 -13
- package/src/detectors/blank-runs.ts +30 -0
- package/src/detectors/bold-emphasis-form.ts +58 -0
- package/src/detectors/bold-emphasis.ts +16 -17
- package/src/detectors/bold-label.ts +22 -6
- package/src/detectors/capitalised-term.ts +36 -9
- package/src/detectors/caps-caption.ts +24 -2
- package/src/detectors/char-shape.ts +118 -29
- package/src/detectors/chat-log-line.ts +17 -0
- package/src/detectors/citation-string.ts +93 -0
- package/src/detectors/closing-cliche.ts +74 -0
- package/src/detectors/closing-exhortation.ts +74 -0
- package/src/detectors/cold-open.ts +145 -0
- package/src/detectors/comparative-context.ts +74 -0
- package/src/detectors/concrete-evidence-density.ts +99 -0
- package/src/detectors/concrete-evidence.ts +40 -0
- package/src/detectors/contraction-emphasis.ts +46 -0
- package/src/detectors/contraction-mention.ts +52 -6
- package/src/detectors/contraction-mix.ts +94 -0
- package/src/detectors/contrast-frame.ts +65 -7
- package/src/detectors/coordinate-adjective.ts +4 -2
- package/src/detectors/date-format.ts +18 -2
- package/src/detectors/duplicate-definition.ts +21 -0
- package/src/detectors/duplicate-heading.ts +44 -15
- package/src/detectors/email-frame-words.ts +39 -0
- package/src/detectors/email-letter.ts +15 -20
- package/src/detectors/final-period-captions.ts +78 -0
- package/src/detectors/fullwidth-alnum.ts +24 -4
- package/src/detectors/gram-furniture.ts +87 -1
- package/src/detectors/gram-openers.ts +71 -0
- package/src/detectors/gram-predicate.ts +49 -6
- package/src/detectors/gram-repetition.ts +199 -0
- package/src/detectors/heading-level-skip.ts +31 -1
- package/src/detectors/heading-numbering.ts +2 -2
- package/src/detectors/heading-sentences.ts +36 -0
- package/src/detectors/hyphen-copied-text.ts +65 -0
- package/src/detectors/kanji-name-edge.ts +31 -0
- package/src/detectors/kanji-run-pieces.ts +26 -0
- package/src/detectors/kutoten-consistency.ts +24 -4
- package/src/detectors/lead-in-dash.ts +11 -0
- package/src/detectors/letter-joined-name.ts +14 -0
- package/src/detectors/lexicon.ts +20 -63
- package/src/detectors/list-item.ts +37 -1
- package/src/detectors/list-items.ts +4 -1
- package/src/detectors/list-joint.ts +44 -0
- package/src/detectors/list-layout.ts +39 -0
- package/src/detectors/list-lead-in.ts +88 -7
- package/src/detectors/list-parallel.ts +119 -13
- package/src/detectors/list-run.ts +86 -0
- package/src/detectors/list-sentence.ts +11 -0
- package/src/detectors/mark-shape.ts +12 -7
- package/src/detectors/missing-final-period.ts +9 -1
- package/src/detectors/name-run.ts +2 -1
- package/src/detectors/name-variant-two-things.ts +136 -0
- package/src/detectors/name-variant.ts +14 -19
- package/src/detectors/numbering-readings.ts +10 -2
- package/src/detectors/open-end-anaphor.ts +31 -0
- package/src/detectors/open-end-lead.ts +46 -0
- package/src/detectors/open-end-scope.ts +8 -1
- package/src/detectors/ordinal-run-gaps.ts +1 -1
- package/src/detectors/organisation-run.ts +26 -2
- package/src/detectors/orthographic-variant-open.ts +124 -0
- package/src/detectors/orthographic-variant.ts +82 -82
- package/src/detectors/orthography.ts +20 -7
- package/src/detectors/over-general-claim.ts +106 -5
- package/src/detectors/oxford-comma.ts +68 -28
- package/src/detectors/particle-run-names.ts +17 -0
- package/src/detectors/placeholder-text.ts +21 -4
- package/src/detectors/proper-noun-density.ts +109 -0
- package/src/detectors/quote-without-source.ts +52 -10
- package/src/detectors/quoted-excerpt.ts +68 -0
- package/src/detectors/reference-entry.ts +42 -0
- package/src/detectors/register-neutral-shape.ts +26 -6
- package/src/detectors/register-separate-part.ts +42 -0
- package/src/detectors/register-set-apart.ts +124 -0
- package/src/detectors/register-voice.ts +63 -0
- package/src/detectors/register.ts +15 -0
- package/src/detectors/registry/closing-cliche.ts +4 -0
- package/src/detectors/registry/closing-exhortation.ts +4 -0
- package/src/detectors/registry/cold-open.ts +4 -0
- package/src/detectors/registry/colon-lead-in.ts +1 -1
- package/src/detectors/registry/concrete-evidence.ts +1 -1
- package/src/detectors/registry/contraction-mix.ts +1 -1
- package/src/detectors/registry/duplicate-definition.ts +1 -1
- package/src/detectors/registry/ngram-repetition.ts +1 -1
- package/src/detectors/registry/proper-noun-density.ts +1 -1
- package/src/detectors/registry/topic-predicate-distance.ts +1 -1
- package/src/detectors/registry/unprompted-denial.ts +4 -0
- package/src/detectors/reproduced-text.ts +33 -0
- package/src/detectors/request-owner.ts +31 -8
- package/src/detectors/requirement-smell.ts +21 -5
- package/src/detectors/sentence-counts.ts +27 -7
- package/src/detectors/sentence-ending.ts +66 -14
- package/src/detectors/sentence-length.ts +43 -11
- package/src/detectors/sentence-load.ts +3 -6
- package/src/detectors/sentence-parts.ts +73 -0
- package/src/detectors/sentence-title.ts +14 -0
- package/src/detectors/signals.ts +20 -202
- package/src/detectors/spelling-variety.ts +26 -2
- package/src/detectors/structure-tree.ts +5 -9
- package/src/detectors/structure.ts +47 -19
- package/src/detectors/superlative-clause.ts +21 -2
- package/src/detectors/superlative-context.ts +99 -0
- package/src/detectors/superlative-scope.ts +27 -9
- package/src/detectors/team.ts +1 -50
- package/src/detectors/titled-code-citation.ts +19 -0
- package/src/detectors/titled-run.ts +22 -5
- package/src/detectors/token-shape.ts +40 -18
- package/src/detectors/topic-predicate-distance.ts +25 -0
- package/src/detectors/undefined-term.ts +26 -1
- package/src/detectors/unfilled-placeholder.ts +20 -2
- package/src/detectors/unknown-word-context.ts +129 -0
- package/src/detectors/unknown-word.ts +29 -20
- package/src/detectors/unprompted-denial.ts +133 -0
- package/src/document-sections.ts +3 -1
- package/src/fix-plan/all-signs.ts +35 -0
- package/src/fix-plan/plan.ts +50 -3
- package/src/fix-plan/render.ts +41 -3
- package/src/fix-plan/risen.ts +13 -0
- package/src/fix-plan/text.ts +56 -2
- package/src/heading-numbering.ts +44 -10
- package/src/html/html-site-chrome.ts +9 -2
- package/src/latin-spacing-source.ts +33 -0
- package/src/law-title.ts +38 -0
- package/src/name-ending-run.ts +49 -0
- package/src/name-separator.ts +4 -1
- package/src/name-title-slip.ts +59 -0
- package/src/name-variant-shapes.ts +58 -0
- package/src/name-word-use.ts +17 -0
- package/src/opening-passage.ts +31 -0
- package/src/paragraph-length.ts +31 -0
- package/src/paragraph-runs.ts +71 -13
- package/src/plugin.ts +2 -0
- package/src/quote-echo.ts +18 -0
- package/src/quote-gloss.ts +11 -0
- package/src/quoted-spelling.ts +48 -0
- package/src/render/semantic.ts +2 -2
- package/src/rule-of-three.ts +50 -0
- package/src/run-semantic.ts +2 -2
- package/src/section-levels.ts +98 -0
- package/src/semantic.ts +16 -3
- package/src/sentence-load.ts +5 -3
- package/src/set-phrase-particles.ts +32 -0
- package/src/spelling.ts +37 -7
- package/src/structure/alternative-clause.ts +32 -7
- package/src/structure/cited-document-section.ts +24 -1
- package/src/structure/issues.ts +29 -10
- package/src/structure/numbering.ts +50 -3
- package/src/structure/unread-label.ts +74 -0
- package/src/structure-shape/template-outline.ts +34 -0
- package/src/title-case-name.ts +55 -0
- package/src/topic-clause.ts +110 -5
- package/src/word-use.ts +57 -6
- package/dist/legal-address.d.ts +0 -2
- package/dist/legal-address.d.ts.map +0 -1
- package/dist/legal-address.js +0 -16
- package/dist/legal-address.js.map +0 -1
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
|
-
import { isKnownWord, isSplitWord, suggestionFor, wordsToCheck, type
|
|
2
|
+
import { hasTwoEndings, isKnownWord, isSplitWord, suggestionFor, wordsToCheck, type Speller } from "../spelling.ts";
|
|
3
3
|
import { parse } from "../markdown-read.ts";
|
|
4
4
|
import { eachPreOrder } from "../tree-walk.ts";
|
|
5
5
|
import { quoteAt } from "./structure-tree.ts";
|
|
6
|
+
import {
|
|
7
|
+
addressWordsOf,
|
|
8
|
+
beforeVersion,
|
|
9
|
+
besideForeignWord,
|
|
10
|
+
hasDrugStem,
|
|
11
|
+
hasSiblingName,
|
|
12
|
+
inSearchTermList,
|
|
13
|
+
isClosedCompound,
|
|
14
|
+
isMention,
|
|
15
|
+
usedOnce,
|
|
16
|
+
} from "./unknown-word-context.ts";
|
|
6
17
|
|
|
7
18
|
/** これより短い語は見ない。短い語は一字違いの語が多すぎて言い直しが決まらず(tost は test か toast か)、略した語(impl)も多い。 */
|
|
8
19
|
const MIN_LENGTH = 5;
|
|
@@ -15,17 +26,15 @@ const patternsOf = (doc: ProseDocument, name: string): string[] => (doc.lexicons
|
|
|
15
26
|
/** 辞書と、語彙表 extra-word の語と、チームの names と、別の rule が言う誤り(known-misspelling)を足した語。 */
|
|
16
27
|
export const spellerOf = (doc: ProseDocument, dictionary: ReadonlySet<string>): Speller => ({
|
|
17
28
|
words: [dictionary, new Set([...patternsOf(doc, "extra-word"), ...(doc.names ?? []).map((name) => name.toLowerCase())])],
|
|
18
|
-
suffixes: (doc.lexicons["word-suffix"] ?? []).map((entry) => ({
|
|
29
|
+
suffixes: (doc.lexicons["word-suffix"] ?? []).map((entry) => ({
|
|
30
|
+
suffix: entry.pattern,
|
|
31
|
+
replacement: entry.instead_of ?? "",
|
|
32
|
+
inflection: entry.group === "inflection",
|
|
33
|
+
})),
|
|
19
34
|
prefixes: patternsOf(doc, "word-prefix"),
|
|
35
|
+
uninflected: new Set(patternsOf(doc, "uninflected-word")),
|
|
20
36
|
});
|
|
21
37
|
|
|
22
|
-
/** 文書で一度だけ使った語。二度以上使う語は、打ち間違いより、その文書の用語であることが多い。 */
|
|
23
|
-
const usedOnce = (words: readonly CheckedWord[]): CheckedWord[] => {
|
|
24
|
-
const counts = new Map<string, number>();
|
|
25
|
-
words.forEach(({ word }) => counts.set(word, (counts.get(word) ?? 0) + 1));
|
|
26
|
-
return words.filter(({ word }) => counts.get(word) === 1);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
38
|
const LETTERS = /\p{L}+/gu;
|
|
30
39
|
|
|
31
40
|
/** 文書がコード(コードの区画と `…`)に書いた語。コードに書いた名前(`tidyq check` の tidyq)は、地の文でも打ち間違いではない。 */
|
|
@@ -41,14 +50,12 @@ export const codeWordsOf = (source: string): Set<string> => {
|
|
|
41
50
|
return words;
|
|
42
51
|
};
|
|
43
52
|
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return source[end] === "*" && source[offset - 1] !== "*" && /^[ \t]*(?:[,;|)\]]|\r?\n|$)/u.test(source.slice(end + 1));
|
|
51
|
-
};
|
|
53
|
+
/** 辞書の語か、派生した語に活用の語尾を付けた語(operationalises、rightsized)か、四字以上の辞書の語二つを続けた語(crowdwork)。 */
|
|
54
|
+
const isFormedWord = (word: string, speller: Speller): boolean => isKnownWord(word, speller) || hasTwoEndings(word, speller) || isClosedCompound(word, speller);
|
|
55
|
+
|
|
56
|
+
/** 置かれた場所から、名前や用語と分かる語。名指した語("mailto"、(jchaplin))、検索語の並び(vaccin*)、外国語の句(bête noire)、版の番号の前(golang 1.21.5)。 */
|
|
57
|
+
const isTermByPlace = (source: string, offset: number, word: string): boolean =>
|
|
58
|
+
isMention(source, offset, word) || inSearchTermList(source, offset) || besideForeignWord(source, offset, word) || beforeVersion(source, offset, word);
|
|
52
59
|
|
|
53
60
|
/**
|
|
54
61
|
* 辞書に無い英語の語で、一字違いの辞書の語があるもの(recieve → receive)。辞書は adapter が持ち、無い言語では動かない。
|
|
@@ -58,11 +65,13 @@ export const isSearchStem = (source: string, offset: number, word: string): bool
|
|
|
58
65
|
export const unknownWord: Detector = (doc): Finding[] => {
|
|
59
66
|
if (doc.dictionary === undefined) return [];
|
|
60
67
|
const speller = spellerOf(doc, doc.dictionary());
|
|
61
|
-
const known = new Set([...patternsOf(doc, "known-misspelling"), ...codeWordsOf(doc.source)]);
|
|
68
|
+
const known = new Set([...patternsOf(doc, "known-misspelling"), ...codeWordsOf(doc.source), ...addressWordsOf(doc.source)]);
|
|
69
|
+
const drugStems = patternsOf(doc, "drug-stem");
|
|
62
70
|
const words = wordsToCheck(doc.prose ?? doc.source, MIN_LENGTH, MAX_LENGTH).filter(({ offset }) => !isSplitWord(doc.source, offset));
|
|
63
71
|
const used = new Set(words.map(({ word }) => word).filter((word) => isKnownWord(word, speller)));
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
const unformed = new Set(words.map(({ word }) => word).filter((word) => !known.has(word) && !isFormedWord(word, speller)));
|
|
73
|
+
return usedOnce(words, speller).flatMap(({ offset, word }) => {
|
|
74
|
+
if (!unformed.has(word) || hasDrugStem(word, drugStems) || hasSiblingName(word, unformed) || isTermByPlace(doc.source, offset, word)) return [];
|
|
66
75
|
const suggestion = suggestionFor(word, speller, used);
|
|
67
76
|
if (suggestion === undefined) return [];
|
|
68
77
|
return [{ rule: "", severity: "warning", line: 0, column: 0, quote: quoteAt(doc.source, offset), values: { word, suggestion, offset } }];
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { Detector, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence } from "../plugin.ts";
|
|
2
|
+
import { wordsOf } from "./structure.ts";
|
|
3
|
+
import { MIN_DOCUMENT_LENGTH } from "./signals.ts";
|
|
4
|
+
import { comparableText, comparableWords, entryCloses, entryIn, entryOpens, entryRanges } from "./lexicon-match.ts";
|
|
5
|
+
import { contrastSentences, type ContrastWords } from "./contrast-frame.ts";
|
|
6
|
+
import { contrastShare } from "./ai-phrasing.ts";
|
|
7
|
+
|
|
8
|
+
// 誰も言っていない前提を打ち消して終わる文(〜の話ではありません、This isn't about tooling.)。語はどれも語彙表が持ち、
|
|
9
|
+
// ここは組み方だけを知る。語彙表の group:
|
|
10
|
+
// end 文がこの語で閉じれば打ち消し(日本語)。直前に exempt の語があれば数えない(だけではない、べきではない)
|
|
11
|
+
// open 文がこの語で始まり、次の語が follow の語なら打ち消し(英語の This isn't about)
|
|
12
|
+
// basis 同じ文にあれば数えない(理由を添えた打ち消しは事実を言っている)
|
|
13
|
+
// reason 文がこの語で閉じれば basis を見ない(〜だから並ぶのではありません は理由を打ち消している)
|
|
14
|
+
// premise 前の文にあれば数えない(打ち消す相手が文書の中にある)
|
|
15
|
+
// question 前の文がこの語で閉じれば数えない(問いへの答え)
|
|
16
|
+
// 対比の枠(contrast-framing が数える文)は、言い直しが隣にあるので数えない。
|
|
17
|
+
|
|
18
|
+
export type DenialWords = {
|
|
19
|
+
readonly ends: Lexicon;
|
|
20
|
+
readonly exempts: Lexicon;
|
|
21
|
+
readonly opens: Lexicon;
|
|
22
|
+
readonly follows: Lexicon;
|
|
23
|
+
readonly bases: Lexicon;
|
|
24
|
+
readonly reasons: Lexicon;
|
|
25
|
+
readonly premises: Lexicon;
|
|
26
|
+
readonly questions: Lexicon;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const groupOf = (lexicon: Lexicon, group: string): Lexicon => lexicon.filter((entry) => entry.group === group);
|
|
30
|
+
|
|
31
|
+
export const denialWords = (lexicon: Lexicon): DenialWords => ({
|
|
32
|
+
ends: groupOf(lexicon, "end"),
|
|
33
|
+
exempts: groupOf(lexicon, "exempt"),
|
|
34
|
+
opens: groupOf(lexicon, "open"),
|
|
35
|
+
follows: groupOf(lexicon, "follow"),
|
|
36
|
+
bases: groupOf(lexicon, "basis"),
|
|
37
|
+
reasons: groupOf(lexicon, "reason"),
|
|
38
|
+
premises: groupOf(lexicon, "premise"),
|
|
39
|
+
questions: groupOf(lexicon, "question"),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/** 文が end の語で閉じ、その直前が exempt の語でないなら、その end の語。 */
|
|
43
|
+
const closingDenial = (sentence: Sentence, words: DenialWords): LexiconEntry | undefined => {
|
|
44
|
+
const end = words.ends.find((entry) => entryCloses(sentence, entry));
|
|
45
|
+
if (end === undefined) return undefined;
|
|
46
|
+
const exempt = words.exempts.some((entry) => words.ends.some((other) => entryCloses(sentence, { pattern: `${entry.pattern}${other.pattern}` })));
|
|
47
|
+
return exempt ? undefined : end;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const LETTER = /\p{L}/u;
|
|
51
|
+
|
|
52
|
+
/** 品詞が無いときは文字列で、open の語の直後の語を見る。 */
|
|
53
|
+
const textFollows = (sentence: Sentence, open: LexiconEntry, follows: Lexicon): boolean => {
|
|
54
|
+
const text = comparableText(sentence);
|
|
55
|
+
const head = comparableWords(open.pattern);
|
|
56
|
+
if (!text.startsWith(head)) return false;
|
|
57
|
+
const rest = text.slice(head.length).trimStart();
|
|
58
|
+
return follows.some((entry) => {
|
|
59
|
+
const word = comparableWords(entry.pattern);
|
|
60
|
+
return rest.startsWith(word) && !LETTER.test(rest.charAt(word.length));
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** 文が open の語で始まり、次の語が follow の語か。 */
|
|
65
|
+
const opensWithFollow = (sentence: Sentence, open: LexiconEntry, follows: Lexicon): boolean => {
|
|
66
|
+
if (!entryOpens(sentence, open)) return false;
|
|
67
|
+
const tokens = sentence.tokens;
|
|
68
|
+
if (tokens === undefined || open.tokens === undefined) return textFollows(sentence, open, follows);
|
|
69
|
+
const range = entryRanges(sentence, open)[0];
|
|
70
|
+
const next = range === undefined ? undefined : tokens[range.end]?.surface.toLowerCase();
|
|
71
|
+
return next !== undefined && follows.some((entry) => comparableWords(entry.pattern) === next);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** A comma or semicolon carries a second clause: the denial does not end the sentence. */
|
|
75
|
+
const CLAUSE_BREAK = /[,;:、,;]/u;
|
|
76
|
+
|
|
77
|
+
const openingDenial = (sentence: Sentence, words: DenialWords): LexiconEntry | undefined =>
|
|
78
|
+
CLAUSE_BREAK.test(sentence.text) ? undefined : words.opens.find((entry) => opensWithFollow(sentence, entry, words.follows));
|
|
79
|
+
|
|
80
|
+
/** 理由を添えた打ち消しか。理由そのものを打ち消す文(〜だから並ぶのではありません)は除く。 */
|
|
81
|
+
const givesBasis = (sentence: Sentence, words: DenialWords): boolean =>
|
|
82
|
+
!words.reasons.some((entry) => entryCloses(sentence, entry)) && words.bases.some((entry) => entryIn(sentence, entry));
|
|
83
|
+
|
|
84
|
+
const QUESTION_MARK = /[??]["'”’」』))\s]*$/u;
|
|
85
|
+
|
|
86
|
+
/** 前の文が打ち消す相手を言っているか(問い、〜と思うかもしれません)。 */
|
|
87
|
+
const answersPrevious = (previous: Sentence | undefined, words: DenialWords): boolean =>
|
|
88
|
+
previous !== undefined &&
|
|
89
|
+
(QUESTION_MARK.test(previous.text) ||
|
|
90
|
+
words.questions.some((entry) => entryCloses(previous, entry)) ||
|
|
91
|
+
words.premises.some((entry) => entryIn(previous, entry)));
|
|
92
|
+
|
|
93
|
+
export type Denial = { readonly sentence: Sentence; readonly matched: string };
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 前提を打ち消して終わる文。理由を添えた文、前の文に答える文、対比の枠の文は除く。
|
|
97
|
+
* contrast は contrast-framing が数える文で、打ち消しの隣に言い直しがある。
|
|
98
|
+
*/
|
|
99
|
+
export const unpromptedDenials = (sentences: readonly Sentence[], words: DenialWords, contrast: ContrastWords): Denial[] => {
|
|
100
|
+
const framed = new Set(contrastSentences(sentences, contrast));
|
|
101
|
+
return sentences.flatMap((sentence, index) => {
|
|
102
|
+
const denial = closingDenial(sentence, words) ?? openingDenial(sentence, words);
|
|
103
|
+
if (denial === undefined || framed.has(sentence)) return [];
|
|
104
|
+
if (givesBasis(sentence, words) || answersPrevious(sentences[index - 1], words)) return [];
|
|
105
|
+
return [{ sentence, matched: denial.pattern }];
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** 一つ二つの打ち消しは論の運び。三つ目から数える。 */
|
|
110
|
+
const MIN_DENIALS = 3;
|
|
111
|
+
|
|
112
|
+
const contrastWordsOf = (doc: ProseDocument): ContrastWords => ({
|
|
113
|
+
frames: doc.lexicons["contrast-frame"] ?? [],
|
|
114
|
+
leads: doc.lexicons["contrast-lead"] ?? [],
|
|
115
|
+
turns: doc.lexicons["contrast-turn"] ?? [],
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/** 前提を打ち消して終わる文の、文書の言語の文に占める割合(%)が上限を超えたら、その文をすべて言う。 */
|
|
119
|
+
export const unpromptedDenial: Detector = (doc, options): Finding[] => {
|
|
120
|
+
const own = doc.sentences.filter((sentence) => sentence.embeddedLanguage === undefined);
|
|
121
|
+
const hits = unpromptedDenials(own, denialWords(options.lexicon ?? []), contrastWordsOf(doc));
|
|
122
|
+
if (hits.length < MIN_DENIALS || wordsOf(doc) < MIN_DOCUMENT_LENGTH[doc.lengthUnit]) return [];
|
|
123
|
+
const share = contrastShare(doc, hits.length);
|
|
124
|
+
if (share <= options.limit) return [];
|
|
125
|
+
return hits.map((hit) => ({
|
|
126
|
+
rule: "",
|
|
127
|
+
severity: "info",
|
|
128
|
+
line: 0,
|
|
129
|
+
column: 0,
|
|
130
|
+
quote: hit.sentence.text.trim(),
|
|
131
|
+
values: { matched: hit.matched, count: hits.length, share, limit: options.limit, offset: hit.sentence.span.start },
|
|
132
|
+
}));
|
|
133
|
+
};
|
package/src/document-sections.ts
CHANGED
|
@@ -30,6 +30,7 @@ export const sectionsOf = (
|
|
|
30
30
|
.map(({ heading, from, to }) => {
|
|
31
31
|
const inside = sentences.filter((sentence) => within(sentence.span, from, to));
|
|
32
32
|
const unlabeled = readers.unlabeledOf(heading.text);
|
|
33
|
+
const strongsInside = strongs.filter((span) => within(span, from, to));
|
|
33
34
|
return {
|
|
34
35
|
depth: heading.depth,
|
|
35
36
|
heading: heading.text,
|
|
@@ -39,7 +40,8 @@ export const sectionsOf = (
|
|
|
39
40
|
},
|
|
40
41
|
span: { start: from, end: to },
|
|
41
42
|
sentences: inside,
|
|
42
|
-
strongCount:
|
|
43
|
+
strongCount: strongsInside.length,
|
|
44
|
+
strongs: strongsInside,
|
|
43
45
|
firstSentence: inside[0],
|
|
44
46
|
};
|
|
45
47
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Finding, ProseDocument, RuleDefinition } from "../plugin.ts";
|
|
2
|
+
import { presetLevels } from "../genre-load.ts";
|
|
3
|
+
import { runRulesWith, type Skipped } from "../run.ts";
|
|
4
|
+
import { aiShapeRuleIds, measuredLevelsOf } from "../ai-score/signals.ts";
|
|
5
|
+
|
|
6
|
+
/** What lint found: the findings and the rules that did not run. */
|
|
7
|
+
export type LintResult = { readonly findings: readonly Finding[]; readonly skipped: readonly Skipped[] };
|
|
8
|
+
|
|
9
|
+
const ofLanguage = (rules: readonly RuleDefinition[], language: string): RuleDefinition[] =>
|
|
10
|
+
rules.filter((rule) => rule.languages === undefined || rule.languages.includes(language));
|
|
11
|
+
|
|
12
|
+
/** Every AI-likeness rule for the language: group ai-tells, the composite's inputs and the AI markup shapes. */
|
|
13
|
+
export const allSignRules = (rules: readonly RuleDefinition[], language: string): RuleDefinition[] => {
|
|
14
|
+
const forLanguage = ofLanguage(rules, language);
|
|
15
|
+
const ids = new Set(aiShapeRuleIds(forLanguage));
|
|
16
|
+
return forLanguage.filter((rule) => ids.has(rule.id));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Every AI-likeness rule run on the document whatever the genre or chaff.yaml turns off: at the genre's level where it
|
|
21
|
+
* runs, at normal where it does not (the levels ai-score measures at), and in the genre even when use_for leaves it out.
|
|
22
|
+
*/
|
|
23
|
+
export const runAllSigns = (doc: ProseDocument, rules: readonly RuleDefinition[], genre: string): LintResult => {
|
|
24
|
+
const signRules = allSignRules(rules, doc.language).map((rule) => ({ ...rule, use_for: [genre] }));
|
|
25
|
+
const result = runRulesWith(doc, signRules, { settings: measuredLevelsOf(signRules, presetLevels(genre)), experimental: true, genre });
|
|
26
|
+
return { findings: result.findings, skipped: result.skipped };
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const byLine = (left: Finding, right: Finding): number => left.line - right.line || left.column - right.column;
|
|
30
|
+
|
|
31
|
+
/** Lint's findings with the AI-likeness rules' own replaced by the all-signs run's, which sees them in every genre. */
|
|
32
|
+
export const withAllSigns = (lint: LintResult, signs: LintResult, signIds: ReadonlySet<string>): LintResult => ({
|
|
33
|
+
findings: [...lint.findings.filter((finding) => !signIds.has(finding.rule)), ...signs.findings].toSorted(byLine),
|
|
34
|
+
skipped: [...lint.skipped.filter((skipped) => !signIds.has(skipped.rule)), ...signs.skipped],
|
|
35
|
+
});
|
package/src/fix-plan/plan.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { StructureScore } from "../structure-shape/score.ts";
|
|
|
9
9
|
import { structureTargetsOf, type StructureTarget } from "./structure-targets.ts";
|
|
10
10
|
import { DEFAULT_DEPTH, depthIncludes, type RewriteDepth } from "../rewrite-depth.ts";
|
|
11
11
|
import type { ReportedGuide } from "../genre-guide/report.ts";
|
|
12
|
+
import type { RisenRule } from "./risen.ts";
|
|
12
13
|
|
|
13
14
|
/** One flagged spot, where it is and what chaff said about it. */
|
|
14
15
|
export type PlanSpot = { readonly line: number; readonly column: number; readonly quote: string; readonly message: string };
|
|
@@ -38,6 +39,18 @@ type DocumentSignal = { readonly rule: string; readonly message: string };
|
|
|
38
39
|
/** A rule that fired but reaches deeper than the chosen depth: named, not planned, so its silence is not read as fixed. */
|
|
39
40
|
export type DeeperRule = { readonly rule: string; readonly name: string; readonly depth: RewriteDepth; readonly spots: number };
|
|
40
41
|
|
|
42
|
+
/** The AI-likeness quick score in short: its level (or why none), the signs and the ones that showed. */
|
|
43
|
+
export type AiScoreSummary = {
|
|
44
|
+
readonly level: string | null;
|
|
45
|
+
readonly notScored: string | null;
|
|
46
|
+
readonly signs: number;
|
|
47
|
+
readonly compared: number;
|
|
48
|
+
readonly shown: readonly string[];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The original a rewrite is checked against (--before): the rules whose findings rose, and the original's score. */
|
|
52
|
+
export type SincePlan = { readonly path: string; readonly risen: readonly RisenRule[]; readonly aiScore: AiScoreSummary | null };
|
|
53
|
+
|
|
41
54
|
/** The depth chosen for the plan, and where: --depth on the command line, or fix_plan.depth in chaff.yaml. */
|
|
42
55
|
export type ChosenDepth = { readonly depth: RewriteDepth; readonly from: "flag" | "config" };
|
|
43
56
|
|
|
@@ -50,6 +63,14 @@ export type FixPlan = {
|
|
|
50
63
|
/** What a good document of the genre does, to rewrite against; null when the genre was not set or the guide is off. */
|
|
51
64
|
readonly guide: ReportedGuide | null;
|
|
52
65
|
readonly experimental: boolean;
|
|
66
|
+
/** --all-ai-signs: every AI-likeness rule ran, whatever the genre turns off, and the plan loops to the stop conditions. */
|
|
67
|
+
readonly allSigns: boolean;
|
|
68
|
+
/** The document's AI-likeness score; null without --all-ai-signs. */
|
|
69
|
+
readonly aiScore: AiScoreSummary | null;
|
|
70
|
+
/** With --all-ai-signs, the AI-likeness rules that have a finding, in the order the plan lists them; empty is done. */
|
|
71
|
+
readonly aiRules: readonly string[];
|
|
72
|
+
/** The comparison with the original given by --before; null without it. */
|
|
73
|
+
readonly since: SincePlan | null;
|
|
53
74
|
readonly mode: ModeChoice;
|
|
54
75
|
/** None when chaff recommends the depth itself. */
|
|
55
76
|
readonly chosenDepth: ChosenDepth | undefined;
|
|
@@ -84,6 +105,9 @@ export type PlanInput = {
|
|
|
84
105
|
readonly phrases: Lexicon;
|
|
85
106
|
readonly chosenDepth?: ChosenDepth | undefined;
|
|
86
107
|
readonly guide?: ReportedGuide | undefined;
|
|
108
|
+
/** Given with --all-ai-signs: the findings already hold every AI-likeness rule's, and this is the document's score. */
|
|
109
|
+
readonly allSigns?: { readonly aiScore: AiScoreSummary; readonly ruleIds: ReadonlySet<string> } | undefined;
|
|
110
|
+
readonly since?: SincePlan | undefined;
|
|
87
111
|
};
|
|
88
112
|
|
|
89
113
|
const BOLD_DENSITY_RULE = "bold-density";
|
|
@@ -190,16 +214,29 @@ const notRunOf = (input: PlanInput, signalRules: ReadonlySet<string>): Skipped[]
|
|
|
190
214
|
return input.skipped.filter((skipped) => watched.has(skipped.rule));
|
|
191
215
|
};
|
|
192
216
|
|
|
193
|
-
/** The
|
|
217
|
+
/** The bundled judgement checks for the AI-likeness tells only a reader can see (packages/chaff/checks/). */
|
|
218
|
+
export const AI_TELLS_CHECKS = "ai-tells";
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The commands to run on the rewrite. A rewrite past light cuts repeats and rebuilds headings, which compare is told.
|
|
222
|
+
* With --all-ai-signs the first is the same plan for the rewrite, set against the original, and the last sends the
|
|
223
|
+
* judgement tells (shown with --dry-run first: the passages would leave the machine).
|
|
224
|
+
*/
|
|
194
225
|
const checksOf = (input: PlanInput, choice: ModeChoice): string[] => {
|
|
195
226
|
const original = shellPath(input.path);
|
|
196
227
|
const rewritten = shellPath(rewrittenPathOf(input.path));
|
|
197
|
-
const
|
|
228
|
+
const genreFlags = input.genreFlag === undefined ? [] : ["--genre", input.genreFlag];
|
|
229
|
+
const lintFlags = [...(input.experimental ? ["--experimental"] : []), ...genreFlags];
|
|
198
230
|
const compareFlags = choice.depth !== undefined && choice.depth !== "light" ? ["--distinct", "--allow-dropped heading", "--allow-added heading"] : [];
|
|
231
|
+
const first =
|
|
232
|
+
input.allSigns === undefined
|
|
233
|
+
? ["npx chaffjs", rewritten, ...lintFlags]
|
|
234
|
+
: ["npx chaffjs fix-plan", rewritten, "--all-ai-signs --before", original, ...lintFlags, "--json"];
|
|
199
235
|
return [
|
|
200
|
-
|
|
236
|
+
first.join(" "),
|
|
201
237
|
["npx chaffjs compare", original, rewritten, ...compareFlags].join(" "),
|
|
202
238
|
["npx chaffjs outline", original, rewritten].join(" "),
|
|
239
|
+
...(input.allSigns === undefined ? [] : [["npx chaffjs test", rewritten, "--checks", AI_TELLS_CHECKS, ...genreFlags, "--dry-run"].join(" ")]),
|
|
203
240
|
];
|
|
204
241
|
};
|
|
205
242
|
|
|
@@ -209,6 +246,12 @@ const structureLimitOf = (rules: readonly RuleDefinition[]): number =>
|
|
|
209
246
|
|
|
210
247
|
const documentLength = (outline: Outline): number => outline.entries.reduce((sum, entry) => sum + entry.length, 0);
|
|
211
248
|
|
|
249
|
+
/** The AI-likeness rules with a finding, the composite included; none without --all-ai-signs. */
|
|
250
|
+
const aiRulesFired = (input: PlanInput): string[] => {
|
|
251
|
+
const ids = input.allSigns?.ruleIds;
|
|
252
|
+
return ids === undefined ? [] : [...new Set(input.findings.map((finding) => finding.rule))].filter((rule) => ids.has(rule));
|
|
253
|
+
};
|
|
254
|
+
|
|
212
255
|
/** The plan for one document: deterministic, from chaff's findings, the rule files and the human baseline alone. */
|
|
213
256
|
export const buildFixPlan = (input: PlanInput): FixPlan => {
|
|
214
257
|
const signalRules = signalRulesOf(input.rules);
|
|
@@ -226,6 +269,10 @@ export const buildFixPlan = (input: PlanInput): FixPlan => {
|
|
|
226
269
|
genre: input.genre,
|
|
227
270
|
guide: input.guide ?? null,
|
|
228
271
|
experimental: input.experimental,
|
|
272
|
+
allSigns: input.allSigns !== undefined,
|
|
273
|
+
aiScore: input.allSigns?.aiScore ?? null,
|
|
274
|
+
aiRules: aiRulesFired(input),
|
|
275
|
+
since: input.since ?? null,
|
|
229
276
|
mode,
|
|
230
277
|
chosenDepth: input.chosenDepth,
|
|
231
278
|
signals: signalsOf(input, signalRules),
|
package/src/fix-plan/render.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { RewritePair } from "../rule-guide.ts";
|
|
|
2
2
|
import { shapeMeasures } from "../outline/render.ts";
|
|
3
3
|
import { OUTLINE_TEXT } from "../outline/text.ts";
|
|
4
4
|
import { uiLanguageOf } from "../ui.ts";
|
|
5
|
-
import type { FixPlan, PhraseHint, PlanSpot, RulePlan } from "./plan.ts";
|
|
5
|
+
import type { AiScoreSummary, FixPlan, PhraseHint, PlanSpot, RulePlan } from "./plan.ts";
|
|
6
6
|
import { FIX_PLAN_TEXT, type FixPlanText } from "./text.ts";
|
|
7
7
|
import { STRUCTURE_TARGET_TEXT } from "./structure-target-text.ts";
|
|
8
8
|
import { DEFAULT_DEPTH, depthMeaning } from "../rewrite-depth.ts";
|
|
@@ -137,6 +137,40 @@ const guideLines = (plan: FixPlan, text: FixPlanText): string[] => {
|
|
|
137
137
|
return [`## ${text.guideHeading(guide.name, guide.genre)}`, "", text.guideLead, "", ...bullets(guide.lines), ...rules, ""];
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
const scoreText = (score: AiScoreSummary, text: FixPlanText): string =>
|
|
141
|
+
score.level === null ? text.notScoredLine(score.notScored ?? "") : text.aiScoreLine(score.level, score.signs, score.compared, score.shown.join(", "));
|
|
142
|
+
|
|
143
|
+
/** The score's level, or the reason it has none, for the before → after line. */
|
|
144
|
+
const levelText = (score: AiScoreSummary | null): string => score?.level ?? score?.notScored ?? "-";
|
|
145
|
+
|
|
146
|
+
const aiScoreLines = (plan: FixPlan, text: FixPlanText): string[] =>
|
|
147
|
+
plan.aiScore === null
|
|
148
|
+
? []
|
|
149
|
+
: [
|
|
150
|
+
"",
|
|
151
|
+
`## ${text.aiScoreHeading}`,
|
|
152
|
+
"",
|
|
153
|
+
...bullets([scoreText(plan.aiScore, text), text.aiRulesLine(plan.aiRules.map((rule) => `\`${rule}\``).join(", "))]),
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
/** What the rewrite changed against --before's original: the score before and after, and every rule whose findings rose. */
|
|
157
|
+
const sinceLines = (plan: FixPlan, text: FixPlanText): string[] => {
|
|
158
|
+
const { since } = plan;
|
|
159
|
+
if (since === null) return [];
|
|
160
|
+
const score = plan.aiScore === null ? [] : [text.sinceScore(levelText(since.aiScore), levelText(plan.aiScore)), ""];
|
|
161
|
+
const risen =
|
|
162
|
+
since.risen.length === 0
|
|
163
|
+
? [text.noneRisen]
|
|
164
|
+
: [text.risenLead, "", ...bullets(since.risen.map((rule) => `\`${rule.rule}\`: ${text.risenLine(rule.before, rule.after)}`))];
|
|
165
|
+
return ["", `## ${text.sinceHeading(since.path)}`, "", ...score, ...risen];
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const stopLines = (plan: FixPlan, text: FixPlanText): string[] => (plan.allSigns ? ["", `## ${text.stopHeading}`, "", ...bullets(text.stopLines)] : []);
|
|
169
|
+
|
|
170
|
+
/** The constraints; with --all-ai-signs the last one loops to the stop conditions instead of stopping at two passes. */
|
|
171
|
+
const constraintsOf = (plan: FixPlan, text: FixPlanText): readonly string[] =>
|
|
172
|
+
plan.allSigns ? [...text.constraints.slice(0, -1), text.loopConstraint] : text.constraints;
|
|
173
|
+
|
|
140
174
|
const textOf = (plan: FixPlan): FixPlanText => FIX_PLAN_TEXT[uiLanguageOf(plan.language)];
|
|
141
175
|
|
|
142
176
|
/** The plan as Markdown, in the document's language: what an agent reads before rewriting. */
|
|
@@ -152,15 +186,18 @@ export const renderFixPlanMarkdown = (plan: FixPlan): string => {
|
|
|
152
186
|
...guideLines(plan, text),
|
|
153
187
|
`## ${text.constraintsHeading}`,
|
|
154
188
|
"",
|
|
155
|
-
...text.
|
|
189
|
+
...constraintsOf(plan, text).map((constraint, index) => `${String(index + 1)}. ${constraint}`),
|
|
156
190
|
...modeLines(plan, text),
|
|
157
191
|
...signalLines(plan, text),
|
|
192
|
+
...aiScoreLines(plan, text),
|
|
193
|
+
...sinceLines(plan, text),
|
|
158
194
|
...structureLines(plan),
|
|
159
195
|
...(plan.rules.length === 0 ? [] : ["", `## ${text.rulesHeading}`]),
|
|
160
196
|
...plan.rules.flatMap((rule) => rulePlanLines(rule, text, plan.language)),
|
|
161
197
|
...deeperLines(plan, text),
|
|
162
198
|
...notRunLines(plan, text),
|
|
163
199
|
...checkLines(plan, text),
|
|
200
|
+
...stopLines(plan, text),
|
|
164
201
|
].join("\n");
|
|
165
202
|
};
|
|
166
203
|
|
|
@@ -170,8 +207,9 @@ export const renderFixPlanJson = (plan: FixPlan): string => {
|
|
|
170
207
|
return JSON.stringify(
|
|
171
208
|
{
|
|
172
209
|
...plan,
|
|
173
|
-
constraints: text
|
|
210
|
+
constraints: constraintsOf(plan, text),
|
|
174
211
|
mode: { ...plan.mode, name: text.modeName[plan.mode.mode], why: text.modeReason[plan.mode.reason] },
|
|
212
|
+
...(plan.allSigns ? { stop: text.stopLines } : {}),
|
|
175
213
|
},
|
|
176
214
|
null,
|
|
177
215
|
2,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Finding } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** A rule with more findings in the rewrite than in the original: what the rewrite brought in. */
|
|
4
|
+
export type RisenRule = { readonly rule: string; readonly before: number; readonly after: number };
|
|
5
|
+
|
|
6
|
+
const countsOf = (findings: readonly Pick<Finding, "rule">[]): Map<string, number> =>
|
|
7
|
+
findings.reduce((counts, finding) => counts.set(finding.rule, (counts.get(finding.rule) ?? 0) + 1), new Map<string, number>());
|
|
8
|
+
|
|
9
|
+
/** Every rule whose findings rose from the original to the rewrite, in the order the rewrite's findings name them. */
|
|
10
|
+
export const risenRules = (before: readonly Pick<Finding, "rule">[], after: readonly Pick<Finding, "rule">[]): RisenRule[] => {
|
|
11
|
+
const was = countsOf(before);
|
|
12
|
+
return [...countsOf(after)].map(([rule, count]) => ({ rule, before: was.get(rule) ?? 0, after: count })).filter((entry) => entry.after > entry.before);
|
|
13
|
+
};
|
package/src/fix-plan/text.ts
CHANGED
|
@@ -43,11 +43,27 @@ export type FixPlanText = {
|
|
|
43
43
|
readonly checksHeading: string;
|
|
44
44
|
readonly saveAs: (path: string) => string;
|
|
45
45
|
readonly checksNote: string;
|
|
46
|
+
/** With --all-ai-signs: the last constraint, which loops to the stop conditions instead of stopping at two passes. */
|
|
47
|
+
readonly loopConstraint: string;
|
|
48
|
+
readonly aiScoreHeading: string;
|
|
49
|
+
/** The score in one line: the level, or why there is none, then the signs that showed. */
|
|
50
|
+
readonly aiScoreLine: (level: string, signs: number, compared: number, shown: string) => string;
|
|
51
|
+
readonly notScoredLine: (reason: string) => string;
|
|
52
|
+
/** The AI-likeness rules with a finding, as a list; empty when none is left. */
|
|
53
|
+
readonly aiRulesLine: (rules: string) => string;
|
|
54
|
+
readonly sinceHeading: (path: string) => string;
|
|
55
|
+
readonly sinceScore: (before: string, after: string) => string;
|
|
56
|
+
readonly risenLead: string;
|
|
57
|
+
readonly risenLine: (before: number, after: number) => string;
|
|
58
|
+
readonly noneRisen: string;
|
|
59
|
+
readonly stopHeading: string;
|
|
60
|
+
readonly stopLines: readonly string[];
|
|
46
61
|
};
|
|
47
62
|
|
|
48
63
|
export const FIX_PLAN_TEXT: Texts<FixPlanText> = {
|
|
49
64
|
ja: {
|
|
50
|
-
usage:
|
|
65
|
+
usage:
|
|
66
|
+
"使い方: chaff fix-plan <file> [--depth light|structure|register] [--all-ai-signs] [--before <元の文書>] [--experimental] [--genre <ジャンル>] [--no-guide] [--json]",
|
|
51
67
|
notFound: (path) => `${path} がありません。`,
|
|
52
68
|
title: (path) => `直す計画: ${path}`,
|
|
53
69
|
about: (language, genre) => `言語 ${language}、ジャンル ${genre}`,
|
|
@@ -114,9 +130,28 @@ export const FIX_PLAN_TEXT: Texts<FixPlanText> = {
|
|
|
114
130
|
saveAs: (path) => `書き直したものを ${path} に保存して、次を実行します。`,
|
|
115
131
|
checksNote:
|
|
116
132
|
"1 つめは書き直した文書の指摘、2 つめは事実が落ちていないか・足されていないか、3 つめは構成の変化です。数は chaff の出力から取り、形容詞で言わないでください。",
|
|
133
|
+
loopConstraint: "下の「止めるとき」がすべて満たされるまで、書き直しと確かめを繰り返す(3 回まで)。3 回で残ったものは、残した理由と一緒に書き出す。",
|
|
134
|
+
aiScoreHeading: "AI らしさの点",
|
|
135
|
+
aiScoreLine: (level, signs, compared, shown) => `${level}(目印 ${String(signs)} / ${String(compared)})${shown === "" ? "" : ": " + shown}`,
|
|
136
|
+
notScoredLine: (reason) => `点は付きません(${reason})。ルールの指摘だけで判断します。`,
|
|
137
|
+
aiRulesLine: (rules) => (rules === "" ? "指摘の残る AI らしさのルール: なし" : `指摘の残る AI らしさのルール: ${rules}`),
|
|
138
|
+
sinceHeading: (path) => `元の文書 ${path} と比べて`,
|
|
139
|
+
sinceScore: (before, after) => `AI らしさの点: ${before} → ${after}`,
|
|
140
|
+
risenLead: "書き直しで指摘が増えたルール(AI らしさ以外も含む):",
|
|
141
|
+
risenLine: (before, after) => `${String(before)} → ${String(after)} 件`,
|
|
142
|
+
noneRisen: "指摘が増えたルールはありません。",
|
|
143
|
+
stopHeading: "止めるとき",
|
|
144
|
+
stopLines: [
|
|
145
|
+
"AI らしさのルールの指摘が一つも残っていない(この計画の「ルールごとの直し方」に AI らしさのルールが無い)。",
|
|
146
|
+
"AI らしさの点が low、または文書が短くて点が付かない。",
|
|
147
|
+
"元の文書より指摘が増えたルールが無い(--before で比べた「元の文書と比べて」が空)。",
|
|
148
|
+
"chaff compare が通る。除いた種類には理由がある。",
|
|
149
|
+
"chaff test --checks ai-tells が送る(--dry-run では送るはずの)箇所を読み、どの問いにも当てはまらない。",
|
|
150
|
+
],
|
|
117
151
|
},
|
|
118
152
|
en: {
|
|
119
|
-
usage:
|
|
153
|
+
usage:
|
|
154
|
+
"usage: chaff fix-plan <file> [--depth light|structure|register] [--all-ai-signs] [--before <original>] [--experimental] [--genre <genre>] [--no-guide] [--json]",
|
|
120
155
|
notFound: (path) => `${path} does not exist.`,
|
|
121
156
|
title: (path) => `Fix plan: ${path}`,
|
|
122
157
|
about: (language, genre) => `language ${language}, genre ${genre}`,
|
|
@@ -179,5 +214,24 @@ export const FIX_PLAN_TEXT: Texts<FixPlanText> = {
|
|
|
179
214
|
saveAs: (path) => `Save the rewrite as ${path} and run:`,
|
|
180
215
|
checksNote:
|
|
181
216
|
"The first lists the rewrite's findings, the second checks that no fact was dropped or added, the third shows how the outline moved. Take the numbers from chaff's output, not adjectives.",
|
|
217
|
+
loopConstraint:
|
|
218
|
+
'Rewrite and check again until every line of "When to stop" below holds, at most three passes. List what is left after the third, with the reason it stays.',
|
|
219
|
+
aiScoreHeading: "AI-likeness score",
|
|
220
|
+
aiScoreLine: (level, signs, compared, shown) => `${level} (${String(signs)} of ${String(compared)} signs)${shown === "" ? "" : ": " + shown}`,
|
|
221
|
+
notScoredLine: (reason) => `Not scored (${reason}). The rules' findings decide alone.`,
|
|
222
|
+
aiRulesLine: (rules) => (rules === "" ? "AI-likeness rules with findings left: none" : `AI-likeness rules with findings left: ${rules}`),
|
|
223
|
+
sinceHeading: (path) => `Against the original, ${path}`,
|
|
224
|
+
sinceScore: (before, after) => `AI-likeness score: ${before} → ${after}`,
|
|
225
|
+
risenLead: "Rules with more findings after the rewrite (any rule, not only AI-likeness):",
|
|
226
|
+
risenLine: (before, after) => `${String(before)} → ${String(after)}`,
|
|
227
|
+
noneRisen: "No rule has more findings than in the original.",
|
|
228
|
+
stopHeading: "When to stop",
|
|
229
|
+
stopLines: [
|
|
230
|
+
'No AI-likeness rule has a finding left ("How to rewrite, rule by rule" lists none of them).',
|
|
231
|
+
"The AI-likeness score is low, or the document is too short to score.",
|
|
232
|
+
'No rule has more findings than in the original ("Against the original", from --before, lists none).',
|
|
233
|
+
"chaff compare passes, and every kind left out has a reason.",
|
|
234
|
+
"You have read the passages chaff test --checks ai-tells sends (or would send, with --dry-run), and none of its questions fits them.",
|
|
235
|
+
],
|
|
182
236
|
},
|
|
183
237
|
};
|