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
package/src/detectors/signals.ts
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import { proseText } from "../measure.ts";
|
|
2
2
|
import { dateSpans, wordsOf } from "./structure.ts";
|
|
3
|
-
import { compacted, linkedIn, placeAt } from "./gram-place.ts";
|
|
4
|
-
import { charWindows, wordWindows } from "./gram-windows.ts";
|
|
5
|
-
import { fixedEndingSpans, furnitureMask, isFurniture } from "./gram-furniture.ts";
|
|
6
3
|
import { lexiconNotationOf, sourceNotAcronymSpans, unreportedAcronymSpans, type NotAcronymSpans } from "./acronym-context.ts";
|
|
4
|
+
import { titledCodeSpans } from "./titled-code-citation.ts";
|
|
7
5
|
import { abbreviates, expansionAt, termEntryAcronyms, type DefinitionWords, type ExpandedAt } from "./acronym-expansion.ts";
|
|
8
6
|
import { isExplained } from "./acronym-compound.ts";
|
|
9
7
|
import { statedAcronyms } from "./acronym-definition.ts";
|
|
10
8
|
import { isBracketed, isInHeading, isNamePart } from "./acronym-lone.ts";
|
|
11
9
|
import { linkedListTerms } from "./acronym-link.ts";
|
|
12
|
-
import { caseVariantsIn, spelledOutAcronyms } from "./acronym-mention.ts";
|
|
10
|
+
import { caseVariantsIn, spelledOutAcronyms, writtenAsWordIn } from "./acronym-mention.ts";
|
|
13
11
|
import { conjugatedForms } from "./conjugated-form.ts";
|
|
14
|
-
import { evidenceSpans, hasNumeral, isClaim, isLabelOnly, startsWithin, type AdviceWords } from "./concrete-evidence.ts";
|
|
15
|
-
import { letteredIndexEntries } from "./lettered-index.ts";
|
|
16
12
|
import { knownByDocument } from "./acronym-known.ts";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { nameSpans, touchesAny } from "../team-names.ts";
|
|
22
|
-
import { DASH, introducesList } from "./lead-in-dash.ts";
|
|
23
|
-
import type { Detector, Finding, ProseDocument, Section, Sentence } from "../plugin.ts";
|
|
13
|
+
import { explainedInText, headingsSpellingOut } from "./acronym-gloss.ts";
|
|
14
|
+
import { nameSpans } from "../team-names.ts";
|
|
15
|
+
import { DASH, introducesList, opensLine } from "./lead-in-dash.ts";
|
|
16
|
+
import type { Detector, Finding, ProseDocument, Sentence } from "../plugin.ts";
|
|
24
17
|
|
|
25
18
|
const PER = 1000;
|
|
26
19
|
|
|
@@ -65,121 +58,6 @@ export const emojiDensity: Detector = (doc, options): Finding[] => {
|
|
|
65
58
|
];
|
|
66
59
|
};
|
|
67
60
|
|
|
68
|
-
/**
|
|
69
|
-
* 同じ言い回しの繰り返し。文字の並びで見るので、adapter の語の区切り(wordSplit)が要らない。英語の窓は空白で語の切れ目にそろえる。
|
|
70
|
-
* spec §10 が n-gram を選んだのはこのためで、新しい言語でそのまま動く。
|
|
71
|
-
*/
|
|
72
|
-
/**
|
|
73
|
-
* 窓の幅は単位で分ける。同じ 8 文字でも、日本語では 4〜5 形態素だが英語では 1 語半にしかならない。
|
|
74
|
-
* 英語の窓は語の切れ目にそろえ、18 文字に届くまで語を足す。文字で切ると " generat" のような語の断片が上位に来る。
|
|
75
|
-
* 18 は、文字で切っていた頃の 20 文字の窓から前後の空白を除いた長さ(" juxtaposed to said ")。
|
|
76
|
-
*/
|
|
77
|
-
const GRAM = { char: 8, word: 18 };
|
|
78
|
-
|
|
79
|
-
const windowsOf = (text: string, unit: ProseDocument["lengthUnit"]): Span[] => (unit === "char" ? charWindows(text, GRAM.char) : wordWindows(text, GRAM.word));
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* 名前ではなく言い回しだけを数える。実文書で測ったら、上位は
|
|
83
|
-
* 「AGENTS.m」「シンギュラリティ」のような固有名詞と識別子だった。名前は繰り返して当たり前。
|
|
84
|
-
*
|
|
85
|
-
* 言い回しは、その言語の「つなぎの материал」を含む。日本語ならひらがな、英語なら語の切れ目。
|
|
86
|
-
* どちらを見るかは adapter が宣言する単位で決める。ひらがなを持たない char 単位の言語が
|
|
87
|
-
* 来たら、この見分けは効かなくなる(そのときは adapter 側に判定を移す)。
|
|
88
|
-
*/
|
|
89
|
-
/**
|
|
90
|
-
* つなぎが 1 つでは足りない。「detectorは」は用語に助詞が 1 つ付いただけで、
|
|
91
|
-
* 繰り返して当たり前の**用語**であって言い回しではない。
|
|
92
|
-
* 実文書で測ると、本物の言い回しはひらがなを 7 つ前後含み、用語+助詞は 1〜2 だった。
|
|
93
|
-
*/
|
|
94
|
-
const CONNECTIVE = { char: /[ぁ-ゖ].*[ぁ-ゖ].*[ぁ-ゖ]/u, word: /\S \S.*\S \S/u };
|
|
95
|
-
|
|
96
|
-
const isPhrasing = (gram: string, unit: ProseDocument["lengthUnit"]): boolean => CONNECTIVE[unit].test(gram);
|
|
97
|
-
|
|
98
|
-
/** 語句が最初に数えられた所。書かれたままの語句と、文と、文の中の範囲(sentence.text の位置)。 */
|
|
99
|
-
type FirstSeen = { readonly gram: string; readonly sentence: Sentence; readonly place: Span };
|
|
100
|
-
|
|
101
|
-
type Tally = { readonly counts: Map<string, number>; readonly first: Map<string, FirstSeen> };
|
|
102
|
-
|
|
103
|
-
/** 英語は大文字と小文字を区別せずに数える。文頭の "Proposals submitted via" も文中の "proposals submitted via" も同じ言い回し。 */
|
|
104
|
-
const keyOf = (gram: string, unit: ProseDocument["lengthUnit"]): string => (unit === "word" ? gram.toLowerCase() : gram);
|
|
105
|
-
|
|
106
|
-
const namesOf = (doc: ProseDocument): readonly string[] =>
|
|
107
|
-
doc.lengthUnit === "char" ? (doc.names ?? []).map((name) => name.replace(/\s+/gu, "")) : (doc.names ?? []);
|
|
108
|
-
|
|
109
|
-
/** 語彙表 ngram-fixed-ending: 項目ごとに同じ形で結ぶ書式の結び(〜ものとすること。)。 */
|
|
110
|
-
const fixedEndingsOf = (doc: ProseDocument): string[] => (doc.lexicons["ngram-fixed-ending"] ?? []).map((entry) => entry.pattern);
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 文をまたいで数えない。文の終わりと次の文の始まりが繋がると、固有名詞が言い回しに見える。
|
|
114
|
-
* 並べた名前にかかる語句も数えない。名前が繰り返されれば、その前後(「the …」)も一緒に繰り返されるのは当たり前。
|
|
115
|
-
* 一覧の飾り(gram-furniture.ts)も数えない。項目ごとに繰り返すのはひな形で、書き手ではない。
|
|
116
|
-
*/
|
|
117
|
-
const tallySentence = (doc: ProseDocument, sentence: Sentence, tally: Tally): void => {
|
|
118
|
-
const source = compacted(sentence.text, doc.lengthUnit);
|
|
119
|
-
const named = nameSpans(source.text, namesOf(doc));
|
|
120
|
-
const mask = furnitureMask(source.text, linkedIn(doc, sentence, source));
|
|
121
|
-
fixedEndingSpans(source.text, fixedEndingsOf(doc)).forEach((span) => mask.fill(true, span.start, span.end));
|
|
122
|
-
windowsOf(source.text, doc.lengthUnit)
|
|
123
|
-
.filter((window) => !touchesAny(named, window.start, window.end) && !isFurniture(source.text, mask, window))
|
|
124
|
-
.forEach((window) => {
|
|
125
|
-
const gram = source.text.slice(window.start, window.end);
|
|
126
|
-
const key = keyOf(gram, doc.lengthUnit);
|
|
127
|
-
tally.counts.set(key, (tally.counts.get(key) ?? 0) + 1);
|
|
128
|
-
const place = placeAt(source, window);
|
|
129
|
-
if (!tally.first.has(key) && place !== undefined) tally.first.set(key, { gram, sentence, place });
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const gramsOf = (doc: ProseDocument, sentences: readonly Sentence[]): Tally => {
|
|
134
|
-
const tally: Tally = { counts: new Map(), first: new Map() };
|
|
135
|
-
sentences.forEach((sentence) => tallySentence(doc, sentence, tally));
|
|
136
|
-
return tally;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
type Repeat = { readonly key: string; readonly count: number; readonly at: FirstSeen | undefined };
|
|
140
|
-
|
|
141
|
-
/** 範囲(gram-passages.ts)ごとに数える。よくある質問の別々の答えは別の範囲。節の最初の文にだけ出るものは節のひな形(gram-openers.ts)。 */
|
|
142
|
-
const repeatsOf = (doc: ProseDocument, limit: number, openers = sectionOpeners(doc.sections, doc.source)): Repeat[] =>
|
|
143
|
-
gramPassagesOf(doc.sections).flatMap((sentences) => {
|
|
144
|
-
const tally = gramsOf(doc, sentences);
|
|
145
|
-
const opening = gramsOf(
|
|
146
|
-
doc,
|
|
147
|
-
sentences.filter((sentence) => openers.has(sentence)),
|
|
148
|
-
).counts;
|
|
149
|
-
return [...tally.counts.entries()]
|
|
150
|
-
.filter(([key, count]) => count > limit && isPhrasing(key, doc.lengthUnit) && (opening.get(key) ?? 0) < count)
|
|
151
|
-
.map(([key, count]) => ({ key, count, at: tally.first.get(key) }));
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* 語句が文の中で占める範囲に、述語になる動詞か助動詞があるか(gram-predicate.ts)。
|
|
156
|
-
* 品詞が無ければ見分けられないので、これまでどおり言い回しとして数える。
|
|
157
|
-
*/
|
|
158
|
-
const hasPredicate = (at: FirstSeen | undefined, unit: ProseDocument["lengthUnit"]): boolean => {
|
|
159
|
-
if (at?.sentence.tokens === undefined) return true;
|
|
160
|
-
const start = at.sentence.span.start;
|
|
161
|
-
return hasPredicateIn(at.sentence.tokens, { start: start + at.place.start, end: start + at.place.end }, unit);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const ngramRepetition: Detector = (doc, options): Finding[] => {
|
|
165
|
-
if (wordsOf(doc) < MIN_DOCUMENT_LENGTH[doc.lengthUnit]) return [];
|
|
166
|
-
const worst = repeatsOf(doc, options.limit)
|
|
167
|
-
.toSorted((left, right) => right.count - left.count)
|
|
168
|
-
.find(({ at }) => hasPredicate(at, doc.lengthUnit));
|
|
169
|
-
if (worst === undefined) return [];
|
|
170
|
-
const at = worst.at?.sentence;
|
|
171
|
-
return [
|
|
172
|
-
{
|
|
173
|
-
rule: "ngram-repetition",
|
|
174
|
-
severity: "info",
|
|
175
|
-
line: 0,
|
|
176
|
-
column: 0,
|
|
177
|
-
quote: at?.text.trim() ?? worst.key,
|
|
178
|
-
values: { word: worst.at?.gram ?? worst.key, count: worst.count, limit: options.limit, offset: at?.span.start ?? 0 },
|
|
179
|
-
},
|
|
180
|
-
];
|
|
181
|
-
};
|
|
182
|
-
|
|
183
61
|
/**
|
|
184
62
|
* 略語が初出で展開されているか。「CI」だけでは、読む人によって指すものが違う。
|
|
185
63
|
* 展開は「略語の直前か直後の括弧」か「括弧の中の略語」で書かれる。
|
|
@@ -326,12 +204,12 @@ const isNamePartAt = (acronym: string, hit: Hit): boolean => {
|
|
|
326
204
|
*/
|
|
327
205
|
export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
328
206
|
const body = bodyOf(doc);
|
|
329
|
-
// HTTP のメソッド名(GET)は略語ではなく、税の名前(VAT、GST)は読み手が名前として知るので、通じる略語と同じく展開を求めない。
|
|
207
|
+
// HTTP のメソッド名(GET)と SQL のキーワード(VIEW)は略語ではなく、税の名前(VAT、GST)は読み手が名前として知るので、通じる略語と同じく展開を求めない。
|
|
330
208
|
// 並べた名前(JAXA)も、繋いだ略語(JAXA-ISAS)の片割れとして説明済みに数える。
|
|
331
209
|
// 文書が自分で知らせた語(select を書いた文書の SELECT、リンクで引いた講演の場 [Jane Roe, FOSDEM 2024](…))も同じ。
|
|
332
210
|
const common = new Set([
|
|
333
211
|
...(options.lexicon ?? []).map((entry) => entry.pattern),
|
|
334
|
-
...knownByDocument(doc.source, doc.links).concat(patternsOf(doc, "http-method"), patternsOf(doc, "tax-code")),
|
|
212
|
+
...knownByDocument(doc.source, doc.links).concat(patternsOf(doc, "http-method"), patternsOf(doc, "sql-keyword"), patternsOf(doc, "tax-code")),
|
|
335
213
|
...(doc.names ?? []),
|
|
336
214
|
]);
|
|
337
215
|
const expandedAt = expansionAt(definitionWordsOf(doc));
|
|
@@ -342,8 +220,9 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
|
342
220
|
doc.sentences.map((sentence) => sentence.text),
|
|
343
221
|
patternsOf(doc, "abbreviation-mention"),
|
|
344
222
|
);
|
|
345
|
-
// 略語のすぐ後ろのダッシュで挟んだ同格(the VIX—a measure of
|
|
346
|
-
|
|
223
|
+
// 略語のすぐ後ろのダッシュで挟んだ同格(the VIX—a measure of …—)、同じ文の前に書いた名前(Small Business Administration … SBA)、
|
|
224
|
+
// 2 つ以上の番号で引く続き物の名前(BCP 78、BCP 14)も、略語の説明と読む。
|
|
225
|
+
const entries = new Set([...termEntryAcronyms(doc.source), ...stated, ...linkedListTerms(doc.source), ...spelled, ...explainedInText(body, doc.sentences)]);
|
|
347
226
|
const headings = doc.sections.map((section) => section.heading);
|
|
348
227
|
// 見出しが略語の名前を書き出していれば(## Federal Open Market Committee の下の FOMC)、説明済み。
|
|
349
228
|
const spelledInHeading = headingsSpellingOut(headings);
|
|
@@ -354,16 +233,19 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
|
354
233
|
isExpanded(body, word, expandedAt) ||
|
|
355
234
|
headings.some((heading) => expandsInHeading(heading, word, expandedAt));
|
|
356
235
|
// 大文字の違うだけの書き方(TCoP と TCOP)は同じ略語と読む。どちらかで説明してあれば説明済み。
|
|
236
|
+
// 文の中で頭だけ大文字の語に書いた名前(a hotel / Airbnb)を大文字で書いた AIRBNB は、語を大きく書いただけで略語ではない。
|
|
237
|
+
const wholeText = [body, ...headings].join("\n");
|
|
357
238
|
const explained = new Map<string, boolean>();
|
|
358
239
|
const explainedAlone = (word: string): boolean => {
|
|
359
|
-
const known =
|
|
240
|
+
const known =
|
|
241
|
+
explained.get(word) ?? (explainedAsWritten(word) || writtenAsWordIn(wholeText, word) || caseVariantsIn(wholeText, word).some(explainedAsWritten));
|
|
360
242
|
explained.set(word, known);
|
|
361
243
|
return known;
|
|
362
244
|
};
|
|
363
|
-
const counted = outsideSpans(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
);
|
|
245
|
+
const counted = outsideSpans(acronymsOf(doc, notationOf(doc)), [
|
|
246
|
+
...sourceNotAcronymSpans(doc.source, (id) => patternsOf(doc, id)),
|
|
247
|
+
...titledCodeSpans(doc.source, patternsOf(doc, "citation-series")),
|
|
248
|
+
]);
|
|
367
249
|
const hits = outsideSpans(
|
|
368
250
|
counted,
|
|
369
251
|
unreportedAcronymSpans(doc.source, doc.sentences, doc.links, (id) => patternsOf(doc, id)),
|
|
@@ -384,76 +266,12 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
|
384
266
|
return alone.map(([acronym, hit]) => acronymFinding(acronym, hit, alone.length, options.limit));
|
|
385
267
|
};
|
|
386
268
|
|
|
387
|
-
/**
|
|
388
|
-
* 具体物の密度。数値・コード・リンク・引用が 1 つも無い節は、
|
|
389
|
-
* 読み終えても何も持ち帰れない。**少ないほうを指摘する**ので、他の密度 rule と向きが逆。
|
|
390
|
-
*/
|
|
391
|
-
const CONCRETE = /\d|`|https?:\/\//u;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* 見出しのない導入部は、書き出しで呼ぶ。文書の言葉なので、message がどの言語でも混ざらない。
|
|
395
|
-
* 決まった呼び名(「この節」)を置くと、英語の文書の message に日本語が入る。
|
|
396
|
-
*/
|
|
397
|
-
const OPENING = { word: 4, char: 12 };
|
|
398
|
-
|
|
399
|
-
const openingOf = (sentence: Sentence | undefined, unit: ProseDocument["lengthUnit"]): string => {
|
|
400
|
-
const text = sentence === undefined ? "" : proseText(sentence);
|
|
401
|
-
const pieces = unit === "word" ? text.split(" ") : Array.from(text);
|
|
402
|
-
const joiner = unit === "word" ? " " : "";
|
|
403
|
-
return pieces.length <= OPENING[unit] ? pieces.join(joiner) : `${pieces.slice(0, OPENING[unit]).join(joiner)}…`;
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
const hasNumeralIn = (section: Section): boolean => section.sentences.some((sentence) => hasNumeral(sentence.tokens ?? []));
|
|
407
|
-
|
|
408
|
-
/** これより短い節は、具体物があるべきか判断できない。 */
|
|
409
|
-
const MIN_SENTENCES = 3;
|
|
410
|
-
|
|
411
|
-
const adviceWordsOf = (doc: ProseDocument): AdviceWords => ({
|
|
412
|
-
openers: (doc.lexicons["advice-opener"] ?? []).map((entry) => entry.pattern),
|
|
413
|
-
endings: (doc.lexicons["advice-ending"] ?? []).map((entry) => entry.pattern),
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
/** 文の半分以上が問いか指示の節(質問の一覧、手引き)は、数字で裏づける主張をしていない。番号だけの文(a.)は数えない。 */
|
|
417
|
-
const mostlyClaims = (section: Section, language: string, advice: AdviceWords): boolean => {
|
|
418
|
-
const said = section.sentences.filter((sentence) => !isLabelOnly(sentence));
|
|
419
|
-
return said.filter((sentence) => isClaim(sentence, language, advice)).length * 2 > said.length;
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
export const concreteEvidence: Detector = (doc, options): Finding[] => {
|
|
423
|
-
const entries = letteredIndexEntries(doc.sections);
|
|
424
|
-
const advice = adviceWordsOf(doc);
|
|
425
|
-
const sections = doc.sections.filter(
|
|
426
|
-
(section) => section.sentences.length >= MIN_SENTENCES && !entries.has(section) && mostlyClaims(section, doc.language, advice),
|
|
427
|
-
);
|
|
428
|
-
const bare = sections.filter(
|
|
429
|
-
(section) => !CONCRETE.test(doc.source.slice(section.span.start, section.span.end)) && !hasNumeralIn(section) && !startsWithin(section.span, doc.links),
|
|
430
|
-
);
|
|
431
|
-
// 構造の木は作るのに手間がかかる。指摘に届かない文書では作らない。
|
|
432
|
-
const nodes = bare.length < options.limit ? [] : evidenceSpans(doc.structure);
|
|
433
|
-
const empty = bare.filter((section) => !startsWithin(section.span, nodes));
|
|
434
|
-
if (empty.length < options.limit) return [];
|
|
435
|
-
return empty.map((section) => ({
|
|
436
|
-
rule: "concrete-evidence-density",
|
|
437
|
-
severity: "info",
|
|
438
|
-
line: 0,
|
|
439
|
-
column: 0,
|
|
440
|
-
quote: section.heading.length > 0 ? section.heading : (section.sentences[0]?.text.trim() ?? ""),
|
|
441
|
-
values: {
|
|
442
|
-
word: section.heading.length > 0 ? section.heading : openingOf(section.sentences[0], doc.lengthUnit),
|
|
443
|
-
count: empty.length,
|
|
444
|
-
total: sections.length,
|
|
445
|
-
limit: options.limit,
|
|
446
|
-
offset: section.span.start,
|
|
447
|
-
},
|
|
448
|
-
}));
|
|
449
|
-
};
|
|
450
|
-
|
|
451
269
|
/**
|
|
452
270
|
* ダッシュの多用。英語では正当な用法が多いが、2026 年時点で最も知られた生成文のシグナルでもある。
|
|
453
271
|
* 日本語の組版ではそもそも扱いが難しい。どちらが正しいかは severity の言語別指定で分ける。spec §12.4。
|
|
454
272
|
*/
|
|
455
273
|
export const dashDensity: Detector = (doc, options): Finding[] => {
|
|
456
|
-
const hits = findIn(doc, DASH).filter((hit) => !introducesList(doc.source, hit.offset));
|
|
274
|
+
const hits = findIn(doc, DASH).filter((hit) => !introducesList(doc.source, hit.offset) && !opensLine(doc.source, hit.offset));
|
|
457
275
|
const first = hits[0];
|
|
458
276
|
const rate = density(doc, hits.length);
|
|
459
277
|
if (wordsOf(doc) < MIN_DOCUMENT_LENGTH[doc.lengthUnit] || first === undefined || rate <= options.limit) return [];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Detector, Finding, Lexicon, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
2
2
|
import { minorityWithin } from "../orthography.ts";
|
|
3
3
|
import { QUOTATION_MARKS, isWithinAny, quotedSpans } from "../quoted-span.ts";
|
|
4
|
+
import { referenceListSpans } from "../reference-lists.ts";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* 綴りの組の語彙表の名前の頭。組(spelling-variant、spelling-ize)ごとに比べる。組を分けるのは、両方の書き方が一つの
|
|
@@ -36,6 +37,15 @@ const CAPITAL = /^\p{Lu}/u;
|
|
|
36
37
|
/** 大文字で始まる次の語。文の頭でも、大文字の語が続けば名前(Labor Day、Centre Court)。 */
|
|
37
38
|
const CAPITALISED_NEXT = /^[ \t]+\p{Lu}/u;
|
|
38
39
|
|
|
40
|
+
/** 斜線でつないだ組(analyse/analyze)。両方の綴りを並べて名指ししているので、書き手の綴りではない。 */
|
|
41
|
+
const SLASH = "/";
|
|
42
|
+
|
|
43
|
+
const pairedBySlash = (text: string, at: number, word: string, other: string): boolean => {
|
|
44
|
+
const before = text.slice(Math.max(0, at - other.length - SLASH.length), at).toLowerCase();
|
|
45
|
+
const after = text.slice(at + word.length, at + word.length + SLASH.length + other.length).toLowerCase();
|
|
46
|
+
return before === `${other.toLowerCase()}${SLASH}` || after === `${SLASH}${other.toLowerCase()}`;
|
|
47
|
+
};
|
|
48
|
+
|
|
39
49
|
export type SpelledWord = { readonly written: string; readonly offset: number; readonly spelling: Spelling };
|
|
40
50
|
|
|
41
51
|
/**
|
|
@@ -50,7 +60,10 @@ export const spelledWordsIn = (sentence: Sentence, spellings: ReadonlyMap<string
|
|
|
50
60
|
const named = CAPITAL.test(match[0]) && (match.index !== first || CAPITALISED_NEXT.test(sentence.text.slice(match.index + match[0].length)));
|
|
51
61
|
const inQuote =
|
|
52
62
|
isWithinAny(quoted, { start: match.index, end: match.index + match[0].length }) || OPENING_QUOTE.test(sentence.text.charAt(match.index - 1));
|
|
53
|
-
|
|
63
|
+
if (spelling === undefined || named || inQuote) return [];
|
|
64
|
+
return pairedBySlash(sentence.text, match.index, match[0], spelling.other)
|
|
65
|
+
? []
|
|
66
|
+
: [{ written: match[0], offset: sentence.span.start + match.index, spelling }];
|
|
54
67
|
});
|
|
55
68
|
};
|
|
56
69
|
|
|
@@ -65,13 +78,24 @@ const findingOf = ({ sentence, word }: Located, count: number, of: number): Find
|
|
|
65
78
|
values: { matched: word.written, other: word.spelling.other, count, of, offset: word.offset },
|
|
66
79
|
});
|
|
67
80
|
|
|
81
|
+
const REFERENCE_LIST_HEADING = "reference-list-heading";
|
|
82
|
+
|
|
83
|
+
/** 文献一覧の外の文。文献一覧の題や出版者の名前は、引いた文献の綴りのまま書く。 */
|
|
84
|
+
const outsideReferenceLists = (doc: ProseDocument): Sentence[] => {
|
|
85
|
+
const lists = referenceListSpans(
|
|
86
|
+
doc.source,
|
|
87
|
+
(doc.lexicons[REFERENCE_LIST_HEADING] ?? []).map((entry) => entry.pattern),
|
|
88
|
+
);
|
|
89
|
+
return doc.sentences.filter((sentence) => !lists.some((list) => list.start <= sentence.span.start && sentence.span.start < list.end));
|
|
90
|
+
};
|
|
91
|
+
|
|
68
92
|
/**
|
|
69
93
|
* イギリスとアメリカの綴り(colour と color、centre と center)が一つの文書で混ざっているか。組ごとに、文書の中で少ないほうを
|
|
70
94
|
* 指摘する。どちらが正しいかは決めない。少ないほうが組の limit パーセントを超えるなら、使い分けと見て言わない。
|
|
71
95
|
*/
|
|
72
96
|
export const spellingVariety: Detector = (doc, options): Finding[] => {
|
|
73
97
|
const spellings = spellingsOf(doc.lexicons);
|
|
74
|
-
const located: Located[] = doc.
|
|
98
|
+
const located: Located[] = outsideReferenceLists(doc).flatMap((sentence) => spelledWordsIn(sentence, spellings).map((word) => ({ sentence, word })));
|
|
75
99
|
const families = [...new Set(located.map(({ word }) => word.spelling.family))];
|
|
76
100
|
return families.flatMap((family) => {
|
|
77
101
|
const ofFamily = located.filter(({ word }) => word.spelling.family === family);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Detector, Finding, ProseDocument, StructureNode } from "../plugin.ts";
|
|
2
|
-
import { danglingReferences,
|
|
2
|
+
import { danglingReferences, inDocumentOrder, type StructureIssue } from "../structure/issues.ts";
|
|
3
3
|
import { numberingBreaks } from "../structure/numbering.ts";
|
|
4
|
-
import { attachedPartStarts } from "../structure/attached-parts.ts";
|
|
5
4
|
import { numberingReadings } from "./numbering-readings.ts";
|
|
6
5
|
import { listsNumberBreaks } from "../structure/list-numbering.ts";
|
|
7
6
|
import { weekdayMismatches } from "../structure/weekday.ts";
|
|
@@ -38,7 +37,7 @@ export const quoteAt = (source: string, offset: number): string => {
|
|
|
38
37
|
.trim();
|
|
39
38
|
};
|
|
40
39
|
|
|
41
|
-
const findingsOf =
|
|
40
|
+
export const findingsOf =
|
|
42
41
|
(rule: string, issuesOf: (tree: NonNullable<ProseDocument["structure"]>, source: string) => StructureIssue[]): Detector =>
|
|
43
42
|
(doc): Finding[] =>
|
|
44
43
|
doc.structure === undefined
|
|
@@ -53,7 +52,9 @@ const findingsOf =
|
|
|
53
52
|
}));
|
|
54
53
|
|
|
55
54
|
export const danglingReference: Detector = (doc, options) =>
|
|
56
|
-
findingsOf("dangling-reference", (tree, source) =>
|
|
55
|
+
findingsOf("dangling-reference", (tree, source) =>
|
|
56
|
+
danglingReferences(tree, source, patternsOf(doc, "section-name-noun"), patternsOf(doc, "reference-list-heading")),
|
|
57
|
+
)(doc, options);
|
|
57
58
|
/** Markdown の HTML ブロックの中の条は木に入らない。そこを挟んだ抜けは、見えなかった番号かもしれない。 */
|
|
58
59
|
const structureNumberingGap: Detector = (doc, options) =>
|
|
59
60
|
findingsOf("numbering-gap", (tree, source) => numberingBreaks(tree, ...numberingReadings(doc, source)))(doc, options);
|
|
@@ -93,11 +94,6 @@ export const numberingGap: Detector = (doc, options): Finding[] => {
|
|
|
93
94
|
(left, right) => Number(left.values["offset"]) - Number(right.values["offset"]),
|
|
94
95
|
);
|
|
95
96
|
};
|
|
96
|
-
export const duplicateDefinition: Detector = (doc, options) => {
|
|
97
|
-
const labels = patternsOf(doc, "attached-instrument-label");
|
|
98
|
-
return findingsOf("duplicate-definition", (tree, source) => duplicateDefinitions(tree, attachedPartStarts(source, labels), source))(doc, options);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
97
|
/** 曜日の名前は言語パッケージの語彙表(weekday、日曜日から順)から取る。無ければ番号のまま。 */
|
|
102
98
|
const dayName = (doc: ProseDocument, day: unknown): string => {
|
|
103
99
|
const index = Number(day);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { charLength, lengthOf, proseText } from "../measure.ts";
|
|
2
2
|
import { contractionExtraWords } from "../contraction-words.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Detector, DetectorOptions, Finding, LengthUnit, Paragraph, ProseDocument, Section, Sentence, Span } from "../plugin.ts";
|
|
4
4
|
import { dateStampIndexes, stampCandidates } from "../date-stamp.ts";
|
|
5
5
|
import { inDocumentOrder } from "../structure/issues.ts";
|
|
6
6
|
import { preambleParagraphs } from "../preamble-paragraphs.ts";
|
|
7
|
-
import { isTooLongParagraph } from "../paragraph-length.ts";
|
|
7
|
+
import { isTooLongParagraph, labelledBlocks, opensWithFusedHeading } from "../paragraph-length.ts";
|
|
8
8
|
import { bodySectionOf } from "../body-section.ts";
|
|
9
|
+
import { threeShare } from "../rule-of-three.ts";
|
|
10
|
+
import { isInterview, sectionLevels } from "../section-levels.ts";
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* ばらつきは変動係数(標準偏差 ÷ 平均)で測る。
|
|
@@ -60,23 +62,39 @@ const uniformity = (doc: ProseDocument, values: readonly number[], span: { start
|
|
|
60
62
|
const sentenceSize = (sentence: Sentence, unit: LengthUnit): number =>
|
|
61
63
|
lengthOf(sentence, unit) + (unit === "word" ? contractionExtraWords(proseText(sentence)) : 0);
|
|
62
64
|
|
|
65
|
+
type Block = { readonly start: number; readonly sentences: readonly Sentence[] };
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 段落の中の、長さを測る文の組と、その頭の位置(最初の組は段落の頭)。見出しが本文に溶けた段落(改行の落ちた文書)は測らない。
|
|
69
|
+
* 【】の見出しや段落番号だけの行で段落を割る。
|
|
70
|
+
*/
|
|
71
|
+
const measuredBlocks = (doc: ProseDocument, paragraph: Paragraph): Block[] => {
|
|
72
|
+
const text = doc.source.slice(paragraph.span.start, paragraph.span.end);
|
|
73
|
+
if (opensWithFusedHeading(text)) return [];
|
|
74
|
+
return labelledBlocks(text, paragraph.span.start, paragraph.sentences).map((sentences, index) => ({
|
|
75
|
+
start: index === 0 ? paragraph.span.start : (sentences[0]?.span.start ?? paragraph.span.start),
|
|
76
|
+
sentences,
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
|
|
63
80
|
/** 1 段落に文を詰めすぎると、読み手はどこで息継ぎしていいか分からなくなる。 */
|
|
64
81
|
export const paragraphLength: Detector = (doc, options): Finding[] =>
|
|
65
82
|
doc.paragraphs
|
|
66
|
-
.
|
|
83
|
+
.flatMap((paragraph) => measuredBlocks(doc, paragraph))
|
|
84
|
+
.filter((block) =>
|
|
67
85
|
isTooLongParagraph(
|
|
68
|
-
|
|
86
|
+
block.sentences.map((sentence) => sentenceSize(sentence, doc.lengthUnit)),
|
|
69
87
|
options.limit,
|
|
70
88
|
options.fullSentence,
|
|
71
89
|
),
|
|
72
90
|
)
|
|
73
|
-
.map((
|
|
91
|
+
.map((block) => ({
|
|
74
92
|
rule: "max-paragraph-length",
|
|
75
93
|
severity: "warning",
|
|
76
94
|
line: 0,
|
|
77
95
|
column: 0,
|
|
78
|
-
quote: doc.source.slice(
|
|
79
|
-
values: { count:
|
|
96
|
+
quote: doc.source.slice(block.start, block.start + 80).trim(),
|
|
97
|
+
values: { count: block.sentences.length, limit: options.limit, offset: block.start },
|
|
80
98
|
}));
|
|
81
99
|
|
|
82
100
|
const charsOf = (paragraph: Paragraph): number => paragraph.sentences.reduce((sum, sentence) => sum + charLength(sentence), 0);
|
|
@@ -91,34 +109,44 @@ export const paragraphVariance: Detector = (doc, options): Finding[] => {
|
|
|
91
109
|
|
|
92
110
|
const sectionChars = (section: Section): number => section.sentences.reduce((sum, sentence) => sum + charLength(sentence), 0);
|
|
93
111
|
|
|
94
|
-
|
|
112
|
+
const isEven = (lengths: readonly number[], least: number, limit: number): boolean => {
|
|
113
|
+
const cv = lengths.length < least ? undefined : coefficientOfVariation(lengths);
|
|
114
|
+
return cv !== undefined && asPercent(cv) < limit;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 節の長さが揃いすぎている。見出しごとに機械的に埋めた文書で起きる。
|
|
119
|
+
* 節を一つずつ数えて揃っていても、読み手が並べて比べる節(小見出しを含めた節どうし、まとめ見出しの下の小見出しどうし)でも
|
|
120
|
+
* 揃っていなければ指摘しない。短い小見出しが 4 つあるだけで、揃った節が 4 つあるように見えるから。
|
|
121
|
+
*/
|
|
95
122
|
export const sectionUniformity: Detector = (doc, options): Finding[] => {
|
|
123
|
+
const marks = (doc.lexicons["interviewer-mark"] ?? []).map((entry) => entry.pattern);
|
|
124
|
+
const starts = doc.paragraphs.map((paragraph) => paragraph.span.start);
|
|
125
|
+
if (isInterview(doc.source, doc.sections, starts, marks)) return [];
|
|
126
|
+
const least = minimumCount(options, "min_sections", DEFAULT_MIN_SECTIONS);
|
|
96
127
|
const lengths = doc.sections.map(sectionChars).filter((length) => length > 0);
|
|
97
128
|
const first = doc.sections[0];
|
|
98
|
-
if (first === undefined || lengths.length <
|
|
99
|
-
|
|
129
|
+
if (first === undefined || lengths.length < least) return [];
|
|
130
|
+
const compared = sectionLevels(doc.sections, sectionChars).some((level) => isEven(level.lengths, least, options.limit));
|
|
131
|
+
return compared ? uniformity(doc, lengths, first.span, options.limit, "section-length-uniformity") : [];
|
|
100
132
|
};
|
|
101
133
|
|
|
102
134
|
/**
|
|
103
135
|
* 3 項目の箇条書きばかりになっている。
|
|
104
136
|
* 3 つ並べると収まりがよいので、言いたいことが 2 つでも 4 つでも 3 つにされる。
|
|
105
137
|
*/
|
|
106
|
-
const isThree = (list: BulletList): boolean => list.items.length === 3;
|
|
107
|
-
|
|
108
138
|
export const ruleOfThree: Detector = (doc, options): Finding[] => {
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const first = threes[0];
|
|
113
|
-
if (lists.length < 3 || first === undefined || share <= options.limit) return [];
|
|
139
|
+
const openWords = (doc.lexicons["list-continues"] ?? []).map((entry) => entry.pattern);
|
|
140
|
+
const found = threeShare(doc.source, doc.lists, openWords, options.limit);
|
|
141
|
+
if (found === undefined) return [];
|
|
114
142
|
return [
|
|
115
143
|
{
|
|
116
144
|
rule: "rule-of-three",
|
|
117
145
|
severity: "info",
|
|
118
146
|
line: 0,
|
|
119
147
|
column: 0,
|
|
120
|
-
quote: doc.source.slice(first.span.start, first.span.start + 80).trim(),
|
|
121
|
-
values: { count:
|
|
148
|
+
quote: doc.source.slice(found.first.span.start, found.first.span.start + 80).trim(),
|
|
149
|
+
values: { count: found.count, total: found.total, share: found.share, limit: options.limit, offset: found.first.span.start },
|
|
122
150
|
},
|
|
123
151
|
];
|
|
124
152
|
};
|
|
@@ -27,6 +27,16 @@ const verbAfterSubject = (tokens: readonly Token[], at: number, subjects: Lexico
|
|
|
27
27
|
return isVerbal(tokens[phraseEnd(tokens, at)]);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* 代名詞の後ろの一語で節が終わる(the files you own.)。品詞の読みが own を形容詞とすることがあるので、品詞でなく
|
|
32
|
+
* 節の終わりで読む。代名詞と一語だけの節は、名詞句を限る節のほかにない。
|
|
33
|
+
*/
|
|
34
|
+
const closingWord = (tokens: readonly Token[], at: number): boolean => {
|
|
35
|
+
const word = tokens[at];
|
|
36
|
+
const next = tokens[at + 1];
|
|
37
|
+
return word !== undefined && word.pos !== "PUNCT" && (next === undefined || next.pos === "PUNCT");
|
|
38
|
+
};
|
|
39
|
+
|
|
30
40
|
const isArticle = (token: Token | undefined): boolean => token?.features?.["PronType"] === "Art";
|
|
31
41
|
|
|
32
42
|
/**
|
|
@@ -34,7 +44,7 @@ const isArticle = (token: Token | undefined): boolean => token?.features?.["Pron
|
|
|
34
44
|
* each・all のような限定詞(The best teams all adapt)や、冠詞の無い名詞(The best teams adapt)は節の始まりと読まない。
|
|
35
45
|
*/
|
|
36
46
|
const contactClause = (tokens: readonly Token[], at: number, subjects: Lexicon): boolean => {
|
|
37
|
-
if (isWord(tokens[at], subjects)) return isVerbal(tokens[at + 1]);
|
|
47
|
+
if (isWord(tokens[at], subjects)) return isVerbal(tokens[at + 1]) || closingWord(tokens, at + 1);
|
|
38
48
|
return isArticle(tokens[at]) && isVerbal(tokens[phraseEnd(tokens, at + 1)]);
|
|
39
49
|
};
|
|
40
50
|
|
|
@@ -64,10 +74,19 @@ const participle = (tokens: readonly Token[], range: TokenRange, at: number): bo
|
|
|
64
74
|
const bounded = (tokens: readonly Token[], range: TokenRange, at: number, bounds: Lexicon): boolean =>
|
|
65
75
|
isWord(tokens[range.end], bounds) || isWord(tokens[at], bounds);
|
|
66
76
|
|
|
77
|
+
/**
|
|
78
|
+
* 修飾の語の並びが動詞で終わって、その後ろに代名詞の主語が来る(the most irreplaceable files you own)。修飾の動詞の後ろには
|
|
79
|
+
* 名詞が要るので、終わりの「動詞」は名詞を動詞と読んだもの。分詞(the most watched)は Part なので除く。
|
|
80
|
+
*/
|
|
81
|
+
const headReadAsVerb = (tokens: readonly Token[], range: TokenRange, at: number, subjects: Lexicon): boolean => {
|
|
82
|
+
const last = tokens[at - 1];
|
|
83
|
+
return at > range.end && last?.pos === "VERB" && last.features?.["VerbForm"] !== "Part" && isWord(tokens[at], subjects);
|
|
84
|
+
};
|
|
85
|
+
|
|
67
86
|
/** 修飾の語は名詞の前に来るので、句の後ろで止まった分詞は名詞の後ろにある。 */
|
|
68
87
|
const clauseOrParticiple = (tokens: readonly Token[], range: TokenRange, at: number, restrictors: Restrictors): boolean => {
|
|
69
88
|
const last = tokens[at - 1];
|
|
70
|
-
const endsPhrase = at === range.end || (last !== undefined && PHRASE_END.has(last.pos));
|
|
89
|
+
const endsPhrase = at === range.end || (last !== undefined && (PHRASE_END.has(last.pos) || headReadAsVerb(tokens, range, at, restrictors.subjects)));
|
|
71
90
|
return (endsPhrase && clause(tokens, at, restrictors)) || participle(tokens, range, at);
|
|
72
91
|
};
|
|
73
92
|
|