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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { Detector, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence } from "../plugin.ts";
|
|
2
|
+
import { lengthOf } from "../measure.ts";
|
|
3
|
+
import { quotedSpans, QUOTATION_MARKS } from "../quoted-span.ts";
|
|
4
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
5
|
+
import { comparableText, comparableWords, entryIn, entryOpens, entryRanges } from "./lexicon-match.ts";
|
|
6
|
+
|
|
7
|
+
// 書き出しの 3 つの形。語は言語パッケージの語彙表が持ち、ここは形だけを知る。
|
|
8
|
+
// open / end: 最初の文が、その語で始まる・終わる短い願い(〜したい。 / You want to …)
|
|
9
|
+
// echo: 前の文の語を、指す語のすぐ後ろの引用符で引き直す(この「だいたい」が / That ‘almost’)
|
|
10
|
+
// teaser: 易しく見せてから難所を予告する(それだけのことに見えて / Sounds simple.)
|
|
11
|
+
|
|
12
|
+
/** 書き出しとして読む文の数。人の記事でも、ここまでに状況か例が出る。 */
|
|
13
|
+
export const OPENING_SENTENCES = 8;
|
|
14
|
+
|
|
15
|
+
/** 願いが「短い」と言える長さ(和文は字、英文は語)。 */
|
|
16
|
+
const SHORT_WISH = { char: 40, word: 15 };
|
|
17
|
+
|
|
18
|
+
/** 引き直した語の長さの上限(和文は字、英文は語)。長い引用は言葉の引用で、語の引き直しではない。 */
|
|
19
|
+
const ECHO_SPAN = { char: 10, word: 3 };
|
|
20
|
+
|
|
21
|
+
/** 英文で語を引き直す一重の引用符(‘almost’)。直線の ' は省略の印と見分けられないので読まない。 */
|
|
22
|
+
const ECHO_MARKS = { ...QUOTATION_MARKS, "‘": "’" };
|
|
23
|
+
|
|
24
|
+
/** 文末の句点・感嘆符・閉じ括弧。 */
|
|
25
|
+
const SENTENCE_END = new Set('。..!!??」』”"’))');
|
|
26
|
+
|
|
27
|
+
/** 文末の記号と空白を除いた文。 */
|
|
28
|
+
const withoutEnd = (text: string): string => {
|
|
29
|
+
const chars = [...text];
|
|
30
|
+
const last = chars.findLastIndex((char) => !SENTENCE_END.has(char) && char.trim() !== "");
|
|
31
|
+
return chars.slice(0, last + 1).join("");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type ColdOpenShape = "wish" | "echo" | "teaser";
|
|
35
|
+
|
|
36
|
+
export type ColdOpenHit = { readonly shape: ColdOpenShape; readonly sentence: Sentence; readonly matched: string };
|
|
37
|
+
|
|
38
|
+
const inGroup = (lexicon: Lexicon, group: string): LexiconEntry[] => lexicon.filter((entry) => entry.group === group);
|
|
39
|
+
|
|
40
|
+
/** 書き出しの文:最初の段落から順に、箇条書きと文書と違う言語の文を除いて。 */
|
|
41
|
+
export const openingSentences = (doc: ProseDocument): Sentence[] =>
|
|
42
|
+
doc.paragraphs
|
|
43
|
+
.flatMap((paragraph) => paragraph.sentences)
|
|
44
|
+
.filter((sentence) => sentence.listItem !== true && sentence.embeddedLanguage === undefined)
|
|
45
|
+
.slice(0, OPENING_SENTENCES);
|
|
46
|
+
|
|
47
|
+
const TRAILING_MARK = new Set(["PUNCT", "SYM"]);
|
|
48
|
+
|
|
49
|
+
/** 文が語彙表の語で終わるか。品詞があれば語の並びで照らすので、「みたい」は「たい」に当たらない。 */
|
|
50
|
+
const endsWith = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
51
|
+
const tokens = sentence.tokens;
|
|
52
|
+
if (tokens === undefined || entry.tokens === undefined || entry.tokens.length === 0)
|
|
53
|
+
return withoutEnd(comparableText(sentence)).endsWith(comparableWords(entry.pattern));
|
|
54
|
+
const last = tokens.findLastIndex((token) => !TRAILING_MARK.has(token.pos) && token.surface.trim() !== "");
|
|
55
|
+
return entryRanges(sentence, entry).some((range) => range.end === last + 1);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** 最初の文が、語彙表の語で始まるか終わる短い願いか。 */
|
|
59
|
+
export const wishOpening = (first: Sentence | undefined, lexicon: Lexicon, unit: "char" | "word"): ColdOpenHit[] => {
|
|
60
|
+
if (first === undefined || lengthOf(first, unit) > SHORT_WISH[unit]) return [];
|
|
61
|
+
const entry = inGroup(lexicon, "open").find((open) => entryOpens(first, open)) ?? inGroup(lexicon, "end").find((end) => endsWith(first, end));
|
|
62
|
+
return entry === undefined ? [] : [{ shape: "wish", sentence: first, matched: first.text.trim() }];
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const isWordChar = (char: string | undefined): boolean => char !== undefined && /[\p{L}\p{N}]/u.test(char);
|
|
66
|
+
|
|
67
|
+
/** 定義を置く括弧の開き。契約の (this "Agreement") は語の引き直しではなく定義。 */
|
|
68
|
+
const DEFINITION_OPEN = new Set(["(", "("]);
|
|
69
|
+
|
|
70
|
+
/** 引用符の直前が、語彙表の指す語(この、That)で終わるか。英字の語は語の途中に当たらない。 */
|
|
71
|
+
const pointedAt = (before: string, pointers: readonly LexiconEntry[]): LexiconEntry | undefined => {
|
|
72
|
+
const head = comparableWords(before).trimEnd();
|
|
73
|
+
return pointers.find((pointer) => {
|
|
74
|
+
const word = comparableWords(pointer.pattern);
|
|
75
|
+
if (!head.endsWith(word)) return false;
|
|
76
|
+
const preceding = head.slice(0, -word.length).trimEnd().at(-1);
|
|
77
|
+
return !DEFINITION_OPEN.has(preceding ?? "") && !(/^[a-z]/u.test(word) && isWordChar(head.at(-word.length - 1)));
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** 引用符で引いたところを空白にした文。前の文でも引用符の中にある語は、引き直しではなく同じ語の言及。位置は変えない。 */
|
|
82
|
+
const unquoted = (text: string): string => {
|
|
83
|
+
const quoted = quotedSpans(text, ECHO_MARKS);
|
|
84
|
+
return text
|
|
85
|
+
.split("")
|
|
86
|
+
.map((char, at) => (quoted.some((span) => at >= span.start - 1 && at <= span.end) ? " " : char))
|
|
87
|
+
.join("");
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** 前の文に、引いた語がそのまま出るか。英字の語は語の途中(database の base)に当たらない。 */
|
|
91
|
+
const occursIn = (previous: string, word: string, unit: "char" | "word"): boolean =>
|
|
92
|
+
unit === "char" ? previous.includes(word) : new RegExp(`(?<![\\p{L}\\p{N}])${escapeRegExp(word)}(?![\\p{L}\\p{N}])`, "u").test(previous);
|
|
93
|
+
|
|
94
|
+
const spanLength = (text: string, unit: "char" | "word"): number =>
|
|
95
|
+
unit === "char" ? text.replace(/\s+/gu, "").length : text.split(/\s+/u).filter(Boolean).length;
|
|
96
|
+
|
|
97
|
+
/** 前の文の語を、指す語の後ろの引用符で引き直した文(この「だいたい」が困ります)。 */
|
|
98
|
+
export const echoQuotes = (sentences: readonly Sentence[], lexicon: Lexicon, unit: "char" | "word"): ColdOpenHit[] => {
|
|
99
|
+
const pointers = inGroup(lexicon, "echo");
|
|
100
|
+
if (pointers.length === 0) return [];
|
|
101
|
+
return sentences.slice(1).flatMap((sentence, index) => {
|
|
102
|
+
const previous = comparableWords(unquoted(sentences[index]?.text ?? ""));
|
|
103
|
+
const echoed = quotedSpans(sentence.text, ECHO_MARKS).find((span) => {
|
|
104
|
+
const inner = sentence.text.slice(span.start, span.end).trim();
|
|
105
|
+
if (inner === "" || spanLength(inner, unit) > ECHO_SPAN[unit]) return false;
|
|
106
|
+
return pointedAt(sentence.text.slice(0, span.start - 1), pointers) !== undefined && occursIn(previous, comparableWords(inner), unit);
|
|
107
|
+
});
|
|
108
|
+
return echoed === undefined ? [] : [{ shape: "echo" as const, sentence, matched: sentence.text.slice(echoed.start, echoed.end).trim() }];
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** 易しく見せてから難所を予告する言い回し。 */
|
|
113
|
+
export const teasers = (sentences: readonly Sentence[], lexicon: Lexicon): ColdOpenHit[] => {
|
|
114
|
+
const phrases = inGroup(lexicon, "teaser");
|
|
115
|
+
return sentences.flatMap((sentence) => {
|
|
116
|
+
const entry = phrases.find((phrase) => entryIn(sentence, phrase));
|
|
117
|
+
return entry === undefined ? [] : [{ shape: "teaser" as const, sentence, matched: entry.pattern }];
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/** 書き出しに出た形。形ごとに最初の 1 つ。 */
|
|
122
|
+
export const coldOpenHits = (doc: ProseDocument, lexicon: Lexicon): ColdOpenHit[] => {
|
|
123
|
+
const opening = openingSentences(doc);
|
|
124
|
+
const found = [...wishOpening(opening[0], lexicon, doc.lengthUnit), ...echoQuotes(opening, lexicon, doc.lengthUnit), ...teasers(opening, lexicon)];
|
|
125
|
+
return [...new Map(found.map((hit) => [hit.shape, hit])).values()];
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 状況も例もなく始まる書き出し。形 1 つは人の文書にもある(提案の「〜したい。」、定義の言い直し)。
|
|
130
|
+
* limit は書き出しに要る形の数で、重なったときだけ、形ごとの文を言う。
|
|
131
|
+
*/
|
|
132
|
+
export const coldOpen: Detector = (doc, options): Finding[] => {
|
|
133
|
+
const hits = coldOpenHits(doc, options.lexicon ?? []);
|
|
134
|
+
if (hits.length === 0 || hits.length < options.limit) return [];
|
|
135
|
+
return hits
|
|
136
|
+
.toSorted((a, b) => a.sentence.span.start - b.sentence.span.start)
|
|
137
|
+
.map((hit) => ({
|
|
138
|
+
rule: "",
|
|
139
|
+
severity: "info",
|
|
140
|
+
line: 0,
|
|
141
|
+
column: 0,
|
|
142
|
+
quote: hit.sentence.text.trim(),
|
|
143
|
+
values: { matched: hit.matched, count: hits.length, limit: options.limit, offset: hit.sentence.span.start },
|
|
144
|
+
}));
|
|
145
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Token } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
// Sentences around a comparative that already say what it is compared with, though no baseline word names it. Pure.
|
|
4
|
+
|
|
5
|
+
const lower = (token: Token | undefined): string => token?.surface.toLowerCase() ?? "";
|
|
6
|
+
|
|
7
|
+
const isSpace = (token: Token): boolean => token.surface.trim() === "";
|
|
8
|
+
|
|
9
|
+
/** The index of the sentence's first word, past leading spaces. */
|
|
10
|
+
const firstWordAt = (tokens: readonly Token[]): number => tokens.findIndex((token) => !isSpace(token));
|
|
11
|
+
|
|
12
|
+
const wordOf = (token: Token): readonly string[] => [lower(token), token.lemma?.toLowerCase() ?? ""];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A word inside the sentence, before the comparative, that names the change or the alternative it follows from: a cause
|
|
16
|
+
* (これにより、…ことにより、…できるため、) or a contrast (Print statements work, but a debugger is better). The word must
|
|
17
|
+
* follow another word: the clause before it is what the comparison sets itself against.
|
|
18
|
+
*/
|
|
19
|
+
export const followsCause = (tokens: readonly Token[], first: Token, causes: ReadonlySet<string>): boolean => {
|
|
20
|
+
const opening = firstWordAt(tokens);
|
|
21
|
+
return tokens.some((token, at) => at > opening && token.span.end <= first.span.start && wordOf(token).some((word) => causes.has(word)));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** The sentence opens with a word that puts it after a change or a topic it names (As the application grows, …; By pairing …, …). */
|
|
25
|
+
export const opensWithCause = (tokens: readonly Token[], openers: ReadonlySet<string>): boolean => openers.has(lower(tokens[firstWordAt(tokens)]));
|
|
26
|
+
|
|
27
|
+
/** How far before the comparative a verb that makes it a change from now may stand (make the system meet their needs better). */
|
|
28
|
+
const MAKER_REACH = 6;
|
|
29
|
+
|
|
30
|
+
const CLAUSE_BREAK = new Set([",", ";", ":"]);
|
|
31
|
+
|
|
32
|
+
/** A verb shortly before the comparative, in its clause, makes it a change from the present state (to make results more predictable, we can do better). */
|
|
33
|
+
export const madeComparative = (tokens: readonly Token[], first: Token, makers: ReadonlySet<string>): boolean => {
|
|
34
|
+
const at = tokens.indexOf(first);
|
|
35
|
+
const reach = tokens.slice(Math.max(0, at - MAKER_REACH), at);
|
|
36
|
+
const clause = reach.slice(reach.findLastIndex((token) => CLAUSE_BREAK.has(token.surface)) + 1);
|
|
37
|
+
return clause.some((token) => (token.pos === "VERB" || token.pos === "AUX") && makers.has(lower(token)));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** A condition word with its negation attached (couldn't, wouldn’t) is the condition word. */
|
|
41
|
+
export const withoutNegation = (word: string): string => word.replace(/n['’]t$/u, "");
|
|
42
|
+
|
|
43
|
+
/** A comparative is the subject of the predicate, opening its clause: a maxim weighing two comparatives (simpler is better). */
|
|
44
|
+
export const comparesComparatives = (tokens: readonly Token[], headAt: number, comparatives: ReadonlySet<string>): boolean => {
|
|
45
|
+
const subject = tokens[headAt - 1];
|
|
46
|
+
const before = tokens[headAt - 2];
|
|
47
|
+
return comparatives.has(lower(subject)) && (before === undefined || isSpace(before) || CLAUSE_BREAK.has(before.surface));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const MODIFIER = new Set(["ADJ", "VERB"]);
|
|
51
|
+
|
|
52
|
+
const nounWord = (token: Token): string => token.lemma?.toLowerCase() ?? lower(token);
|
|
53
|
+
|
|
54
|
+
/** The subject noun before the predicate head, past adverbs (A blurred background usually looks better → background). */
|
|
55
|
+
const subjectAt = (tokens: readonly Token[], headAt: number): number => {
|
|
56
|
+
const at = tokens.slice(0, headAt).findLastIndex((token) => token.pos !== "ADV" && !isSpace(token));
|
|
57
|
+
return tokens[at]?.pos === "NOUN" ? at : -1;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The subject is one kind of a thing the sentence before names as another kind (Virtual backgrounds are fine, … A blurred
|
|
62
|
+
* background looks better): the same noun under a different modifier, so the comparison is between the two kinds.
|
|
63
|
+
*/
|
|
64
|
+
export const comparesKinds = (previous: readonly Token[], tokens: readonly Token[], head: Token | undefined): boolean => {
|
|
65
|
+
if (head === undefined) return false;
|
|
66
|
+
const at = subjectAt(tokens, tokens.indexOf(head));
|
|
67
|
+
const [modifier, subject] = [tokens[at - 1], tokens[at]];
|
|
68
|
+
if (at === -1 || subject === undefined || modifier === undefined || !MODIFIER.has(modifier.pos)) return false;
|
|
69
|
+
const noun = nounWord(subject);
|
|
70
|
+
return previous.some(
|
|
71
|
+
(token, index) =>
|
|
72
|
+
token.pos === "NOUN" && nounWord(token) === noun && MODIFIER.has(previous[index - 1]?.pos ?? "") && lower(previous[index - 1]) !== lower(modifier),
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { proseText } from "../measure.ts";
|
|
2
|
+
import type { Detector, Finding, ProseDocument, Section, Sentence } from "../plugin.ts";
|
|
3
|
+
import {
|
|
4
|
+
evidenceSpans,
|
|
5
|
+
hasNumeral,
|
|
6
|
+
isClaim,
|
|
7
|
+
isConditionHeading,
|
|
8
|
+
isLabelOnly,
|
|
9
|
+
isNavigationLine,
|
|
10
|
+
startsWithin,
|
|
11
|
+
statesIntent,
|
|
12
|
+
type AdviceWords,
|
|
13
|
+
type IntentWords,
|
|
14
|
+
} from "./concrete-evidence.ts";
|
|
15
|
+
import { letteredIndexEntries } from "./lettered-index.ts";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 具体物の密度。数値・コード・リンク・引用が 1 つも無い節は、
|
|
19
|
+
* 読み終えても何も持ち帰れない。**少ないほうを指摘する**ので、他の密度 rule と向きが逆。
|
|
20
|
+
*/
|
|
21
|
+
const CONCRETE = /\d|`|https?:\/\//u;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 見出しのない導入部は、書き出しで呼ぶ。文書の言葉なので、message がどの言語でも混ざらない。
|
|
25
|
+
* 決まった呼び名(「この節」)を置くと、英語の文書の message に日本語が入る。
|
|
26
|
+
*/
|
|
27
|
+
const OPENING = { word: 4, char: 12 };
|
|
28
|
+
|
|
29
|
+
const openingOf = (sentence: Sentence | undefined, unit: ProseDocument["lengthUnit"]): string => {
|
|
30
|
+
const text = sentence === undefined ? "" : proseText(sentence);
|
|
31
|
+
const pieces = unit === "word" ? text.split(" ") : Array.from(text);
|
|
32
|
+
const joiner = unit === "word" ? " " : "";
|
|
33
|
+
return pieces.length <= OPENING[unit] ? pieces.join(joiner) : `${pieces.slice(0, OPENING[unit]).join(joiner)}…`;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const hasNumeralIn = (section: Section): boolean => section.sentences.some((sentence) => hasNumeral(sentence.tokens ?? []));
|
|
37
|
+
|
|
38
|
+
/** これより短い節は、具体物があるべきか判断できない。 */
|
|
39
|
+
const MIN_SENTENCES = 3;
|
|
40
|
+
|
|
41
|
+
const adviceWordsOf = (doc: ProseDocument): AdviceWords => ({
|
|
42
|
+
openers: (doc.lexicons["advice-opener"] ?? []).map((entry) => entry.pattern),
|
|
43
|
+
endings: (doc.lexicons["advice-ending"] ?? []).map((entry) => entry.pattern),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const intentWordsOf = (doc: ProseDocument): IntentWords => ({
|
|
47
|
+
phrases: (doc.lexicons["intent-phrase"] ?? []).map((entry) => entry.pattern),
|
|
48
|
+
endings: (doc.lexicons["intent-ending"] ?? []).map((entry) => entry.pattern),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const lowerPatternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern.toLowerCase());
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 文の半分以上が問い・指示・見込みや方針の節(質問の一覧、手引き、リスクと対策、答申の提言)は、数字で裏づける主張をしていない。
|
|
55
|
+
* 番号だけの文(a.)は数えない。
|
|
56
|
+
*/
|
|
57
|
+
const mostlyClaims = (sentences: readonly Sentence[], language: string, advice: AdviceWords, intent: IntentWords): boolean => {
|
|
58
|
+
const said = sentences.filter((sentence) => !isLabelOnly(sentence));
|
|
59
|
+
return said.filter((sentence) => isClaim(sentence, language, advice) && !statesIntent(sentence, intent)).length * 2 > said.length;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const concreteEvidence: Detector = (doc, options): Finding[] => {
|
|
63
|
+
const entries = letteredIndexEntries(doc.sections);
|
|
64
|
+
const advice = adviceWordsOf(doc);
|
|
65
|
+
const intent = intentWordsOf(doc);
|
|
66
|
+
const navigation = lowerPatternsOf(doc, "navigation-line");
|
|
67
|
+
const conditionHeadings = lowerPatternsOf(doc, "condition-heading");
|
|
68
|
+
const proseOf = (section: Section): Sentence[] => section.sentences.filter((sentence) => !isNavigationLine(sentence, navigation));
|
|
69
|
+
const sections = doc.sections.filter((section) => {
|
|
70
|
+
const sentences = proseOf(section);
|
|
71
|
+
return (
|
|
72
|
+
sentences.length >= MIN_SENTENCES &&
|
|
73
|
+
!entries.has(section) &&
|
|
74
|
+
!isConditionHeading(section.unlabeledHeading ?? section.heading, conditionHeadings) &&
|
|
75
|
+
mostlyClaims(sentences, doc.language, advice, intent)
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
const bare = sections.filter(
|
|
79
|
+
(section) => !CONCRETE.test(doc.source.slice(section.span.start, section.span.end)) && !hasNumeralIn(section) && !startsWithin(section.span, doc.links),
|
|
80
|
+
);
|
|
81
|
+
// 構造の木は作るのに手間がかかる。指摘に届かない文書では作らない。
|
|
82
|
+
const nodes = bare.length < options.limit ? [] : evidenceSpans(doc.structure);
|
|
83
|
+
const empty = bare.filter((section) => !startsWithin(section.span, nodes));
|
|
84
|
+
if (empty.length < options.limit) return [];
|
|
85
|
+
return empty.map((section) => ({
|
|
86
|
+
rule: "concrete-evidence-density",
|
|
87
|
+
severity: "info",
|
|
88
|
+
line: 0,
|
|
89
|
+
column: 0,
|
|
90
|
+
quote: section.heading.length > 0 ? section.heading : (section.sentences[0]?.text.trim() ?? ""),
|
|
91
|
+
values: {
|
|
92
|
+
word: section.heading.length > 0 ? section.heading : openingOf(section.sentences[0], doc.lengthUnit),
|
|
93
|
+
count: empty.length,
|
|
94
|
+
total: sections.length,
|
|
95
|
+
limit: options.limit,
|
|
96
|
+
offset: section.span.start,
|
|
97
|
+
},
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
@@ -106,3 +106,43 @@ export const isClaim = (sentence: Pick<Sentence, "text" | "tokens">, language: s
|
|
|
106
106
|
!opensWith(sentence.text, words.openers) &&
|
|
107
107
|
!endsWith(sentence.text, words.endings) &&
|
|
108
108
|
!opensWithVerb(sentence.tokens ?? [], language);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 見込み・あるべき姿・書き手の予定を述べる言い方。英語は文のどこかの語(may, should, we will)、日本語は文末(〜が期待される、〜すべきである)。
|
|
112
|
+
* どちらの言語の語彙表も、その言語の文書にしか無い。
|
|
113
|
+
*/
|
|
114
|
+
export type IntentWords = { readonly phrases: readonly string[]; readonly endings: readonly string[] };
|
|
115
|
+
|
|
116
|
+
/** 語の並びとして比べる形。字とアポストロフィ以外を空白に畳んで、両端に空白を置く。 */
|
|
117
|
+
const wordRun = (text: string): string =>
|
|
118
|
+
` ${text
|
|
119
|
+
.replace(/’/gu, "'")
|
|
120
|
+
.replace(/[^\p{L}']+/gu, " ")
|
|
121
|
+
.trim()} `;
|
|
122
|
+
|
|
123
|
+
/** 文頭の大文字だけを小文字に戻す。文の途中の大文字の語(in May)は、助動詞と別の語。 */
|
|
124
|
+
const withLowerHead = (text: string): string => {
|
|
125
|
+
const trimmed = text.trimStart();
|
|
126
|
+
return `${trimmed.charAt(0).toLowerCase()}${trimmed.slice(1)}`;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const containsPhrase = (text: string, phrases: readonly string[]): boolean => {
|
|
130
|
+
const words = wordRun(withLowerHead(text));
|
|
131
|
+
return phrases.some((phrase) => words.includes(wordRun(phrase.toLowerCase())));
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** 事実でなく、起こりうること・すべきこと・書き手のする予定を述べた文(リスクと対策、提言、答申の方針)。裏づけの数字を求める主張ではない。 */
|
|
135
|
+
export const statesIntent = (sentence: Pick<Sentence, "text">, words: IntentWords): boolean =>
|
|
136
|
+
containsPhrase(sentence.text, words.phrases) || endsWith(sentence.text, words.endings);
|
|
137
|
+
|
|
138
|
+
/** 比べる形。前後の空白と、文末の句点・コロンを除き、小文字にする。 */
|
|
139
|
+
const bareLine = (text: string): string =>
|
|
140
|
+
withoutTail(text, new Set([...TERMINALS, ":", ":"]))
|
|
141
|
+
.trim()
|
|
142
|
+
.toLowerCase();
|
|
143
|
+
|
|
144
|
+
/** 変換で残ったサイトの案内(ページの先頭です。本文)。文書の本文ではない。 */
|
|
145
|
+
export const isNavigationLine = (sentence: Pick<Sentence, "text">, lines: readonly string[]): boolean => lines.includes(bareLine(sentence.text));
|
|
146
|
+
|
|
147
|
+
/** 条件を並べる節の見出し(Requirements、応募資格)。並ぶのは条件で、裏づけを求める主張ではない。 */
|
|
148
|
+
export const isConditionHeading = (heading: string, headings: readonly string[]): boolean => headings.includes(bareLine(heading));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
// A word emphasised alone is stressed: "does **not**" keeps the full form because a contraction cannot carry the stress,
|
|
4
|
+
// so it does not say which form the writer's prose uses. A longer emphasised stretch (a bold label, an italic note) is
|
|
5
|
+
// still the writer's prose and is counted.
|
|
6
|
+
|
|
7
|
+
/** A run of emphasis marks in the source that the prose masks out (chrome), with its place. */
|
|
8
|
+
type Marks = { readonly start: number; readonly end: number };
|
|
9
|
+
|
|
10
|
+
const MARK_RUN = /[*_]+/gu;
|
|
11
|
+
const BLANK_LINE = /\n[ \t]*\n/u;
|
|
12
|
+
const ONE_WORD = /^[\p{L}'’]+$/u;
|
|
13
|
+
|
|
14
|
+
const isMasked = (prose: string, start: number, end: number): boolean => prose.slice(start, end).trim() === "";
|
|
15
|
+
|
|
16
|
+
const isText = (char: string | undefined): boolean => char !== undefined && char.trim() !== "";
|
|
17
|
+
|
|
18
|
+
/** Emphasis marks the parser took as markup: masked in the prose and touching unmasked text on one side. */
|
|
19
|
+
const markRuns = (source: string, prose: string): (Marks & { readonly opens: boolean; readonly closes: boolean })[] =>
|
|
20
|
+
[...source.matchAll(MARK_RUN)].flatMap((match) => {
|
|
21
|
+
const start = match.index;
|
|
22
|
+
const end = start + match[0].length;
|
|
23
|
+
if (!isMasked(prose, start, end)) return [];
|
|
24
|
+
const opens = isText(prose[end]);
|
|
25
|
+
const closes = isText(prose[start - 1]);
|
|
26
|
+
return opens || closes ? [{ start, end, opens, closes }] : [];
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The words emphasised alone in the document, without their marks, in source coordinates. Emphasis does not cross a
|
|
31
|
+
* blank line, so an opening mark left without its closing one in its paragraph covers nothing.
|
|
32
|
+
*/
|
|
33
|
+
type Pairing = { readonly open: Marks | undefined; readonly words: readonly Span[] };
|
|
34
|
+
|
|
35
|
+
const pairRun =
|
|
36
|
+
(source: string) =>
|
|
37
|
+
(state: Pairing, run: Marks & { readonly opens: boolean; readonly closes: boolean }): Pairing => {
|
|
38
|
+
const { open } = state;
|
|
39
|
+
if (open === undefined || !run.closes || BLANK_LINE.test(source.slice(open.end, run.start)))
|
|
40
|
+
return { open: run.opens ? run : undefined, words: state.words };
|
|
41
|
+
const inside = { start: open.end, end: run.start };
|
|
42
|
+
return { open: undefined, words: ONE_WORD.test(source.slice(inside.start, inside.end)) ? [...state.words, inside] : state.words };
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const stressedWords = (source: string, prose: string): readonly Span[] =>
|
|
46
|
+
markRuns(source, prose).reduce<Pairing>(pairRun(source), { open: undefined, words: [] }).words;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { quotedSpans } from "../quoted-span.ts";
|
|
2
2
|
|
|
3
|
+
import type { Span } from "../plugin.ts";
|
|
4
|
+
|
|
3
5
|
// A short phrase in quotation marks ("Do Not Disturb", ‘we’re going to x’) is a name or an example: the form is mentioned,
|
|
4
6
|
// not used, so it says nothing about the document's register. Spoken words carry punctuation ("We don't know," she
|
|
5
|
-
// said) and stay
|
|
7
|
+
// said) and stay, unless they are quoted inside another quotation (a platform's label in a quoted sentence), which is
|
|
8
|
+
// someone else's wording twice over. The text must already have straight apostrophes, so a ’ left in it closes a quotation.
|
|
6
9
|
|
|
7
10
|
const MENTION_MARKS: Readonly<Record<string, string>> = { "“": "”", '"': '"', "‘": "’" };
|
|
8
11
|
/** More words than this in quotation marks is a quoted sentence, not a phrase named as an example. */
|
|
@@ -14,11 +17,54 @@ const isMention = (quoted: string): boolean => {
|
|
|
14
17
|
return PHRASE.test(phrase) && phrase.split(/\s+/u).length <= MAX_MENTION_WORDS;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const isNested = (span: Span, spans: readonly Span[]): boolean => spans.some((outer) => outer !== span && outer.start < span.start && span.end < outer.end);
|
|
21
|
+
|
|
22
|
+
/** text with the characters in each span replaced by spaces, every other character at its place. */
|
|
23
|
+
const blankSpans = (text: string, spans: readonly Span[]): string => {
|
|
24
|
+
if (spans.length === 0) return text;
|
|
21
25
|
const units = text.split("");
|
|
22
|
-
|
|
26
|
+
spans.forEach((span) => units.fill(" ", Math.max(0, span.start), Math.min(text.length, span.end)));
|
|
23
27
|
return units.join("");
|
|
24
28
|
};
|
|
29
|
+
|
|
30
|
+
/** The text with each quoted short phrase, and each quotation inside another, blanked out. */
|
|
31
|
+
export const withoutMentions = (text: string): string => {
|
|
32
|
+
const quoted = quotedSpans(text, MENTION_MARKS);
|
|
33
|
+
return blankSpans(
|
|
34
|
+
text,
|
|
35
|
+
quoted.filter((span) => isMention(text.slice(span.start, span.end)) || isNested(span, quoted)),
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The text (which starts at offset in the document) with the document ranges that fall in it blanked out.
|
|
41
|
+
* Ranges are in document coordinates; those outside the text change nothing.
|
|
42
|
+
*/
|
|
43
|
+
export const blankRanges = (text: string, offset: number, ranges: readonly Span[]): string =>
|
|
44
|
+
blankSpans(
|
|
45
|
+
text,
|
|
46
|
+
ranges
|
|
47
|
+
.filter((range) => range.end > offset && range.start < offset + text.length)
|
|
48
|
+
.map((range) => ({ start: range.start - offset, end: range.end - offset })),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/** A list of search terms or keywords runs to at least this many comma-separated items. */
|
|
52
|
+
const MIN_LIST_TERMS = 8;
|
|
53
|
+
/** A term is a few words; a longer item is a clause of prose. */
|
|
54
|
+
const MAX_TERM_WORDS = 4;
|
|
55
|
+
/** Share of the items that must be terms: a list's label ("(i) Functional errors (k1=50): error") may run longer. */
|
|
56
|
+
const MIN_TERM_SHARE = 0.9;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A sentence that is a list of terms (keywords, search strings: "won't load, wont load, can't login, …") names its
|
|
60
|
+
* contractions as items; it does not write in a register.
|
|
61
|
+
*/
|
|
62
|
+
export const isTermList = (text: string): boolean => {
|
|
63
|
+
const items = text
|
|
64
|
+
.split(/[,;]/u)
|
|
65
|
+
.map((item) => item.trim())
|
|
66
|
+
.filter((item) => item !== "");
|
|
67
|
+
if (items.length < MIN_LIST_TERMS) return false;
|
|
68
|
+
const terms = items.filter((item) => item.split(/\s+/u).length <= MAX_TERM_WORDS);
|
|
69
|
+
return terms.length >= items.length * MIN_TERM_SHARE;
|
|
70
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { pairMinority, type PairUses } from "./contraction-minority.ts";
|
|
2
|
+
import { blankRanges, isTermList, withoutMentions } from "./contraction-mention.ts";
|
|
3
|
+
import { stressedWords } from "./contraction-emphasis.ts";
|
|
4
|
+
import { escapeRegExp, straightApostrophes } from "../orthography.ts";
|
|
5
|
+
import type { Detector, Finding, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 同じことを言う 2 つの書きかたが、1 つの文書で混ざっているか。
|
|
9
|
+
*
|
|
10
|
+
* **どちらが正しいかは決めない。** 短縮形を使うかどうかは文体の選択で、
|
|
11
|
+
* 立場を取ると方針の違う書き手に rule ごと無視される。spec §12.3。
|
|
12
|
+
*
|
|
13
|
+
* 語彙表は対を持つ(`pattern` と `instead_of`)。比べるのは対の中だけで、別の語どうしは比べない。
|
|
14
|
+
* GOV.UK の文体は「you're」を使い否定は「do not」と書く。語ごとに決めた書きかたで、混在ではない。
|
|
15
|
+
* 否定と代名詞+動詞の族にもまとめない。「don't」と「does not」を書き分ける文書もある。
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type Pair = { readonly short: string; readonly long: string };
|
|
19
|
+
type MixedPair = { readonly pair: Pair; readonly side: keyof PairUses; readonly minority: string; readonly majority: string; readonly count: number };
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 語の境界で照合する。部分一致だと「it isn't」が「it is」を含んでしまい、
|
|
23
|
+
* 短縮形を使っている文が「使っていない」側に数えられる。
|
|
24
|
+
*/
|
|
25
|
+
const wordUses = (text: string, word: string): number => [...text.matchAll(new RegExp(`\\b${escapeRegExp(word)}\\b`, "gu"))].length;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 書き手が選んだ形として数える文の字。引用で挙げた語句と語の一覧の中の形は、書き手の文体を語らないので空ける。
|
|
29
|
+
* アポストロフィの形(don’t と don't)は短縮形かどうかを変えない。折り返した行も、空白 1 つと同じに読む。
|
|
30
|
+
*/
|
|
31
|
+
const comparableText = (text: string): string => {
|
|
32
|
+
const counted = withoutMentions(straightApostrophes(text));
|
|
33
|
+
return isTermList(counted) ? "" : counted.replace(/\s+/gu, " ").toLowerCase();
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 指してよい字。一語だけ強調した形(does **not**)は強勢のために選んだ形なので指さない。
|
|
38
|
+
* 書き手がその形を書いたことには変わりないので、どちらが多いかを数えるときは数える。
|
|
39
|
+
*/
|
|
40
|
+
const pointableText = (sentence: Sentence, stressed: readonly Span[]): string => comparableText(blankRanges(sentence.text, sentence.span.start, stressed));
|
|
41
|
+
|
|
42
|
+
/** 語のすぐ後ろが句読点か文の終わり。名前として挙げた語("Use cannot, instead of can't.")はそう並ぶ。 */
|
|
43
|
+
const bareUses = (text: string, word: string): number => [...text.matchAll(new RegExp(`\\b${escapeRegExp(word)}\\b(?=\\s*(?:\\p{P}|$))`, "gu"))].length;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 1 文の中の、対の 2 つの形の数。両方の形をそれぞれ単独で挙げた文("Use cannot, instead of can't.")は語を比べていて、
|
|
47
|
+
* どちらも使っていない。両方を文の中で使う文("It is important -- it's the most important")はそのまま数える。
|
|
48
|
+
*/
|
|
49
|
+
const usesIn = (text: string, pair: Pair): PairUses => {
|
|
50
|
+
const named = bareUses(text, pair.short) > 0 && bareUses(text, pair.long) > 0;
|
|
51
|
+
return named ? { short: 0, long: 0 } : { short: wordUses(text, pair.short), long: wordUses(text, pair.long) };
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const mixedPair = (texts: readonly string[], pair: Pair): MixedPair | undefined => {
|
|
55
|
+
const uses = texts.reduce<PairUses>(
|
|
56
|
+
(sum, text) => {
|
|
57
|
+
const here = usesIn(text, pair);
|
|
58
|
+
return { short: sum.short + here.short, long: sum.long + here.long };
|
|
59
|
+
},
|
|
60
|
+
{ short: 0, long: 0 },
|
|
61
|
+
);
|
|
62
|
+
const side = pairMinority(uses);
|
|
63
|
+
if (side === undefined) return undefined;
|
|
64
|
+
return side === "short"
|
|
65
|
+
? { pair, side, minority: pair.short, majority: pair.long, count: uses.short }
|
|
66
|
+
: { pair, side, minority: pair.long, majority: pair.short, count: uses.long };
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const usesMinority = (text: string, mixed: MixedPair): boolean => usesIn(text, mixed.pair)[mixed.side] > 0;
|
|
70
|
+
|
|
71
|
+
const emphasisOf = (doc: ProseDocument): readonly Span[] => (doc.prose === undefined ? [] : stressedWords(doc.source, doc.prose));
|
|
72
|
+
|
|
73
|
+
export const contractionMix: Detector = (doc, options): Finding[] => {
|
|
74
|
+
const stressed = emphasisOf(doc);
|
|
75
|
+
// 文ごとに数える。文をつないで数えると、箇条書きの「What we do」と次の項目「not every…」が「do not」と数えられる。
|
|
76
|
+
const texts = doc.sentences.map((sentence) => comparableText(sentence.text));
|
|
77
|
+
const mixed = (options.lexicon ?? []).flatMap((entry) => {
|
|
78
|
+
const pair = entry.instead_of === undefined ? undefined : mixedPair(texts, { short: entry.pattern.toLowerCase(), long: entry.instead_of.toLowerCase() });
|
|
79
|
+
return pair === undefined || pair.count > options.limit ? [] : [pair];
|
|
80
|
+
});
|
|
81
|
+
const hits = doc.sentences.flatMap((sentence) => {
|
|
82
|
+
const pointable = pointableText(sentence, stressed);
|
|
83
|
+
const pair = mixed.find((candidate) => usesMinority(pointable, candidate));
|
|
84
|
+
return pair === undefined ? [] : [{ sentence, pair }];
|
|
85
|
+
});
|
|
86
|
+
return hits.map(({ sentence, pair }) => ({
|
|
87
|
+
rule: "contraction-consistency",
|
|
88
|
+
severity: "info",
|
|
89
|
+
line: 0,
|
|
90
|
+
column: 0,
|
|
91
|
+
quote: sentence.text.trim(),
|
|
92
|
+
values: { matched: pair.minority, majority: pair.majority, count: pair.count, limit: options.limit, offset: sentence.span.start },
|
|
93
|
+
}));
|
|
94
|
+
};
|