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
|
@@ -3,6 +3,7 @@ import { quotedIn } from "../quoted-span.ts";
|
|
|
3
3
|
import { followsInlineCode } from "./code-before.ts";
|
|
4
4
|
import { followsTwoExamples } from "./example-baseline.ts";
|
|
5
5
|
import { isNamedStep, plainStepKeys } from "./graded-step.ts";
|
|
6
|
+
import { comparesComparatives, comparesKinds, followsCause, madeComparative, opensWithCause, withoutNegation } from "./comparative-context.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 比べる相手の無い比較(より良い結果、さらに高速に、The new engine is faster.)。何より良いのか、何より速いのかが書かれていない。
|
|
@@ -14,6 +15,8 @@ import { isNamedStep, plainStepKeys } from "./graded-step.ts";
|
|
|
14
15
|
* intent は比べた語より後ろで、比較を願いや目的の中に置く語(より広く進めたい、より円滑にするためには)。比べる相手は今の状態。
|
|
15
16
|
* phrase は比べた形で終わる決まった言い方(to be more precise)。前の言葉を言い直すだけで、何も比べていない。
|
|
16
17
|
* pointer は文の頭で、いま見せた例を指す語(This is much better!)。二つのコードの例のすぐ後ろなら、相手は前の例。
|
|
18
|
+
* cause は比べた形より前で、比較が何の結果か、何に対してかを言う語(これにより、…できるため、…, but)。opener は文の頭で同じことをする語(As …, By …)。
|
|
19
|
+
* 英語の aim は比べた形の少し前で、今の状態から変えると言う動詞(to make results more predictable、do better)。
|
|
17
20
|
* 同じ文か前の二文に相手を言う語があれば、相手は書いてある。
|
|
18
21
|
*/
|
|
19
22
|
|
|
@@ -29,9 +32,12 @@ export type ComparativeLists = {
|
|
|
29
32
|
readonly intents: ReadonlySet<string>;
|
|
30
33
|
readonly phrases: readonly string[];
|
|
31
34
|
readonly pointers: ReadonlySet<string>;
|
|
35
|
+
readonly causes: ReadonlySet<string>;
|
|
36
|
+
readonly openers: ReadonlySet<string>;
|
|
32
37
|
};
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
/** head は英語の比べた形の前の述語(is faster の is)。 */
|
|
40
|
+
export type BareComparative = { readonly first: Token; readonly last: Token; readonly head?: Token };
|
|
35
41
|
|
|
36
42
|
/** 前に立てば、比べた形が述語として読める語の品詞(is faster、runs faster)。 */
|
|
37
43
|
const PREDICATE_HEAD = new Set(["VERB", "AUX"]);
|
|
@@ -85,10 +91,25 @@ const endsInAim = (tokens: readonly Token[], at: number, aims: ReadonlySet<strin
|
|
|
85
91
|
return end > at && aims.has(tokens[end]?.surface ?? "");
|
|
86
92
|
};
|
|
87
93
|
|
|
88
|
-
/**
|
|
94
|
+
/** 名詞の並びの中の語か。名詞の前に付いた形容詞(多文化の「多」)も並びの一部。 */
|
|
95
|
+
const inNounPhrase = (tokens: readonly Token[], at: number): boolean =>
|
|
96
|
+
tokens[at]?.pos === "NOUN" || (tokens[at]?.pos === "ADJ" && tokens[at + 1]?.pos === "NOUN");
|
|
97
|
+
|
|
98
|
+
/** 名詞の並びに「の」と目当ての語が続くか(より良い多文化共生の実現)。比べた語は、その目当ての中の語。 */
|
|
99
|
+
const aimAfterOf = (tokens: readonly Token[], at: number, aims: ReadonlySet<string>): boolean => {
|
|
100
|
+
const length = tokens.slice(at).findIndex((_, index) => !inNounPhrase(tokens, at + index));
|
|
101
|
+
const of = at + (length === -1 ? tokens.length - at : length);
|
|
102
|
+
return length > 0 && tokens[of]?.surface === "の" && runsFrom(tokens, of + 1).some(({ run }) => aims.has(run));
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** 程度を言う語(at)の後ろが、今より良くする目当てか(より良い社会、より豊かな暮らし、より良いものにする、より良い共生の実現)。 */
|
|
89
106
|
const namesAim = (tokens: readonly Token[], at: number, aims: ReadonlySet<string>): boolean => {
|
|
90
107
|
const next = tokens[at]?.pos === "NOUN" && ADJECTIVAL_TAIL.has(tokens[at + 1]?.surface ?? "") ? at + 2 : at + 1;
|
|
91
|
-
return
|
|
108
|
+
return (
|
|
109
|
+
runsFrom(tokens, next).some(({ run, after }) => aims.has(run) && !headsCompound(tokens, after)) ||
|
|
110
|
+
endsInAim(tokens, next, aims) ||
|
|
111
|
+
aimAfterOf(tokens, next, aims)
|
|
112
|
+
);
|
|
92
113
|
};
|
|
93
114
|
|
|
94
115
|
/** 日本語: 副詞の「より」「さらに」の直後の、程度を言える語。比較の決まった言い方(より多くの)と、今より良くする目当て(より良い社会)は除く。 */
|
|
@@ -126,13 +147,15 @@ const predicateAt = (tokens: readonly Token[], at: number, lists: ComparativeLis
|
|
|
126
147
|
const first = tokens[start] ?? word;
|
|
127
148
|
const adverbs = tokens.slice(Math.max(0, start - MAX_ADVERBS), start).reverse();
|
|
128
149
|
const skipped = adverbs.findIndex((token) => token.pos !== "ADV");
|
|
129
|
-
const
|
|
130
|
-
|
|
150
|
+
const headAt = start - 1 - (skipped === -1 ? adverbs.length : skipped);
|
|
151
|
+
const head = tokens[headAt];
|
|
152
|
+
if (head === undefined || !(PREDICATE_HEAD.has(head.pos) || isThirdPersonVerb(head))) return undefined;
|
|
153
|
+
return comparesComparatives(tokens, headAt, new Set([...lists.comparatives, ...lists.more])) ? undefined : { first, last: word, head };
|
|
131
154
|
};
|
|
132
155
|
|
|
133
156
|
/** 比べた形より前に、条件か仮定を言う語があるか。並べる「と」(A と B)は条件でない。 */
|
|
134
157
|
const isConditional = (tokens: readonly Token[], found: BareComparative, conditions: ReadonlySet<string>): boolean =>
|
|
135
|
-
tokens.some((token) => token.span.start < found.first.span.start && token.pos !== "CCONJ" && conditions.has(lower(token)));
|
|
158
|
+
tokens.some((token) => token.span.start < found.first.span.start && token.pos !== "CCONJ" && conditions.has(withoutNegation(lower(token))));
|
|
136
159
|
|
|
137
160
|
/** 比べた形のすぐ前が、いま述べたものを越えると言う語か(performed even better)。 */
|
|
138
161
|
const goesBeyond = (tokens: readonly Token[], found: BareComparative, beyond: ReadonlySet<string>): boolean => {
|
|
@@ -175,7 +198,9 @@ export const bareComparativesIn = (tokens: readonly Token[], lists: ComparativeL
|
|
|
175
198
|
!isConditional(tokens, found, lists.conditions) &&
|
|
176
199
|
!goesBeyond(tokens, found, lists.beyond) &&
|
|
177
200
|
!isIntended(tokens, found, lists.intents) &&
|
|
178
|
-
!endsSetPhrase(tokens, found, lists.phrases)
|
|
201
|
+
!endsSetPhrase(tokens, found, lists.phrases) &&
|
|
202
|
+
!followsCause(tokens, found.first, lists.causes) &&
|
|
203
|
+
!(found.head !== undefined && madeComparative(tokens, found.first, lists.aims)),
|
|
179
204
|
);
|
|
180
205
|
|
|
181
206
|
/**
|
|
@@ -186,14 +211,13 @@ const isBaselineWord = (token: Token, baselines: readonly string[]): boolean =>
|
|
|
186
211
|
return baselines.some((baseline) => surface === baseline || lemma === baseline || ([...baseline].length === 1 && surface.startsWith(baseline)));
|
|
187
212
|
};
|
|
188
213
|
|
|
189
|
-
/**
|
|
214
|
+
/** 相手を言う語が、続く語に分かれて書かれているか(これ・まで、で・は・なく、that follows)。語を詰めても、空白でつないでも照らす。 */
|
|
190
215
|
const MAX_BASELINE_TOKENS = 3;
|
|
216
|
+
const runsJoinedBy = (surfaces: readonly string[], glue: string): string[] =>
|
|
217
|
+
surfaces.reduce<string[]>((runs, surface) => [...runs, runs.length === 0 ? surface : `${runs.at(-1) ?? ""}${glue}${surface}`], []).slice(1);
|
|
191
218
|
const isSplitBaseline = (tokens: readonly Token[], at: number, baselines: readonly string[]): boolean => {
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
.map((token) => token.surface.toLowerCase())
|
|
195
|
-
.reduce<string[]>((runs, surface) => [...runs, `${runs.at(-1) ?? ""}${surface}`], []);
|
|
196
|
-
return joined.slice(1).some((run) => baselines.includes(run));
|
|
219
|
+
const surfaces = tokens.slice(at, at + MAX_BASELINE_TOKENS).map((token) => token.surface.toLowerCase());
|
|
220
|
+
return [...runsJoinedBy(surfaces, ""), ...runsJoinedBy(surfaces, " ")].some((run) => baselines.includes(run));
|
|
197
221
|
};
|
|
198
222
|
|
|
199
223
|
/** 文の中に、比べる相手を言う語か、相手を受ける助詞の「より」(従来より)があるか。 */
|
|
@@ -219,6 +243,8 @@ export const listsOf = (lexicon: Lexicon): ComparativeLists => ({
|
|
|
219
243
|
intents: new Set(groupOf(lexicon, "intent")),
|
|
220
244
|
phrases: groupOf(lexicon, "phrase"),
|
|
221
245
|
pointers: new Set(groupOf(lexicon, "pointer")),
|
|
246
|
+
causes: new Set(groupOf(lexicon, "cause")),
|
|
247
|
+
openers: new Set(groupOf(lexicon, "opener")),
|
|
222
248
|
});
|
|
223
249
|
|
|
224
250
|
/** 鉤括弧の中の比較(「給与所得の確定申告がさらに簡単に!」ページ)は題や語を挙げたもので、書き手の比較ではない。 */
|
|
@@ -244,9 +270,11 @@ export const bareComparative: Detector = (doc): Finding[] => {
|
|
|
244
270
|
const nearby = doc.sentences.slice(Math.max(0, at - BASELINE_REACH), at + 1);
|
|
245
271
|
if (sentence.embeddedLanguage !== undefined || nearby.some((near) => namesBaseline(near, lists.baselines))) return [];
|
|
246
272
|
if (pointsAtExample(sentence, lists.pointers) && followsTwoExamples(doc.source, spans, at)) return [];
|
|
273
|
+
if (opensWithCause(sentence.tokens ?? [], lists.openers)) return [];
|
|
247
274
|
const quoted = quotedIn(sentence);
|
|
248
275
|
return bareComparativesIn(sentence.tokens ?? [], lists)
|
|
249
276
|
.filter((found) => !quoted.some((span) => insideSpan(found, span)) && !isThanAfterCode(doc, found))
|
|
277
|
+
.filter((found) => !comparesKinds(doc.sentences[at - 1]?.tokens ?? [], sentence.tokens ?? [], found.head))
|
|
250
278
|
.filter((found) => !lists.markers.has(found.first.surface) || !isNamedStep(sentence.tokens ?? [], found.last, steps))
|
|
251
279
|
.map((found) => ({
|
|
252
280
|
rule: "",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type Span = { readonly start: number; readonly end: number };
|
|
2
|
+
|
|
3
|
+
/** Between two pieces of one blank: marks, spaces (\s takes in the full-width one) and a number's hyphens, on one line (〇〇区〇〇 〇丁目, 03-〇〇〇〇-〇〇〇〇). */
|
|
4
|
+
const JOINER = /^(?:(?!\n)[\s○〇◯△\-‐-])*$/u;
|
|
5
|
+
const JOINER_CHAR = /(?!\n)[\s○〇◯△\-‐-]/u;
|
|
6
|
+
const MARK = /[○〇◯△]/u;
|
|
7
|
+
|
|
8
|
+
/** How far the joiner characters reach from `from` in one direction, ending on a blank mark (〇〇区〇〇 takes in the last 〇〇). */
|
|
9
|
+
const reach = (text: string, from: number, step: 1 | -1): number => {
|
|
10
|
+
const chars = step === 1 ? Array.from(text.slice(from)) : Array.from(text.slice(0, from)).reverse();
|
|
11
|
+
const run = chars.findIndex((char) => !JOINER_CHAR.test(char));
|
|
12
|
+
const within = (run === -1 ? chars : chars.slice(0, run)).map((char) => char.length);
|
|
13
|
+
const lastMark = (run === -1 ? chars : chars.slice(0, run)).findLastIndex((char) => MARK.test(char));
|
|
14
|
+
return from + step * within.slice(0, lastMark + 1).reduce((sum, length) => sum + length, 0);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The spans as the blanks a reader sees: pieces that overlap, or that only blank marks, spaces and hyphens on one line
|
|
19
|
+
* separate, are one blank, and so are the marks right beside them (〒〇〇〇-〇〇〇〇, 〇丁目〇番〇号 〇〇ビル, 東京都〇〇区〇〇).
|
|
20
|
+
* A filled word between two pieces (株式会社〇〇の〇〇様) keeps them two.
|
|
21
|
+
*/
|
|
22
|
+
export const joinedBlanks = (text: string, spans: readonly Span[]): Span[] =>
|
|
23
|
+
spans
|
|
24
|
+
.toSorted((left, right) => left.start - right.start || left.end - right.end)
|
|
25
|
+
.reduce<Span[]>((joined, span) => {
|
|
26
|
+
const last = joined.at(-1);
|
|
27
|
+
if (last === undefined || (span.start > last.end && !JOINER.test(text.slice(last.end, span.start)))) return [...joined, span];
|
|
28
|
+
return [...joined.slice(0, -1), { start: last.start, end: Math.max(last.end, span.end) }];
|
|
29
|
+
}, [])
|
|
30
|
+
.map((span) => ({ start: reach(text, span.start, -1), end: reach(text, span.end, 1) }));
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** Quote marks at the head of a line (`> > `), with the indent before them. */
|
|
4
|
+
const QUOTE_MARKS = /^[ \t]*(?:>[ \t]*)*/u;
|
|
5
|
+
|
|
6
|
+
/** The bullet or number that opens a list item. */
|
|
7
|
+
const ITEM_MARKER = /^(?:[-*+]|\d{1,9}[.)])[ \t]+/u;
|
|
8
|
+
|
|
9
|
+
/** A task box after the marker. */
|
|
10
|
+
const TASK_BOX = /^\[[ xX]\][ \t]+/u;
|
|
11
|
+
|
|
12
|
+
/** The end of a sentence, or a colon announcing what follows, past closing quotes, brackets, bold and a hard-break backslash. */
|
|
13
|
+
const CLOSED = /[.!?:。!?:]["'”’)\]*_]*\\?$/u;
|
|
14
|
+
|
|
15
|
+
/** A bold run whose first character, past an opening quote or bracket, is a capital: a name, as a button or a title is. */
|
|
16
|
+
const CAPITALISED = /^(?:\*\*|__)["'“‘([]*\p{Lu}/u;
|
|
17
|
+
|
|
18
|
+
/** How far back a bold looks for the end of the sentence before it. */
|
|
19
|
+
const LOOK_BACK = 200;
|
|
20
|
+
|
|
21
|
+
const lineStartOf = (source: string, offset: number): number => source.lastIndexOf("\n", offset - 1) + 1;
|
|
22
|
+
|
|
23
|
+
const previousLineOf = (source: string, lineStart: number): string | undefined =>
|
|
24
|
+
lineStart === 0 ? undefined : source.slice(lineStartOf(source, lineStart - 1), lineStart - 1);
|
|
25
|
+
|
|
26
|
+
/** What stands before a bold on its line, read as quote marks, an item marker and a task box; `rest` is what is left. */
|
|
27
|
+
const lineOpeningOf = (opening: string): { readonly item: boolean; readonly rest: string } => {
|
|
28
|
+
const unquoted = opening.replace(QUOTE_MARKS, "");
|
|
29
|
+
const unmarked = unquoted.replace(ITEM_MARKER, "");
|
|
30
|
+
return { item: unmarked !== unquoted, rest: unmarked.replace(TASK_BOX, "") };
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** A line opening with bold: in a run of such lines (From:, To:, Date:) each line is a field. */
|
|
34
|
+
const opensWithBold = (line: string): boolean => /^(?:\*\*|__)/u.test(line.replace(QUOTE_MARKS, ""));
|
|
35
|
+
|
|
36
|
+
/** Whether the line before closes a block or a sentence, or is itself a bold field: the line after it starts afresh. */
|
|
37
|
+
const followsAClosedLine = (previous: string | undefined): boolean =>
|
|
38
|
+
previous === undefined || previous.trim() === "" || CLOSED.test(previous.trimEnd()) || opensWithBold(previous);
|
|
39
|
+
|
|
40
|
+
/** A bold that opens its line and its block: a list item's lead, a field (From:), a run-in heading (Pros:), a dateline. */
|
|
41
|
+
export const opensItsBlock = (source: string, span: Span): boolean => {
|
|
42
|
+
const lineStart = lineStartOf(source, span.start);
|
|
43
|
+
const opening = lineOpeningOf(source.slice(lineStart, span.start));
|
|
44
|
+
return opening.rest === "" && (opening.item || followsAClosedLine(previousLineOf(source, lineStart)));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** Whether a bold starts a sentence: nothing before it, or the end of a sentence. */
|
|
48
|
+
const startsASentence = (before: string): boolean => {
|
|
49
|
+
const trimmed = before.trimEnd();
|
|
50
|
+
return trimmed === "" || CLOSED.test(trimmed);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** A capitalised bold inside a sentence: the name of a button, a setting or a title (click **Add Printer**), not emphasis. */
|
|
54
|
+
export const isNameMidSentence = (source: string, span: Span): boolean =>
|
|
55
|
+
CAPITALISED.test(source.slice(span.start, span.end)) && !startsASentence(source.slice(Math.max(0, span.start - LOOK_BACK), span.start));
|
|
56
|
+
|
|
57
|
+
/** Whether a bold span emphasises words in running text, rather than labelling, heading or naming something. */
|
|
58
|
+
export const isEmphasisBold = (source: string, span: Span): boolean => !opensItsBlock(source, span) && !isNameMidSentence(source, span);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Detector, Finding, ProseDocument, Sentence } from "../plugin.ts";
|
|
2
|
-
import {
|
|
1
|
+
import type { Detector, Finding, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
2
|
+
import { isEmphasisBold } from "./bold-emphasis-form.ts";
|
|
3
3
|
import { proseText } from "../measure.ts";
|
|
4
4
|
import { wordsOf } from "./structure.ts";
|
|
5
5
|
import { MIN_DOCUMENT_LENGTH } from "./signals.ts";
|
|
@@ -9,29 +9,28 @@ const TENTHS = 10;
|
|
|
9
9
|
/** Two bold spans are what a careful writer keeps for a deadline or a warning, and in a short text they alone pass any rate. */
|
|
10
10
|
const MIN_SPANS = 3;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The bold spans of the prose that emphasise (Section.strongs already leaves out headings and tables). A bold opening its
|
|
14
|
+
* line and block is a label, a field or a run-in heading (bold-label-list counts the list labels); a capitalised bold
|
|
15
|
+
* mid-sentence is a name.
|
|
16
|
+
*/
|
|
17
|
+
const emphasisSpans = (doc: ProseDocument): Span[] =>
|
|
18
|
+
doc.sections.flatMap((section) => section.strongs ?? []).filter((span) => isEmphasisBold(doc.source, span));
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
const labelItemCount = (doc: ProseDocument): number =>
|
|
16
|
-
doc.lists
|
|
17
|
-
.flatMap((list) => list.itemSpans)
|
|
18
|
-
.filter((span) => !isQuotedAt(doc.source, span.start) && opensWithBoldLabel(doc.source.slice(span.start, span.end))).length;
|
|
20
|
+
export const emphasisSpanCount = (doc: ProseDocument): number => emphasisSpans(doc).length;
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
export const emphasisSpanCount = (doc: ProseDocument): number =>
|
|
22
|
-
Math.max(0, doc.sections.reduce((sum, section) => sum + section.strongCount, 0) - labelItemCount(doc));
|
|
23
|
-
|
|
24
|
-
const firstBoldSentence = (doc: ProseDocument): Sentence | undefined =>
|
|
25
|
-
doc.sentences.find((sentence) => BOLD_OPENING.test(doc.source.slice(sentence.span.start, sentence.span.end)));
|
|
22
|
+
const sentenceAt = (doc: ProseDocument, offset: number): Sentence | undefined => doc.sentences.find((sentence) => offset < sentence.span.end);
|
|
26
23
|
|
|
27
24
|
/** A rate over the whole document, not per section: the reader notices bold scattered through every part of it. */
|
|
28
25
|
export const boldEmphasis: Detector = (doc, options): Finding[] => {
|
|
29
26
|
const length = wordsOf(doc);
|
|
30
|
-
const
|
|
27
|
+
const spans = emphasisSpans(doc);
|
|
28
|
+
const count = spans.length;
|
|
31
29
|
if (count < MIN_SPANS || length < MIN_DOCUMENT_LENGTH[doc.lengthUnit]) return [];
|
|
32
30
|
const density = Math.round((count / length) * PER * TENTHS) / TENTHS;
|
|
33
31
|
if (density <= options.limit) return [];
|
|
34
|
-
const
|
|
32
|
+
const offset = spans[0]?.start ?? 0;
|
|
33
|
+
const at = sentenceAt(doc, offset);
|
|
35
34
|
return [
|
|
36
35
|
{
|
|
37
36
|
rule: "bold-emphasis",
|
|
@@ -39,7 +38,7 @@ export const boldEmphasis: Detector = (doc, options): Finding[] => {
|
|
|
39
38
|
line: 0,
|
|
40
39
|
column: 0,
|
|
41
40
|
quote: at === undefined ? "" : proseText(at),
|
|
42
|
-
values: { count, density, limit: options.limit, offset: at?.span.start ??
|
|
41
|
+
values: { count, density, limit: options.limit, offset: at?.span.start ?? offset },
|
|
43
42
|
},
|
|
44
43
|
];
|
|
45
44
|
};
|
|
@@ -32,16 +32,32 @@ export const opensWithBoldLabel = (item: string): boolean => BOLD_LABEL.test(ite
|
|
|
32
32
|
/** Whether the line holding `offset` is quoted (`> - **a**:…`): someone else's words, not the writer's to fix. */
|
|
33
33
|
export const isQuotedAt = (source: string, offset: number): boolean => source.slice(source.lastIndexOf("\n", offset - 1) + 1, offset).includes(">");
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
|
|
35
|
+
/** A bold run longer than this is a paragraph in bold, not a lead sentence. */
|
|
36
|
+
const MAX_LEAD_CHARS = 80;
|
|
37
|
+
|
|
38
|
+
/** `**Label.** text`: a bold lead sentence, its stop inside the bold, then the item goes on. The same label, closed by a stop instead of a colon. */
|
|
39
|
+
const BOLD_LEAD = new RegExp(String.raw`^(\*\*|__)(?!\s)((?:(?!\1)[^\n]){1,${MAX_LEAD_CHARS}}?[.!?。!?])\1[ \t]*\S`, "u");
|
|
40
|
+
|
|
41
|
+
/** The lead sentence a list item opens with in bold, its stop left off, or undefined. `item` is the item as written, marker and all. */
|
|
42
|
+
export const boldLeadOf = (item: string): string | undefined =>
|
|
43
|
+
BOLD_LEAD.exec(item.replace(ITEM_MARKER, "").replace(TASK_BOX, ""))?.[2]
|
|
44
|
+
?.trim()
|
|
45
|
+
.replace(/[.!?。!?]$/u, "");
|
|
46
|
+
|
|
47
|
+
const labelOrLeadOf = (item: string): string | undefined => boldLabelOf(item) ?? boldLeadOf(item);
|
|
48
|
+
|
|
49
|
+
const unquotedItems = (doc: ProseDocument, opens: (item: string) => string | undefined): Span[] =>
|
|
37
50
|
doc.lists
|
|
38
51
|
.flatMap((list) => list.itemSpans)
|
|
39
|
-
.filter((span) => !isQuotedAt(doc.source, span.start) &&
|
|
52
|
+
.filter((span) => !isQuotedAt(doc.source, span.start) && opens(doc.source.slice(span.start, span.end)) !== undefined)
|
|
40
53
|
.toSorted((left, right) => left.start - right.start);
|
|
41
54
|
|
|
42
|
-
/**
|
|
55
|
+
/** The list items, in document order, that open with a bold label and are not quoted. */
|
|
56
|
+
export const boldLabelItems = (doc: ProseDocument): Span[] => unquotedItems(doc, boldLabelOf);
|
|
57
|
+
|
|
58
|
+
/** A count, not a density: a person writes one or two labels even in a long article. A bold lead sentence counts as a label. */
|
|
43
59
|
export const boldLabelList: Detector = (doc, options): Finding[] => {
|
|
44
|
-
const items =
|
|
60
|
+
const items = unquotedItems(doc, labelOrLeadOf);
|
|
45
61
|
const first = items[0];
|
|
46
62
|
if (first === undefined || items.length < options.limit) return [];
|
|
47
63
|
const written = doc.source.slice(first.start, first.end);
|
|
@@ -52,7 +68,7 @@ export const boldLabelList: Detector = (doc, options): Finding[] => {
|
|
|
52
68
|
line: 0,
|
|
53
69
|
column: 0,
|
|
54
70
|
quote: (written.split("\n")[0] ?? "").trim(),
|
|
55
|
-
values: { label:
|
|
71
|
+
values: { label: labelOrLeadOf(written) ?? "", count: items.length, limit: options.limit, offset: first.start },
|
|
56
72
|
},
|
|
57
73
|
];
|
|
58
74
|
};
|
|
@@ -73,27 +73,52 @@ const formsOf = (term: string): string[] => {
|
|
|
73
73
|
return lasts.map((form) => (head === "" ? form : `${head} ${form}`));
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
/** Whether two tokens are next to each other in a run: at most one character apart, or only spaces apart on one line (Normal Business Hours). */
|
|
77
|
+
type Near = (left: Token, right: Token) => boolean;
|
|
78
|
+
|
|
79
|
+
const nearIn =
|
|
80
|
+
(source: string): Near =>
|
|
81
|
+
(left, right) =>
|
|
82
|
+
adjacent(left, right) || /^[ \t]+$/u.test(source.slice(left.span.end, right.span.start));
|
|
83
|
+
|
|
76
84
|
/** How many tokens the capitalised run starting at index takes: words that continue it, and a joiner or hyphen between two. */
|
|
77
|
-
const runLength = (tokens: readonly Token[], index: number, joiners: ReadonlySet<string
|
|
85
|
+
const runLength = (tokens: readonly Token[], index: number, joiners: ReadonlySet<string>, near: Near): number => {
|
|
78
86
|
const word = tokens[index];
|
|
79
87
|
const next = tokens[index + 1];
|
|
80
88
|
const after = tokens[index + 2];
|
|
81
|
-
if (next === undefined || word === undefined || !
|
|
82
|
-
if (continues(next)) return 1 + runLength(tokens, index + 1, joiners);
|
|
89
|
+
if (next === undefined || word === undefined || !near(word, next)) return 1;
|
|
90
|
+
if (continues(next)) return 1 + runLength(tokens, index + 1, joiners, near);
|
|
83
91
|
const hyphened = next.surface === HYPHEN && touching(word, next) && after !== undefined && touching(next, after);
|
|
84
|
-
const joined = hyphened || (joiners.has(next.surface) && after !== undefined &&
|
|
85
|
-
return joined && continues(after) ? 2 + runLength(tokens, index + 2, joiners) : 1;
|
|
92
|
+
const joined = hyphened || (joiners.has(next.surface) && after !== undefined && near(next, after));
|
|
93
|
+
return joined && continues(after) ? 2 + runLength(tokens, index + 2, joiners, near) : 1;
|
|
86
94
|
};
|
|
87
95
|
|
|
88
96
|
type Run = { readonly start: number; readonly end: number };
|
|
89
97
|
|
|
90
98
|
/** The capitalised runs of one sentence, as [start, end) token indexes; a run never starts inside the one before. */
|
|
91
|
-
const runsOf = (tokens: readonly Token[], joiners: ReadonlySet<string
|
|
99
|
+
const runsOf = (tokens: readonly Token[], joiners: ReadonlySet<string>, near: Near): Run[] =>
|
|
92
100
|
tokens.reduce<Run[]>((runs, token, index) => {
|
|
93
101
|
if ((runs.at(-1)?.end ?? 0) > index || !isCapitalised(token)) return runs;
|
|
94
|
-
return [...runs, { start: index, end: index + runLength(tokens, index, joiners) }];
|
|
102
|
+
return [...runs, { start: index, end: index + runLength(tokens, index, joiners, near) }];
|
|
95
103
|
}, []);
|
|
96
104
|
|
|
105
|
+
/** Marks that glue a word to the next with no space (Borrowmoney.com, Leased/rent): one written form, not a term. */
|
|
106
|
+
const WORD_GLUE = new Set([".", "/"]);
|
|
107
|
+
const LETTER_START = /^\p{L}/u;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The run is not written as a term: its last word is glued to more letters (a web address, a slash pair), or a small
|
|
111
|
+
* word inside it is capitalised too (Maintenance And Deployment), which is capitalising every word, not naming a term.
|
|
112
|
+
*/
|
|
113
|
+
const notWrittenAsTerm = (tokens: readonly Token[], start: number, end: number, small: ReadonlySet<string>): boolean => {
|
|
114
|
+
const last = tokens[end - 1];
|
|
115
|
+
const glue = tokens[end];
|
|
116
|
+
const more = tokens[end + 1];
|
|
117
|
+
const glued = last !== undefined && glue !== undefined && more !== undefined && WORD_GLUE.has(glue.surface) && touching(last, glue) && touching(glue, more);
|
|
118
|
+
if (glued && LETTER_START.test(more.surface)) return true;
|
|
119
|
+
return tokens.slice(start + 1, end - 1).some((token) => isCapitalised(token) && small.has(token.surface.toLowerCase()));
|
|
120
|
+
};
|
|
121
|
+
|
|
97
122
|
const inside = (offset: number, spans: readonly Span[]): boolean => spans.some((span) => span.start <= offset && offset < span.end);
|
|
98
123
|
|
|
99
124
|
/** Used like a defined term: after a lower-case word, and not a modifier of a lower-case noun after it (the Premium plan). */
|
|
@@ -273,18 +298,20 @@ export const capitalisedTerms = (input: CapitalisedInput): CapitalisedTerm[] =>
|
|
|
273
298
|
const defining = input.defined.filter((definition) => definition.bare !== true && DEFINED_FORM.test(definition.term));
|
|
274
299
|
if (defining.length < MIN_DEFINED) return [];
|
|
275
300
|
const joiners = new Set(input.words.joiners);
|
|
301
|
+
const small = new Set([...input.words.joiners, ...input.words.articles].map((word) => word.toLowerCase()));
|
|
302
|
+
const near = nearIn(input.source);
|
|
276
303
|
const isName = nameCues(input, joiners);
|
|
277
304
|
const divisions = new Set(input.words.divisions.flatMap(formsOf));
|
|
278
305
|
const known = new Set([...input.defined.map((definition) => definition.term), ...input.named, ...input.words.names].flatMap(formsOf));
|
|
279
306
|
const isKnown = (term: string): boolean => partsOf(term).some((part) => formsOf(part).some((form) => known.has(form)));
|
|
280
307
|
const uses = input.sentences.flatMap((tokens) =>
|
|
281
|
-
runsOf(tokens, joiners).flatMap(({ start, end }): CapitalisedTerm[] => {
|
|
308
|
+
runsOf(tokens, joiners, near).flatMap(({ start, end }): CapitalisedTerm[] => {
|
|
282
309
|
const first = tokens[start];
|
|
283
310
|
const last = tokens[end - 1];
|
|
284
311
|
if (first === undefined || last === undefined || !placedLikeATerm(tokens[start - 1], tokens[end])) return [];
|
|
285
312
|
if (inside(first.span.start, input.marked) || formsOf(first.surface).some((form) => divisions.has(form))) return [];
|
|
286
313
|
const term = input.source.slice(first.span.start, last.span.end);
|
|
287
|
-
if (isKnown(term) || isName(tokens, start, end, term)) return [];
|
|
314
|
+
if (isKnown(term) || isName(tokens, start, end, term) || notWrittenAsTerm(tokens, start, end, small)) return [];
|
|
288
315
|
return writtenInLowerCase(input.readable, term) ? [] : [{ offset: first.span.start, term }];
|
|
289
316
|
}),
|
|
290
317
|
);
|
|
@@ -120,8 +120,11 @@ export const isWithinSorted = (spans: readonly Span[], inner: Span): boolean =>
|
|
|
120
120
|
|
|
121
121
|
/** Columns on a line: two spaces or more, or a tab, stand between them. */
|
|
122
122
|
const COLUMN_CELL = /[^\t ]+(?: [^\t ]+)*/gu;
|
|
123
|
-
/**
|
|
124
|
-
|
|
123
|
+
/**
|
|
124
|
+
* A name in capitals, a comma, and a place or office in ordinary case, which may be followed by the member's role:
|
|
125
|
+
* JANE Q. DOE, Ohio / JOHN DOE, JR., New Mexico / MARY ANN SMITH, West Virginia, Ranking Member.
|
|
126
|
+
*/
|
|
127
|
+
const ROSTER_CELL = /^([A-Z][A-Z.'’-]*(?: [A-Z][A-Z.'’-]*)*(?:, [JS]R\.)?)(?:, \p{Lu}\p{Ll}+(?: \p{Lu}\p{Ll}+)*)+$/u;
|
|
125
128
|
|
|
126
129
|
/**
|
|
127
130
|
* The names of a roster: a column that holds a name in capitals and the member's place in ordinary case (a committee's
|
|
@@ -135,3 +138,22 @@ export const rosterNameSpans = (source: string): Span[] =>
|
|
|
135
138
|
return name === undefined ? [] : [{ start, end: start + name.length }];
|
|
136
139
|
}),
|
|
137
140
|
);
|
|
141
|
+
|
|
142
|
+
/** Square brackets on one line, and what follows them. */
|
|
143
|
+
const BRACKETS = /\[[^[\]\n]*\]/gu;
|
|
144
|
+
const LINK_AFTER = /^[(:[]/u;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Whether bracketed text holds capitals and no lower-case letter, as a placeholder does: [GRAPHIC(S) NOT AVAILABLE IN TIFF
|
|
148
|
+
* FORMAT]. The text of a Markdown link ([READ THIS](url)) is the writer's own words, so it is not one.
|
|
149
|
+
*/
|
|
150
|
+
const isCapitalPlaceholder = (bracketed: string, after: string): boolean => UPPER.test(bracketed) && !/\p{Ll}/u.test(bracketed) && !LINK_AFTER.test(after);
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Placeholders a publisher or editor puts in square brackets, wholly in capitals, for what the text leaves out (an image the
|
|
154
|
+
* text edition drops, a name withheld for review). Brackets mark an insertion that is not the writer's, so it is not shouting.
|
|
155
|
+
*/
|
|
156
|
+
export const bracketPlaceholderSpans = (source: string): Span[] =>
|
|
157
|
+
[...source.matchAll(BRACKETS)]
|
|
158
|
+
.filter((hit) => isCapitalPlaceholder(hit[0], source.slice(hit.index + hit[0].length, hit.index + hit[0].length + 1)))
|
|
159
|
+
.map((hit) => ({ start: hit.index, end: hit.index + hit[0].length }));
|