chaffjs 0.37.0 → 0.39.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 +22 -4
- package/README.md +21 -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/acronym-expansions.d.ts.map +1 -1
- package/dist/acronym-expansions.js +8 -1
- package/dist/acronym-expansions.js.map +1 -1
- package/dist/ai-score/human-shares.d.ts.map +1 -1
- package/dist/ai-score/human-shares.js +85 -16
- 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 +8 -0
- package/dist/alternative-words.d.ts.map +1 -0
- package/dist/alternative-words.js +15 -0
- package/dist/alternative-words.js.map +1 -0
- package/dist/article-h-style.d.ts +7 -0
- package/dist/article-h-style.d.ts.map +1 -0
- package/dist/article-h-style.js +12 -0
- package/dist/article-h-style.js.map +1 -0
- 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/bracket-annotation.d.ts +6 -0
- package/dist/bracket-annotation.d.ts.map +1 -0
- package/dist/bracket-annotation.js +46 -0
- package/dist/bracket-annotation.js.map +1 -0
- 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/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/compare/misopened-quotes.d.ts +7 -0
- package/dist/compare/misopened-quotes.d.ts.map +1 -0
- package/dist/compare/misopened-quotes.js +22 -0
- package/dist/compare/misopened-quotes.js.map +1 -0
- package/dist/compare/outcome.d.ts +2 -0
- package/dist/compare/outcome.d.ts.map +1 -1
- package/dist/compare/outcome.js +5 -2
- package/dist/compare/outcome.js.map +1 -1
- package/dist/compare/render.d.ts +1 -1
- package/dist/compare/render.d.ts.map +1 -1
- package/dist/compare/render.js +14 -4
- package/dist/compare/render.js.map +1 -1
- package/dist/compare/respelled.d.ts +19 -0
- package/dist/compare/respelled.d.ts.map +1 -0
- package/dist/compare/respelled.js +52 -0
- package/dist/compare/respelled.js.map +1 -0
- package/dist/compare/text-atoms.d.ts +1 -1
- package/dist/compare/text-atoms.d.ts.map +1 -1
- package/dist/compare/text-atoms.js +8 -2
- package/dist/compare/text-atoms.js.map +1 -1
- package/dist/compare/text.d.ts +2 -1
- package/dist/compare/text.d.ts.map +1 -1
- package/dist/compare/text.js +7 -2
- package/dist/compare/text.js.map +1 -1
- package/dist/contact-entry.d.ts +8 -0
- package/dist/contact-entry.d.ts.map +1 -0
- package/dist/contact-entry.js +16 -0
- package/dist/contact-entry.js.map +1 -0
- package/dist/contraction-words.d.ts +2 -0
- package/dist/contraction-words.d.ts.map +1 -0
- package/dist/contraction-words.js +11 -0
- package/dist/contraction-words.js.map +1 -0
- package/dist/derived/relative-dates.d.ts +4 -0
- package/dist/derived/relative-dates.d.ts.map +1 -1
- package/dist/derived/relative-dates.js +28 -1
- package/dist/derived/relative-dates.js.map +1 -1
- package/dist/detectors/abnf-grammar.d.ts +10 -0
- package/dist/detectors/abnf-grammar.d.ts.map +1 -0
- package/dist/detectors/abnf-grammar.js +65 -0
- package/dist/detectors/abnf-grammar.js.map +1 -0
- package/dist/detectors/acronym-context.d.ts +12 -0
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +44 -1
- 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 +52 -3
- package/dist/detectors/acronym-expansion.js.map +1 -1
- package/dist/detectors/acronym-gloss.d.ts +23 -0
- package/dist/detectors/acronym-gloss.d.ts.map +1 -0
- package/dist/detectors/acronym-gloss.js +143 -0
- package/dist/detectors/acronym-gloss.js.map +1 -0
- package/dist/detectors/acronym-known.d.ts +1 -1
- package/dist/detectors/acronym-known.d.ts.map +1 -1
- package/dist/detectors/acronym-known.js +11 -3
- package/dist/detectors/acronym-known.js.map +1 -1
- package/dist/detectors/acronym-name.d.ts +9 -2
- package/dist/detectors/acronym-name.d.ts.map +1 -1
- package/dist/detectors/acronym-name.js +13 -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/adversative-ga.d.ts +4 -0
- package/dist/detectors/adversative-ga.d.ts.map +1 -0
- package/dist/detectors/adversative-ga.js +19 -0
- package/dist/detectors/adversative-ga.js.map +1 -0
- package/dist/detectors/agreement-slip.d.ts +3 -1
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +31 -3
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/ai-phrasing.d.ts +5 -7
- package/dist/detectors/ai-phrasing.d.ts.map +1 -1
- package/dist/detectors/ai-phrasing.js +22 -18
- 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 +5 -0
- package/dist/detectors/alnum-number.d.ts.map +1 -0
- package/dist/detectors/alnum-number.js +15 -0
- package/dist/detectors/alnum-number.js.map +1 -0
- package/dist/detectors/asker-voice.d.ts +6 -0
- package/dist/detectors/asker-voice.d.ts.map +1 -0
- package/dist/detectors/asker-voice.js +18 -0
- package/dist/detectors/asker-voice.js.map +1 -0
- package/dist/detectors/bare-comparative.d.ts +12 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +77 -12
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +4 -0
- package/dist/detectors/blank-structure.js.map +1 -1
- 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 +5 -0
- package/dist/detectors/bold-emphasis.d.ts.map +1 -0
- package/dist/detectors/bold-emphasis.js +40 -0
- package/dist/detectors/bold-emphasis.js.map +1 -0
- package/dist/detectors/bold-label.d.ts +2 -0
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +2 -0
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/broken-link.d.ts.map +1 -1
- package/dist/detectors/broken-link.js +13 -4
- package/dist/detectors/broken-link.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/case-citation.d.ts +15 -0
- package/dist/detectors/case-citation.d.ts.map +1 -0
- package/dist/detectors/case-citation.js +50 -0
- package/dist/detectors/case-citation.js.map +1 -0
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +179 -28
- 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-entry.d.ts +4 -0
- package/dist/detectors/citation-entry.d.ts.map +1 -1
- package/dist/detectors/citation-entry.js +17 -5
- package/dist/detectors/citation-entry.js.map +1 -1
- package/dist/detectors/citation-marks.d.ts +8 -0
- package/dist/detectors/citation-marks.d.ts.map +1 -1
- package/dist/detectors/citation-marks.js +74 -13
- package/dist/detectors/citation-marks.js.map +1 -1
- package/dist/detectors/citation-note.d.ts +18 -0
- package/dist/detectors/citation-note.d.ts.map +1 -0
- package/dist/detectors/citation-note.js +60 -0
- package/dist/detectors/citation-note.js.map +1 -0
- package/dist/detectors/citation-string.d.ts +3 -0
- package/dist/detectors/citation-string.d.ts.map +1 -0
- package/dist/detectors/citation-string.js +34 -0
- package/dist/detectors/citation-string.js.map +1 -0
- package/dist/detectors/citation-style.d.ts.map +1 -1
- package/dist/detectors/citation-style.js +3 -1
- package/dist/detectors/citation-style.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +24 -2
- package/dist/detectors/clause-shape.js.map +1 -1
- 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/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 +16 -0
- package/dist/detectors/coordinate-adjective.d.ts.map +1 -0
- package/dist/detectors/coordinate-adjective.js +36 -0
- package/dist/detectors/coordinate-adjective.js.map +1 -0
- package/dist/detectors/date-run.d.ts +15 -0
- package/dist/detectors/date-run.d.ts.map +1 -0
- package/dist/detectors/date-run.js +35 -0
- package/dist/detectors/date-run.js.map +1 -0
- package/dist/detectors/date-year.d.ts +5 -2
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +27 -11
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/dateline.d.ts +16 -0
- package/dist/detectors/dateline.d.ts.map +1 -0
- package/dist/detectors/dateline.js +34 -0
- package/dist/detectors/dateline.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts +5 -2
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +18 -7
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-scope-unit.d.ts +9 -0
- package/dist/detectors/definition-scope-unit.d.ts.map +1 -0
- package/dist/detectors/definition-scope-unit.js +67 -0
- package/dist/detectors/definition-scope-unit.js.map +1 -0
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +11 -3
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/division-label-separator.d.ts +8 -0
- package/dist/detectors/division-label-separator.d.ts.map +1 -0
- package/dist/detectors/division-label-separator.js +22 -0
- package/dist/detectors/division-label-separator.js.map +1 -0
- package/dist/detectors/document-shape.d.ts +6 -0
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +22 -1
- package/dist/detectors/document-shape.js.map +1 -1
- package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
- package/dist/detectors/doubled-punctuation.js +16 -1
- package/dist/detectors/doubled-punctuation.js.map +1 -1
- package/dist/detectors/doubled-word.d.ts.map +1 -1
- package/dist/detectors/doubled-word.js +15 -2
- package/dist/detectors/doubled-word.js.map +1 -1
- 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 +6 -7
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +24 -24
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/empty-intensifier.d.ts +11 -0
- package/dist/detectors/empty-intensifier.d.ts.map +1 -0
- package/dist/detectors/empty-intensifier.js +28 -0
- package/dist/detectors/empty-intensifier.js.map +1 -0
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +9 -5
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/example-baseline.d.ts +7 -0
- package/dist/detectors/example-baseline.d.ts.map +1 -0
- package/dist/detectors/example-baseline.js +21 -0
- package/dist/detectors/example-baseline.js.map +1 -0
- package/dist/detectors/figure-number-list.d.ts +24 -0
- package/dist/detectors/figure-number-list.d.ts.map +1 -0
- package/dist/detectors/figure-number-list.js +78 -0
- package/dist/detectors/figure-number-list.js.map +1 -0
- package/dist/detectors/figure-order.d.ts +10 -0
- package/dist/detectors/figure-order.d.ts.map +1 -1
- package/dist/detectors/figure-order.js +36 -2
- package/dist/detectors/figure-order.js.map +1 -1
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +45 -8
- package/dist/detectors/fullwidth-alnum.js.map +1 -1
- package/dist/detectors/grade-ladder.d.ts +3 -0
- package/dist/detectors/grade-ladder.d.ts.map +1 -0
- package/dist/detectors/grade-ladder.js +19 -0
- package/dist/detectors/grade-ladder.js.map +1 -0
- package/dist/detectors/gram-furniture.d.ts +23 -1
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +79 -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-case.d.ts +7 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +10 -2
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-end-mark.d.ts.map +1 -1
- package/dist/detectors/heading-end-mark.js +9 -3
- package/dist/detectors/heading-end-mark.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/detectors/heading-numbering.js +4 -3
- package/dist/detectors/heading-numbering.js.map +1 -1
- package/dist/detectors/humble-for-others.d.ts +4 -0
- package/dist/detectors/humble-for-others.d.ts.map +1 -0
- package/dist/detectors/humble-for-others.js +53 -0
- package/dist/detectors/humble-for-others.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 +46 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -0
- package/dist/detectors/kanji-name-edge.js +94 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -0
- package/dist/detectors/kanji-run-pieces.d.ts +30 -0
- package/dist/detectors/kanji-run-pieces.d.ts.map +1 -0
- package/dist/detectors/kanji-run-pieces.js +58 -0
- package/dist/detectors/kanji-run-pieces.js.map +1 -0
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +31 -6
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lead-in-dash.d.ts +12 -0
- package/dist/detectors/lead-in-dash.d.ts.map +1 -0
- package/dist/detectors/lead-in-dash.js +50 -0
- package/dist/detectors/lead-in-dash.js.map +1 -0
- 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.map +1 -1
- package/dist/detectors/lexicon.js +19 -5
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/licence-notice.d.ts +9 -0
- package/dist/detectors/licence-notice.d.ts.map +1 -0
- package/dist/detectors/licence-notice.js +23 -0
- package/dist/detectors/licence-notice.js.map +1 -0
- package/dist/detectors/link-label.d.ts +3 -0
- package/dist/detectors/link-label.d.ts.map +1 -0
- package/dist/detectors/link-label.js +15 -0
- package/dist/detectors/link-label.js.map +1 -0
- package/dist/detectors/link-shape.d.ts +4 -1
- package/dist/detectors/link-shape.d.ts.map +1 -1
- package/dist/detectors/link-shape.js +7 -3
- package/dist/detectors/link-shape.js.map +1 -1
- package/dist/detectors/list-comma-aside.d.ts +14 -0
- package/dist/detectors/list-comma-aside.d.ts.map +1 -0
- package/dist/detectors/list-comma-aside.js +49 -0
- package/dist/detectors/list-comma-aside.js.map +1 -0
- 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 +6 -1
- package/dist/detectors/list-lead-in.d.ts.map +1 -1
- package/dist/detectors/list-lead-in.js +69 -4
- 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 +155 -21
- 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 +13 -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 +4 -1
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +28 -7
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/markdown-slip.d.ts.map +1 -1
- package/dist/detectors/markdown-slip.js +24 -10
- package/dist/detectors/markdown-slip.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts +2 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +28 -3
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-list-sentence.d.ts +3 -0
- package/dist/detectors/name-list-sentence.d.ts.map +1 -0
- package/dist/detectors/name-list-sentence.js +26 -0
- package/dist/detectors/name-list-sentence.js.map +1 -0
- 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-reference-list.d.ts +14 -0
- package/dist/detectors/name-variant-reference-list.d.ts.map +1 -0
- package/dist/detectors/name-variant-reference-list.js +21 -0
- package/dist/detectors/name-variant-reference-list.js.map +1 -0
- 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 +18 -18
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/next-word.d.ts +4 -1
- package/dist/detectors/next-word.d.ts.map +1 -1
- package/dist/detectors/next-word.js +26 -9
- package/dist/detectors/next-word.js.map +1 -1
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +16 -1
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/numbering-readings.d.ts +8 -0
- package/dist/detectors/numbering-readings.d.ts.map +1 -0
- package/dist/detectors/numbering-readings.js +17 -0
- package/dist/detectors/numbering-readings.js.map +1 -0
- package/dist/detectors/numeral-opener.d.ts +5 -2
- package/dist/detectors/numeral-opener.d.ts.map +1 -1
- package/dist/detectors/numeral-opener.js +30 -4
- package/dist/detectors/numeral-opener.js.map +1 -1
- package/dist/detectors/open-end-names.d.ts.map +1 -1
- package/dist/detectors/open-end-names.js +23 -2
- package/dist/detectors/open-end-names.js.map +1 -1
- package/dist/detectors/open-end-scope.d.ts +2 -0
- package/dist/detectors/open-end-scope.d.ts.map +1 -1
- package/dist/detectors/open-end-scope.js +22 -1
- package/dist/detectors/open-end-scope.js.map +1 -1
- package/dist/detectors/opener-phrase.d.ts +6 -0
- package/dist/detectors/opener-phrase.d.ts.map +1 -0
- package/dist/detectors/opener-phrase.js +15 -0
- package/dist/detectors/opener-phrase.js.map +1 -0
- package/dist/detectors/opener-tail.d.ts +7 -0
- package/dist/detectors/opener-tail.d.ts.map +1 -0
- package/dist/detectors/opener-tail.js +18 -0
- package/dist/detectors/opener-tail.js.map +1 -0
- package/dist/detectors/organisation-run.d.ts +8 -1
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +29 -4
- package/dist/detectors/organisation-run.js.map +1 -1
- package/dist/detectors/orthographic-variant-open.d.ts +35 -0
- package/dist/detectors/orthographic-variant-open.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-open.js +79 -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 +85 -118
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +5 -0
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/over-general-claim.d.ts +11 -0
- package/dist/detectors/over-general-claim.d.ts.map +1 -0
- package/dist/detectors/over-general-claim.js +115 -0
- package/dist/detectors/over-general-claim.js.map +1 -0
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +80 -27
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/paragraph-run.d.ts +2 -1
- package/dist/detectors/paragraph-run.d.ts.map +1 -1
- package/dist/detectors/paragraph-run.js +4 -2
- package/dist/detectors/paragraph-run.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/phrase-match.d.ts +6 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +5 -0
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +57 -1
- 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/q-fragment-answer.d.ts +15 -0
- package/dist/detectors/q-fragment-answer.d.ts.map +1 -0
- package/dist/detectors/q-fragment-answer.js +51 -0
- package/dist/detectors/q-fragment-answer.js.map +1 -0
- package/dist/detectors/quotation-paragraph.d.ts +10 -0
- package/dist/detectors/quotation-paragraph.d.ts.map +1 -0
- package/dist/detectors/quotation-paragraph.js +22 -0
- package/dist/detectors/quotation-paragraph.js.map +1 -0
- 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/quoted-sentences.d.ts +6 -0
- package/dist/detectors/quoted-sentences.d.ts.map +1 -0
- package/dist/detectors/quoted-sentences.js +61 -0
- package/dist/detectors/quoted-sentences.js.map +1 -0
- package/dist/detectors/quoted-wording.d.ts +9 -0
- package/dist/detectors/quoted-wording.d.ts.map +1 -0
- package/dist/detectors/quoted-wording.js +18 -0
- package/dist/detectors/quoted-wording.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 +7 -0
- package/dist/detectors/register-neutral-shape.d.ts.map +1 -0
- package/dist/detectors/register-neutral-shape.js +54 -0
- package/dist/detectors/register-neutral-shape.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/bold-emphasis.d.ts +3 -0
- package/dist/detectors/registry/bold-emphasis.d.ts.map +1 -0
- package/dist/detectors/registry/bold-emphasis.js +3 -0
- package/dist/detectors/registry/bold-emphasis.js.map +1 -0
- 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/empty-intensifier.d.ts +3 -0
- package/dist/detectors/registry/empty-intensifier.d.ts.map +1 -0
- package/dist/detectors/registry/empty-intensifier.js +3 -0
- package/dist/detectors/registry/empty-intensifier.js.map +1 -0
- package/dist/detectors/registry/humble-for-others.d.ts +3 -0
- package/dist/detectors/registry/humble-for-others.d.ts.map +1 -0
- package/dist/detectors/registry/humble-for-others.js +3 -0
- package/dist/detectors/registry/humble-for-others.js.map +1 -0
- package/dist/detectors/registry/ngram-repetition.js +1 -1
- package/dist/detectors/registry/ngram-repetition.js.map +1 -1
- package/dist/detectors/registry/over-general-claim.d.ts +3 -0
- package/dist/detectors/registry/over-general-claim.d.ts.map +1 -0
- package/dist/detectors/registry/over-general-claim.js +3 -0
- package/dist/detectors/registry/over-general-claim.js.map +1 -0
- 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/q-fragment-answer.d.ts +3 -0
- package/dist/detectors/registry/q-fragment-answer.d.ts.map +1 -0
- package/dist/detectors/registry/q-fragment-answer.js +3 -0
- package/dist/detectors/registry/q-fragment-answer.js.map +1 -0
- 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/registry/unused-definition.d.ts.map +1 -1
- package/dist/detectors/registry/unused-definition.js +2 -2
- package/dist/detectors/registry/unused-definition.js.map +1 -1
- package/dist/detectors/registry/weasel-word.d.ts +3 -0
- package/dist/detectors/registry/weasel-word.d.ts.map +1 -0
- package/dist/detectors/registry/weasel-word.js +3 -0
- package/dist/detectors/registry/weasel-word.js.map +1 -0
- package/dist/detectors/relative-dates.d.ts.map +1 -1
- package/dist/detectors/relative-dates.js +1 -0
- package/dist/detectors/relative-dates.js.map +1 -1
- package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -1
- package/dist/detectors/relative-pronoun-mix.js +9 -2
- package/dist/detectors/relative-pronoun-mix.js.map +1 -1
- package/dist/detectors/reported-speech.d.ts +14 -0
- package/dist/detectors/reported-speech.d.ts.map +1 -0
- package/dist/detectors/reported-speech.js +36 -0
- package/dist/detectors/reported-speech.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +7 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +45 -2
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/revision-date.d.ts +30 -0
- package/dist/detectors/revision-date.d.ts.map +1 -0
- package/dist/detectors/revision-date.js +55 -0
- package/dist/detectors/revision-date.js.map +1 -0
- package/dist/detectors/sentence-counts.d.ts +7 -2
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +31 -7
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +13 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +55 -10
- 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 +40 -4
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-load.d.ts +8 -4
- package/dist/detectors/sentence-load.d.ts.map +1 -1
- package/dist/detectors/sentence-load.js +9 -7
- package/dist/detectors/sentence-load.js.map +1 -1
- package/dist/detectors/sentence-parts.d.ts +9 -0
- package/dist/detectors/sentence-parts.d.ts.map +1 -0
- package/dist/detectors/sentence-parts.js +62 -0
- package/dist/detectors/sentence-parts.js.map +1 -0
- package/dist/detectors/sentence-title.d.ts +19 -0
- package/dist/detectors/sentence-title.d.ts.map +1 -0
- package/dist/detectors/sentence-title.js +53 -0
- package/dist/detectors/sentence-title.js.map +1 -0
- package/dist/detectors/signals.d.ts +4 -2
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +30 -175
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/spreadsheet-grid.d.ts +3 -0
- package/dist/detectors/spreadsheet-grid.d.ts.map +1 -0
- package/dist/detectors/spreadsheet-grid.js +16 -0
- package/dist/detectors/spreadsheet-grid.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +13 -18
- 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 +32 -13
- 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-phrase.d.ts +14 -0
- package/dist/detectors/superlative-phrase.d.ts.map +1 -0
- package/dist/detectors/superlative-phrase.js +52 -0
- package/dist/detectors/superlative-phrase.js.map +1 -0
- package/dist/detectors/superlative-scope.d.ts +7 -2
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +35 -7
- 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 +10 -1
- package/dist/detectors/titled-run.d.ts.map +1 -1
- package/dist/detectors/titled-run.js +21 -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 +36 -12
- 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/typewritten.d.ts +3 -0
- package/dist/detectors/typewritten.d.ts.map +1 -0
- package/dist/detectors/typewritten.js +6 -0
- package/dist/detectors/typewritten.js.map +1 -0
- package/dist/detectors/undefined-term.d.ts +7 -1
- package/dist/detectors/undefined-term.d.ts.map +1 -1
- package/dist/detectors/undefined-term.js +34 -11
- package/dist/detectors/undefined-term.js.map +1 -1
- package/dist/detectors/unfilled-placeholder.d.ts +4 -1
- package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
- package/dist/detectors/unfilled-placeholder.js +8 -3
- package/dist/detectors/unfilled-placeholder.js.map +1 -1
- package/dist/detectors/unknown-word-context.d.ts +28 -0
- package/dist/detectors/unknown-word-context.d.ts.map +1 -0
- package/dist/detectors/unknown-word-context.js +89 -0
- package/dist/detectors/unknown-word-context.js.map +1 -0
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +16 -11
- 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/detectors/unused-definition-kept.d.ts +12 -0
- package/dist/detectors/unused-definition-kept.d.ts.map +1 -0
- package/dist/detectors/unused-definition-kept.js +61 -0
- package/dist/detectors/unused-definition-kept.js.map +1 -0
- package/dist/detectors/weasel-word.d.ts +3 -0
- package/dist/detectors/weasel-word.d.ts.map +1 -0
- package/dist/detectors/weasel-word.js +22 -0
- package/dist/detectors/weasel-word.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/document.d.ts.map +1 -1
- package/dist/document.js +10 -5
- package/dist/document.js.map +1 -1
- package/dist/field-label-heading.d.ts +8 -0
- package/dist/field-label-heading.d.ts.map +1 -0
- package/dist/field-label-heading.js +32 -0
- package/dist/field-label-heading.js.map +1 -0
- 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/furigana.d.ts +2 -2
- package/dist/furigana.d.ts.map +1 -1
- package/dist/furigana.js +9 -5
- package/dist/furigana.js.map +1 -1
- package/dist/genre-load.d.ts.map +1 -1
- package/dist/genre-load.js +3 -2
- package/dist/genre-load.js.map +1 -1
- package/dist/heading-numbering.d.ts +9 -2
- package/dist/heading-numbering.d.ts.map +1 -1
- package/dist/heading-numbering.js +55 -11
- package/dist/heading-numbering.js.map +1 -1
- package/dist/honorific-group.d.ts +8 -0
- package/dist/honorific-group.d.ts.map +1 -0
- package/dist/honorific-group.js +15 -0
- package/dist/honorific-group.js.map +1 -0
- package/dist/html/html-elements.d.ts +1 -0
- package/dist/html/html-elements.d.ts.map +1 -1
- package/dist/html/html-elements.js +1 -1
- package/dist/html/html-elements.js.map +1 -1
- package/dist/html/html-footnote-marks.d.ts.map +1 -1
- package/dist/html/html-footnote-marks.js +10 -4
- package/dist/html/html-footnote-marks.js.map +1 -1
- package/dist/html/html-heading-links.d.ts +2 -5
- package/dist/html/html-heading-links.d.ts.map +1 -1
- package/dist/html/html-heading-links.js +19 -2
- package/dist/html/html-heading-links.js.map +1 -1
- package/dist/html/html-links.d.ts +5 -0
- package/dist/html/html-links.d.ts.map +1 -0
- package/dist/html/html-links.js +59 -0
- package/dist/html/html-links.js.map +1 -0
- package/dist/html/html-markdown.d.ts.map +1 -1
- package/dist/html/html-markdown.js +30 -35
- package/dist/html/html-markdown.js.map +1 -1
- package/dist/html/html-section-number.d.ts +5 -0
- package/dist/html/html-section-number.d.ts.map +1 -0
- package/dist/html/html-section-number.js +19 -0
- package/dist/html/html-section-number.js.map +1 -0
- 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/html/html-tables.d.ts +1 -1
- package/dist/html/html-tables.d.ts.map +1 -1
- package/dist/html/html-tables.js +24 -7
- package/dist/html/html-tables.js.map +1 -1
- package/dist/html/html-widgets.d.ts +7 -0
- package/dist/html/html-widgets.d.ts.map +1 -1
- package/dist/html/html-widgets.js +33 -2
- package/dist/html/html-widgets.js.map +1 -1
- 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/link-path.d.ts +10 -0
- package/dist/link-path.d.ts.map +1 -0
- package/dist/link-path.js +66 -0
- package/dist/link-path.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-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-form.d.ts +14 -0
- package/dist/name-word-form.d.ts.map +1 -0
- package/dist/name-word-form.js +34 -0
- package/dist/name-word-form.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/newsletter-issue.d.ts +12 -0
- package/dist/newsletter-issue.d.ts.map +1 -0
- package/dist/newsletter-issue.js +24 -0
- package/dist/newsletter-issue.js.map +1 -0
- package/dist/note-paragraphs.d.ts +8 -0
- package/dist/note-paragraphs.d.ts.map +1 -0
- package/dist/note-paragraphs.js +37 -0
- package/dist/note-paragraphs.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-runs.d.ts +8 -3
- package/dist/paragraph-runs.d.ts.map +1 -1
- package/dist/paragraph-runs.js +29 -3
- package/dist/paragraph-runs.js.map +1 -1
- package/dist/plugin.d.ts +9 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/profile/parse.d.ts.map +1 -1
- package/dist/profile/parse.js +9 -0
- package/dist/profile/parse.js.map +1 -1
- 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/return-type.d.ts +2 -0
- package/dist/return-type.d.ts.map +1 -1
- package/dist/return-type.js +34 -15
- package/dist/return-type.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/rule-offs.d.ts +6 -0
- package/dist/rule-offs.d.ts.map +1 -1
- package/dist/rule-offs.js +6 -0
- package/dist/rule-offs.js.map +1 -1
- 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 +13 -0
- 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 +31 -3
- package/dist/sentence-load.js.map +1 -1
- package/dist/single-quoted-span.d.ts +8 -0
- package/dist/single-quoted-span.d.ts.map +1 -0
- package/dist/single-quoted-span.js +30 -0
- package/dist/single-quoted-span.js.map +1 -0
- package/dist/spelling-mention.d.ts +7 -0
- package/dist/spelling-mention.d.ts.map +1 -0
- package/dist/spelling-mention.js +24 -0
- package/dist/spelling-mention.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/stage-directions.d.ts +12 -0
- package/dist/stage-directions.d.ts.map +1 -0
- package/dist/stage-directions.js +29 -0
- package/dist/stage-directions.js.map +1 -0
- package/dist/stray-space.d.ts.map +1 -1
- package/dist/stray-space.js +19 -4
- package/dist/stray-space.js.map +1 -1
- package/dist/structure/alternative-clause.d.ts +9 -0
- package/dist/structure/alternative-clause.d.ts.map +1 -0
- package/dist/structure/alternative-clause.js +43 -0
- package/dist/structure/alternative-clause.js.map +1 -0
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +7 -2
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/change-rate.d.ts.map +1 -1
- package/dist/structure/change-rate.js +20 -1
- package/dist/structure/change-rate.js.map +1 -1
- package/dist/structure/cited-document-section.d.ts.map +1 -1
- package/dist/structure/cited-document-section.js +15 -1
- package/dist/structure/cited-document-section.js.map +1 -1
- package/dist/structure/cited-elsewhere.d.ts +4 -0
- package/dist/structure/cited-elsewhere.d.ts.map +1 -0
- package/dist/structure/cited-elsewhere.js +15 -0
- package/dist/structure/cited-elsewhere.js.map +1 -0
- package/dist/structure/definition-use.d.ts +7 -4
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +32 -6
- package/dist/structure/definition-use.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 +36 -7
- package/dist/structure/issues.js.map +1 -1
- package/dist/structure/joined-labels.d.ts +8 -0
- package/dist/structure/joined-labels.d.ts.map +1 -0
- package/dist/structure/joined-labels.js +19 -0
- package/dist/structure/joined-labels.js.map +1 -0
- package/dist/structure/numbering.d.ts +10 -1
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +13 -5
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/restated-name.d.ts +7 -0
- package/dist/structure/restated-name.d.ts.map +1 -0
- package/dist/structure/restated-name.js +25 -0
- package/dist/structure/restated-name.js.map +1 -0
- package/dist/structure/summary-lines.d.ts +15 -0
- package/dist/structure/summary-lines.d.ts.map +1 -0
- package/dist/structure/summary-lines.js +19 -0
- package/dist/structure/summary-lines.js.map +1 -0
- package/dist/structure/title-lines.d.ts.map +1 -1
- package/dist/structure/title-lines.js +41 -8
- package/dist/structure/title-lines.js.map +1 -1
- package/dist/structure/unit-word.d.ts +6 -0
- package/dist/structure/unit-word.d.ts.map +1 -1
- package/dist/structure/unit-word.js +10 -0
- package/dist/structure/unit-word.js.map +1 -1
- package/dist/structure/wrapped-reference.d.ts +10 -0
- package/dist/structure/wrapped-reference.d.ts.map +1 -0
- package/dist/structure/wrapped-reference.js +17 -0
- package/dist/structure/wrapped-reference.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/subheading-line.d.ts +4 -1
- package/dist/subheading-line.d.ts.map +1 -1
- package/dist/subheading-line.js +14 -2
- package/dist/subheading-line.js.map +1 -1
- 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 +91 -3
- package/dist/topic-clause.js.map +1 -1
- package/dist/voice-parts.d.ts +12 -0
- package/dist/voice-parts.d.ts.map +1 -0
- package/dist/voice-parts.js +8 -0
- package/dist/voice-parts.js.map +1 -0
- package/dist/word-use.d.ts +51 -0
- package/dist/word-use.d.ts.map +1 -0
- package/dist/word-use.js +151 -0
- package/dist/word-use.js.map +1 -0
- package/genres.yaml +4 -0
- package/package.json +4 -3
- package/profiles/play.yaml +14 -0
- package/profiles/verse.yaml +14 -0
- package/rules/acronym-expansion-conflict.yaml +2 -2
- package/rules/adversative-ga-repeat.yaml +3 -3
- package/rules/agreement-slip.yaml +20 -7
- package/rules/ai-generated-composite.yaml +11 -3
- package/rules/ai-structure.yaml +7 -6
- package/rules/ai-tell.yaml +4 -4
- package/rules/all-caps-shouting.yaml +2 -2
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/article-sound.yaml +2 -2
- package/rules/bold-emphasis.yaml +114 -0
- package/rules/bold-label-list.yaml +38 -5
- package/rules/bracket-nesting.yaml +2 -2
- package/rules/bracket-width-consistency.yaml +11 -11
- package/rules/citation-reference-mismatch.yaml +2 -2
- package/rules/clause-chain.yaml +2 -0
- package/rules/closing-cliche.yaml +4 -5
- package/rules/closing-exhortation.yaml +74 -0
- package/rules/cold-open.yaml +95 -0
- package/rules/colloquial-opener.yaml +2 -2
- package/rules/colon-lead-in.yaml +68 -10
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +3 -2
- package/rules/contrast-framing.yaml +16 -13
- package/rules/dangling-reference.yaml +2 -2
- package/rules/date-weekday-mismatch.yaml +2 -2
- package/rules/date-without-year.yaml +5 -5
- package/rules/defined-name-repeated.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/demonstrative-opener-run.yaml +4 -2
- package/rules/doubled-punctuation.yaml +2 -2
- package/rules/doubled-word.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/empty-intensifier.yaml +3 -3
- package/rules/figure-reference-order.yaml +2 -2
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/generic-opening.yaml +63 -0
- package/rules/heading-end-punctuation-mix.yaml +2 -2
- package/rules/heading-level-skip.yaml +2 -2
- package/rules/heading-numbering-mix.yaml +20 -20
- package/rules/humble-for-others.yaml +4 -3
- package/rules/hyphen-as-dash.yaml +2 -2
- package/rules/kutoten-consistency.yaml +4 -4
- package/rules/latin-spacing.yaml +3 -2
- package/rules/link-text-url-mismatch.yaml +4 -4
- package/rules/list-item-form-mix.yaml +21 -6
- package/rules/max-kanji-continuous.yaml +36 -5
- package/rules/max-paragraph-length.yaml +2 -0
- package/rules/max-sentence-length.yaml +4 -2
- package/rules/max-ten.yaml +1 -0
- 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 +8 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/numbering-gap.yaml +2 -2
- package/rules/numeral-sentence-start.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +3 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +73 -0
- package/rules/oxford-comma-consistency.yaml +15 -3
- package/rules/proper-noun-density.yaml +14 -7
- package/rules/q-fragment-answer.yaml +69 -0
- package/rules/relative-date-mismatch.yaml +2 -2
- package/rules/repeated-sentence-ending.yaml +2 -0
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/requirement-smell.yaml +2 -2
- package/rules/return-type-mismatch.yaml +2 -2
- package/rules/rule-of-three.yaml +3 -3
- package/rules/section-length-uniformity.yaml +2 -2
- package/rules/sentence-initial-conjunction-run.yaml +2 -2
- package/rules/sentence-rhythm.yaml +7 -4
- package/rules/stray-space.yaml +2 -2
- package/rules/taigen-dome-in-prose.yaml +2 -2
- package/rules/tari-unpaired.yaml +2 -2
- package/rules/teki-overuse.yaml +2 -2
- package/rules/title-case-consistency.yaml +4 -4
- package/rules/title-length.yaml +9 -2
- package/rules/topic-predicate-distance.yaml +5 -2
- package/rules/undefined-acronym.yaml +10 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/unknown-word.yaml +2 -2
- package/rules/unprompted-denial.yaml +88 -0
- package/rules/unqualified-superlative.yaml +8 -2
- package/rules/unused-definition.yaml +2 -2
- package/rules/use-before-definition.yaml +2 -2
- package/rules/weasel-word.yaml +4 -3
- package/rules/which-that-consistency.yaml +2 -2
- package/rules/wordy-phrase.yaml +2 -2
- package/skills/chaff/SKILL.md +45 -8
- package/src/acronym-expansion.ts +57 -0
- package/src/acronym-expansions.ts +11 -1
- package/src/ai-score/human-shares.ts +85 -16
- package/src/ai-score/of-document.ts +5 -2
- package/src/alternative-words.ts +20 -0
- package/src/article-h-style.ts +16 -0
- package/src/body-section.ts +11 -2
- package/src/bracket-annotation.ts +57 -0
- 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/commands/fix-plan.ts +72 -5
- package/src/commands/test.ts +18 -2
- package/src/compare/misopened-quotes.ts +26 -0
- package/src/compare/outcome.ts +11 -2
- package/src/compare/render.ts +20 -7
- package/src/compare/respelled.ts +68 -0
- package/src/compare/text-atoms.ts +9 -2
- package/src/compare/text.ts +12 -3
- package/src/contact-entry.ts +19 -0
- package/src/contraction-words.ts +11 -0
- package/src/derived/relative-dates.ts +32 -1
- package/src/detectors/abnf-grammar.ts +79 -0
- package/src/detectors/acronym-context.ts +61 -1
- package/src/detectors/acronym-expansion.ts +57 -4
- package/src/detectors/acronym-gloss.ts +157 -0
- package/src/detectors/acronym-known.ts +11 -3
- package/src/detectors/acronym-name.ts +22 -3
- package/src/detectors/acronym-series.ts +27 -0
- package/src/detectors/adversative-ga.ts +26 -0
- package/src/detectors/agreement-slip.ts +33 -4
- package/src/detectors/ai-phrasing.ts +25 -20
- package/src/detectors/ai-structure.ts +23 -6
- package/src/detectors/alnum-number.ts +16 -0
- package/src/detectors/asker-voice.ts +24 -0
- package/src/detectors/bare-comparative.ts +103 -13
- package/src/detectors/blank-structure.ts +9 -0
- package/src/detectors/bold-emphasis-form.ts +58 -0
- package/src/detectors/bold-emphasis.ts +44 -0
- package/src/detectors/bold-label.ts +3 -0
- package/src/detectors/broken-link.ts +13 -4
- package/src/detectors/caps-caption.ts +24 -2
- package/src/detectors/case-citation.ts +70 -0
- package/src/detectors/char-shape.ts +240 -33
- package/src/detectors/chat-log-line.ts +17 -0
- package/src/detectors/citation-entry.ts +22 -7
- package/src/detectors/citation-marks.ts +97 -15
- package/src/detectors/citation-note.ts +78 -0
- package/src/detectors/citation-string.ts +36 -0
- package/src/detectors/citation-style.ts +6 -1
- package/src/detectors/clause-shape.ts +27 -2
- 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/contrast-frame.ts +65 -7
- package/src/detectors/coordinate-adjective.ts +43 -0
- package/src/detectors/date-run.ts +39 -0
- package/src/detectors/date-year.ts +44 -10
- package/src/detectors/dateline.ts +48 -0
- package/src/detectors/defined-term-form.ts +24 -7
- package/src/detectors/definition-scope-unit.ts +90 -0
- package/src/detectors/definition-use.ts +18 -5
- package/src/detectors/division-label-separator.ts +25 -0
- package/src/detectors/document-shape.ts +24 -1
- package/src/detectors/doubled-punctuation.ts +19 -1
- package/src/detectors/doubled-word.ts +21 -2
- package/src/detectors/duplicate-heading.ts +44 -15
- package/src/detectors/email-frame-words.ts +39 -0
- package/src/detectors/email-letter.ts +26 -23
- package/src/detectors/empty-intensifier.ts +36 -0
- package/src/detectors/en-shape.ts +11 -5
- package/src/detectors/example-baseline.ts +31 -0
- package/src/detectors/figure-number-list.ts +101 -0
- package/src/detectors/figure-order.ts +43 -2
- package/src/detectors/fullwidth-alnum.ts +59 -9
- package/src/detectors/grade-ladder.ts +23 -0
- package/src/detectors/gram-furniture.ts +96 -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-case.ts +11 -2
- package/src/detectors/heading-end-mark.ts +12 -4
- package/src/detectors/heading-level-skip.ts +31 -1
- package/src/detectors/heading-numbering.ts +12 -3
- package/src/detectors/humble-for-others.ts +63 -0
- package/src/detectors/hyphen-copied-text.ts +65 -0
- package/src/detectors/kanji-name-edge.ts +110 -0
- package/src/detectors/kanji-run-pieces.ts +86 -0
- package/src/detectors/kutoten-consistency.ts +36 -6
- package/src/detectors/lead-in-dash.ts +54 -0
- package/src/detectors/letter-joined-name.ts +14 -0
- package/src/detectors/lexicon.ts +27 -5
- package/src/detectors/licence-notice.ts +30 -0
- package/src/detectors/link-label.ts +17 -0
- package/src/detectors/link-shape.ts +7 -3
- package/src/detectors/list-comma-aside.ts +58 -0
- 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 +78 -3
- package/src/detectors/list-parallel.ts +175 -20
- package/src/detectors/list-run.ts +86 -0
- package/src/detectors/list-sentence.ts +13 -0
- package/src/detectors/mark-shape.ts +35 -8
- package/src/detectors/markdown-slip.ts +20 -3
- package/src/detectors/missing-final-period.ts +42 -5
- package/src/detectors/name-list-sentence.ts +28 -0
- package/src/detectors/name-run.ts +2 -1
- package/src/detectors/name-variant-reference-list.ts +34 -0
- package/src/detectors/name-variant-two-things.ts +136 -0
- package/src/detectors/name-variant.ts +18 -22
- package/src/detectors/next-word.ts +38 -9
- package/src/detectors/number-style.ts +17 -1
- package/src/detectors/numbering-readings.ts +22 -0
- package/src/detectors/numeral-opener.ts +37 -5
- package/src/detectors/open-end-names.ts +23 -2
- package/src/detectors/open-end-scope.ts +32 -2
- package/src/detectors/opener-phrase.ts +15 -0
- package/src/detectors/opener-tail.ts +19 -0
- package/src/detectors/organisation-run.ts +29 -4
- package/src/detectors/orthographic-variant-open.ts +119 -0
- package/src/detectors/orthographic-variant.ts +120 -179
- package/src/detectors/orthography.ts +4 -0
- package/src/detectors/over-general-claim.ts +145 -0
- package/src/detectors/oxford-comma.ts +85 -28
- package/src/detectors/paragraph-run.ts +11 -2
- package/src/detectors/particle-run-names.ts +17 -0
- package/src/detectors/phrase-match.ts +6 -0
- package/src/detectors/placeholder-text.ts +62 -1
- package/src/detectors/proper-noun-density.ts +109 -0
- package/src/detectors/q-fragment-answer.ts +64 -0
- package/src/detectors/quotation-paragraph.ts +28 -0
- package/src/detectors/quoted-excerpt.ts +68 -0
- package/src/detectors/quoted-sentences.ts +62 -0
- package/src/detectors/quoted-wording.ts +28 -0
- package/src/detectors/reference-entry.ts +42 -0
- package/src/detectors/register-neutral-shape.ts +66 -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/bold-emphasis.ts +4 -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/empty-intensifier.ts +4 -0
- package/src/detectors/registry/humble-for-others.ts +4 -0
- package/src/detectors/registry/ngram-repetition.ts +1 -1
- package/src/detectors/registry/over-general-claim.ts +4 -0
- package/src/detectors/registry/proper-noun-density.ts +1 -1
- package/src/detectors/registry/q-fragment-answer.ts +4 -0
- package/src/detectors/registry/topic-predicate-distance.ts +1 -1
- package/src/detectors/registry/unprompted-denial.ts +4 -0
- package/src/detectors/registry/unused-definition.ts +2 -2
- package/src/detectors/registry/weasel-word.ts +4 -0
- package/src/detectors/relative-dates.ts +1 -0
- package/src/detectors/relative-pronoun-mix.ts +12 -2
- package/src/detectors/reported-speech.ts +37 -0
- package/src/detectors/request-owner.ts +62 -2
- package/src/detectors/revision-date.ts +80 -0
- package/src/detectors/sentence-counts.ts +35 -8
- package/src/detectors/sentence-ending.ts +87 -13
- package/src/detectors/sentence-length.ts +50 -6
- package/src/detectors/sentence-load.ts +9 -8
- package/src/detectors/sentence-parts.ts +70 -0
- package/src/detectors/sentence-title.ts +70 -0
- package/src/detectors/signals.ts +34 -207
- package/src/detectors/spreadsheet-grid.ts +20 -0
- package/src/detectors/structure-tree.ts +16 -18
- package/src/detectors/structure.ts +35 -15
- package/src/detectors/superlative-clause.ts +21 -2
- package/src/detectors/superlative-context.ts +99 -0
- package/src/detectors/superlative-phrase.ts +57 -0
- package/src/detectors/superlative-scope.ts +43 -10
- package/src/detectors/team.ts +1 -50
- package/src/detectors/titled-code-citation.ts +19 -0
- package/src/detectors/titled-run.ts +31 -5
- package/src/detectors/token-shape.ts +42 -15
- package/src/detectors/topic-predicate-distance.ts +25 -0
- package/src/detectors/typewritten.ts +7 -0
- package/src/detectors/undefined-term.ts +45 -9
- package/src/detectors/unfilled-placeholder.ts +8 -3
- package/src/detectors/unknown-word-context.ts +112 -0
- package/src/detectors/unknown-word.ts +19 -12
- package/src/detectors/unprompted-denial.ts +133 -0
- package/src/detectors/unused-definition-kept.ts +80 -0
- package/src/detectors/weasel-word.ts +24 -0
- package/src/document-sections.ts +3 -1
- package/src/document.ts +17 -6
- package/src/field-label-heading.ts +41 -0
- 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/furigana.ts +9 -5
- package/src/genre-load.ts +3 -2
- package/src/heading-numbering.ts +67 -13
- package/src/honorific-group.ts +22 -0
- package/src/html/html-elements.ts +1 -1
- package/src/html/html-footnote-marks.ts +12 -4
- package/src/html/html-heading-links.ts +25 -2
- package/src/html/html-links.ts +70 -0
- package/src/html/html-markdown.ts +42 -36
- package/src/html/html-section-number.ts +20 -0
- package/src/html/html-site-chrome.ts +9 -2
- package/src/html/html-tables.ts +29 -7
- package/src/html/html-widgets.ts +48 -1
- package/src/law-title.ts +38 -0
- package/src/link-path.ts +70 -0
- package/src/name-ending-run.ts +49 -0
- package/src/name-title-slip.ts +59 -0
- package/src/name-variant-shapes.ts +58 -0
- package/src/name-word-form.ts +42 -0
- package/src/name-word-use.ts +17 -0
- package/src/newsletter-issue.ts +38 -0
- package/src/note-paragraphs.ts +48 -0
- package/src/opening-passage.ts +31 -0
- package/src/paragraph-runs.ts +38 -4
- package/src/plugin.ts +6 -0
- package/src/profile/parse.ts +11 -0
- package/src/quote-gloss.ts +11 -0
- package/src/quoted-spelling.ts +48 -0
- package/src/render/semantic.ts +2 -2
- package/src/return-type.ts +38 -16
- package/src/rule-of-three.ts +50 -0
- package/src/rule-offs.ts +10 -0
- package/src/run-semantic.ts +2 -2
- package/src/section-levels.ts +98 -0
- package/src/semantic.ts +14 -0
- package/src/sentence-load.ts +38 -4
- package/src/single-quoted-span.ts +40 -0
- package/src/spelling-mention.ts +30 -0
- package/src/spelling.ts +37 -7
- package/src/stage-directions.ts +39 -0
- package/src/stray-space.ts +24 -5
- package/src/structure/alternative-clause.ts +46 -0
- package/src/structure/build.ts +13 -2
- package/src/structure/change-rate.ts +21 -1
- package/src/structure/cited-document-section.ts +16 -1
- package/src/structure/cited-elsewhere.ts +23 -0
- package/src/structure/definition-use.ts +42 -7
- package/src/structure/issues.ts +42 -7
- package/src/structure/joined-labels.ts +24 -0
- package/src/structure/numbering.ts +23 -4
- package/src/structure/restated-name.ts +28 -0
- package/src/structure/summary-lines.ts +26 -0
- package/src/structure/title-lines.ts +40 -2
- package/src/structure/unit-word.ts +12 -0
- package/src/structure/wrapped-reference.ts +25 -0
- package/src/structure-shape/template-outline.ts +34 -0
- package/src/subheading-line.ts +17 -2
- package/src/title-case-name.ts +55 -0
- package/src/topic-clause.ts +115 -5
- package/src/voice-parts.ts +11 -0
- package/src/word-use.ts +213 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Span } from "../plugin.ts";
|
|
1
|
+
import type { LengthUnit, Span } from "../plugin.ts";
|
|
2
2
|
|
|
3
3
|
// ひな形が項目ごとに繰り返す飾り(一覧の札、リンクの文字、記号の並び)。書き手の言い回しではない。
|
|
4
4
|
|
|
@@ -22,9 +22,104 @@ export const furnitureMask = (text: string, linked: (index: number) => boolean):
|
|
|
22
22
|
return mask;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* 文の終わりの決まった結び(通知が法令の改正点を並べる「〜ものとすること。」)の範囲。項目ごとに同じ結びで終えるのは書式で、
|
|
27
|
+
* 書き手の言い回しではない。endings は語彙表の結びの書き方。
|
|
28
|
+
*/
|
|
29
|
+
export const fixedEndingSpans = (text: string, endings: readonly string[]): Span[] => {
|
|
30
|
+
const end = text.trimEnd().length;
|
|
31
|
+
return endings.filter((ending) => ending !== "" && text.slice(0, end).endsWith(ending)).map((ending) => ({ start: end - ending.length, end }));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** かぎ括弧の中(「国家公務員法等の一部を改正する法律」『…』)。引いた題や言葉で、書き手の言い回しではない。 */
|
|
35
|
+
const QUOTED = /「[^「」]*」|『[^『』]*』/gu;
|
|
36
|
+
|
|
37
|
+
export const quotedSpans = (text: string): Span[] => spansOf(text, QUOTED, () => true);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 欄の名前(Cited by: footnote 2、External Links: Document)。大文字で始まる 1〜2 語にコロンが付き、後ろに値が続く。
|
|
41
|
+
* 変換が残した書式や書類の欄で、項目ごとに繰り返す。Follow these guidelines: のような 3 語以上の導入は欄ではない。
|
|
42
|
+
*/
|
|
43
|
+
const FIELD_LABEL = /(?<![\p{L}\p{N}])\p{Lu}\p{L}*(?: \p{L}+)?:(?= \S)/gu;
|
|
44
|
+
|
|
45
|
+
export const fieldLabelSpans = (text: string, unit: LengthUnit): Span[] => (unit === "word" ? spansOf(text, FIELD_LABEL, () => true) : []);
|
|
46
|
+
|
|
25
47
|
/** 窓の中の空白でない文字の過半が飾りなら、その出現は飾り。 */
|
|
26
48
|
export const isFurniture = (text: string, mask: readonly boolean[], window: Span): boolean => {
|
|
27
49
|
const visible = Array.from({ length: window.end - window.start }, (_, step) => window.start + step).filter((index) => !/\s/u.test(text[index] ?? ""));
|
|
28
50
|
const marked = visible.filter((index) => mask[index] === true);
|
|
29
51
|
return visible.length > 0 && marked.length * 2 > visible.length;
|
|
30
52
|
};
|
|
53
|
+
|
|
54
|
+
/** 引いた題の後ろの結びとして読む長さ(を確認してください。は 10 文字)。これより長ければ、題の後ろに書き手の文が続いている。 */
|
|
55
|
+
const QUOTE_CLOSING_MAX = 12;
|
|
56
|
+
/**
|
|
57
|
+
* 題を受ける格助詞(を、が、に、で、へ)一つと、述語だけ。助詞が無ければ引いた語が述語の一部(「実行」してまいります)で、
|
|
58
|
+
* 二つ目の助詞があれば書き手が別のことを足している(「…支援」に力を尽くしてまいります)。
|
|
59
|
+
*/
|
|
60
|
+
const QUOTE_CLOSING = new RegExp(String.raw`[」』]([をがにでへ][^「」『』、,。.をがにでへ]{1,${String(QUOTE_CLOSING_MAX - 1)}}[。.]?)\s*$`, "u");
|
|
61
|
+
|
|
62
|
+
const closingAfterQuote = (text: string): Span | undefined => {
|
|
63
|
+
const match = QUOTE_CLOSING.exec(text);
|
|
64
|
+
return match === null ? undefined : { start: match.index + 1, end: match.index + match[0].length };
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const closingTextOf = (text: string): string | undefined => {
|
|
68
|
+
const span = closingAfterQuote(text);
|
|
69
|
+
return span === undefined ? undefined : text.slice(span.start, span.end).trimEnd();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 文書が参照の書式として使う結び: 引いた題の直後で結ぶことが、その結びで終わる文の過半である結び(詳しくは「…」を確認してください。)。
|
|
74
|
+
* 引いた名前の後ろにたまたま来た書き手の結び(「生涯活躍のまち」を推進している。のほかは整備を推進している。)は、ほとんどが題の後ろではない。
|
|
75
|
+
*/
|
|
76
|
+
export const referenceClosings = (texts: readonly string[]): ReadonlySet<string> => {
|
|
77
|
+
const afterQuote = texts.flatMap((text) => closingTextOf(text) ?? []);
|
|
78
|
+
return new Set(
|
|
79
|
+
[...new Set(afterQuote)].filter((closing) => {
|
|
80
|
+
const quoted = afterQuote.filter((each) => each === closing).length;
|
|
81
|
+
const ending = texts.filter((text) => text.trimEnd().endsWith(closing)).length;
|
|
82
|
+
return quoted * 2 > ending;
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 引いた題で終わる文の結び(詳しくは「入力可能な文字」を確認してください。)の範囲。手引きは別のページを指すたびに同じ結びで指す。
|
|
89
|
+
* closings(referenceClosings)にある結びだけを、参照の書式として数えない。
|
|
90
|
+
*/
|
|
91
|
+
export const quotedClosingSpans = (text: string, closings: ReadonlySet<string>): Span[] => {
|
|
92
|
+
const span = closingAfterQuote(text);
|
|
93
|
+
const closing = closingTextOf(text);
|
|
94
|
+
return span !== undefined && closing !== undefined && closings.has(closing) ? [span] : [];
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** 文書の中の番号の付いた部分を指す語(Section 3.1 の Section)。 */
|
|
98
|
+
const PART_LABELS = new Set([
|
|
99
|
+
"section",
|
|
100
|
+
"sections",
|
|
101
|
+
"table",
|
|
102
|
+
"tables",
|
|
103
|
+
"figure",
|
|
104
|
+
"figures",
|
|
105
|
+
"fig.",
|
|
106
|
+
"chapter",
|
|
107
|
+
"chapters",
|
|
108
|
+
"appendix",
|
|
109
|
+
"appendices",
|
|
110
|
+
"annex",
|
|
111
|
+
"part",
|
|
112
|
+
"parts",
|
|
113
|
+
]);
|
|
114
|
+
|
|
115
|
+
/** 語と、その後ろの番号(3.1、2b、B)。語が PART_LABELS にあれば文書の部分を指す名前。 */
|
|
116
|
+
const LABEL_AND_NUMBER = /\b([A-Z][a-z]+\.?)\s+(?:\d+(?:\.\d+)*[a-z]?|[A-Z])\b/gu;
|
|
117
|
+
/** 表2、図1-3、第3章、第2節。 */
|
|
118
|
+
const JA_PART_REFERENCE = /[表図][\d0-9]+(?:[--..][\d0-9]+)*|第[\d0-9一二三四五六七八九十]+[章節]/gu;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 文書の部分を指す名前(Section 3.1、Table 2、Appendix B、表2、第3章)の範囲。名前と同じく、それにかかる語句
|
|
122
|
+
* (the mechanism families set out in Section 3.1)は参照の書式で、数えない。
|
|
123
|
+
*/
|
|
124
|
+
export const partReferenceSpans = (text: string, unit: LengthUnit): Span[] =>
|
|
125
|
+
unit === "word" ? spansOf(text, LABEL_AND_NUMBER, (match) => PART_LABELS.has((match[1] ?? "").toLowerCase())) : spansOf(text, JA_PART_REFERENCE, () => true);
|
|
@@ -45,6 +45,77 @@ const leadsIntoList = (section: Pick<Section, "depth" | "sentences">, source: st
|
|
|
45
45
|
return LIST_OR_TABLE_NEXT.test(source.slice(first.span.end, first.span.end + LOOKAHEAD)) ? [first] : [];
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* 識別子だけの見出し(`max-age`、【dict1】、[draft])。参照の項目の名前で、節は一つの項目の説明。
|
|
50
|
+
* 括弧の中が言葉の札(【アドバイス等】)なら、相談事例ごとに繰り返す欄の名前で、項目の名前ではない。
|
|
51
|
+
*/
|
|
52
|
+
const IDENTIFIER_HEADING = /^(?:`[^`]+`|【[\w.:/-]+】|\[[\w.:/-]+\])$/u;
|
|
53
|
+
|
|
54
|
+
/** 定義の並びの説明(「- : …」「: …」)。Markdown の定義の書き方で、項目の名前の下の行が「: 」で始まる。 */
|
|
55
|
+
const DEFINITION_LINE = /(?:^|\n)[ \t]*(?:[-*+][ \t]+)?:[ \t]*$/u;
|
|
56
|
+
const DEFINITION_REACH = 12;
|
|
57
|
+
|
|
58
|
+
const opensDefinition = (sentence: Sentence, source: string): boolean =>
|
|
59
|
+
/^\s*:\s/u.test(sentence.text) || DEFINITION_LINE.test(source.slice(Math.max(0, sentence.span.start - DEFINITION_REACH), sentence.span.start));
|
|
60
|
+
|
|
61
|
+
const BLANK_LINE = /\n[ \t]*\n/u;
|
|
62
|
+
|
|
63
|
+
/** first から始まる段落(空行まで)の文。 */
|
|
64
|
+
const paragraphFrom = (sentences: readonly Sentence[], first: Sentence, source: string): Sentence[] => {
|
|
65
|
+
const blank = source.slice(first.span.start).search(BLANK_LINE);
|
|
66
|
+
const end = blank === -1 ? source.length : first.span.start + blank;
|
|
67
|
+
return sentences.filter((sentence) => sentence.span.start >= first.span.start && sentence.span.start < end);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 参照の項目の説明の段落: 識別子だけの見出しの節の最初の段落と、定義の並びの説明の段落。参照の項目は同じ枠で書く
|
|
72
|
+
* (…ことを示します、…の有効なソースを指定します、…は冗長な表現です。…を省き簡潔な表現にすると…)。並んだ項目のどれも同じ書き方なのは
|
|
73
|
+
* 書式で、読み手は項目を一つずつ引く。
|
|
74
|
+
*/
|
|
75
|
+
export const entryOpeners = (sections: readonly Pick<Section, "heading" | "sentences">[], source: string): Sentence[] =>
|
|
76
|
+
sections.flatMap((section) => {
|
|
77
|
+
const first = section.sentences[0];
|
|
78
|
+
const starts = [
|
|
79
|
+
...(first !== undefined && IDENTIFIER_HEADING.test(section.heading.trim()) ? [first] : []),
|
|
80
|
+
...section.sentences.filter((sentence) => opensDefinition(sentence, source)),
|
|
81
|
+
];
|
|
82
|
+
return starts.flatMap((start) => paragraphFrom(section.sentences, start, source));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const FRAGMENT_END = /[\p{P}\p{S}]\s*$/u;
|
|
86
|
+
const NOUN_END = new Set(["NOUN", "PROPN", "NUM"]);
|
|
87
|
+
const LINE_END_NEXT = /^[ \t]*(?:\n|$)/u;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 句点の無い、名詞で終わる一行(「e-Govアカウント仮登録入力画面で入力されたメールアドレス」)。文ではなく、表の欄や項目の名前。
|
|
91
|
+
* 変換が表を段落に崩しても、欄の値は行ごとに同じ言い回しを持つ。品詞が無ければ見分けない。
|
|
92
|
+
*/
|
|
93
|
+
export const nounFragments = (sentences: readonly Sentence[], source: string): Sentence[] =>
|
|
94
|
+
sentences.filter((sentence) => {
|
|
95
|
+
const last = sentence.tokens?.filter((token) => token.pos !== "PUNCT" && token.pos !== "SYM").at(-1);
|
|
96
|
+
return (
|
|
97
|
+
last !== undefined &&
|
|
98
|
+
NOUN_END.has(last.pos) &&
|
|
99
|
+
!FRAGMENT_END.test(sentence.text) &&
|
|
100
|
+
LINE_END_NEXT.test(source.slice(sentence.span.end, sentence.span.end + LOOKAHEAD))
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
|
|
48
104
|
/** 節のひな形の文: 一覧を導く節の最初の文と、項目ごとの見出し(itemTitles)。 */
|
|
49
105
|
export const sectionOpeners = (sections: readonly Pick<Section, "depth" | "sentences">[], source: string): Set<Sentence> =>
|
|
50
106
|
new Set(sections.flatMap((section) => [...leadsIntoList(section, source), ...itemTitles(section.sentences, source)]));
|
|
107
|
+
|
|
108
|
+
/** 表の一行の前の欄の数。2 つ続けば欄の並び(件名、送信先)で、名前の一行に本文が続く小見出しの形とは違う。 */
|
|
109
|
+
const CELLS_BEFORE = 2;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 句点の無い名詞の一行(nounFragments)が 2 つ続いた直後の、一行の文(「…が完了した旨を通知する。」)。表を段落に崩すと、
|
|
113
|
+
* 行の最後の欄(目的、説明)は文になっても、行ごとに同じ枠で書く欄の値。
|
|
114
|
+
*/
|
|
115
|
+
export const rowEndCells = (sentences: readonly Sentence[], fragments: ReadonlySet<Sentence>, source: string): Sentence[] =>
|
|
116
|
+
sentences.filter(
|
|
117
|
+
(sentence, index) =>
|
|
118
|
+
index >= CELLS_BEFORE &&
|
|
119
|
+
sentences.slice(index - CELLS_BEFORE, index).every((cell) => fragments.has(cell)) &&
|
|
120
|
+
LINE_END_NEXT.test(source.slice(sentence.span.end, sentence.span.end + LOOKAHEAD)),
|
|
121
|
+
);
|
|
@@ -25,15 +25,28 @@ const inCoordinatedNoun = (tokens: readonly Token[], index: number, unit: Length
|
|
|
25
25
|
NOUNS.has(tokens[index + 1]?.pos ?? "") &&
|
|
26
26
|
!isDependentNoun(tokens[index + 1]);
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* 英語の大文字だけの語(AI、API)は略語の名前。解析器が動詞と読んでも(AI を ain't の ai と読む)述語ではない。
|
|
30
|
+
* 強調と分かった普通の語(NEVER、START)は除く。
|
|
31
|
+
*/
|
|
32
|
+
const ACRONYM = /^\p{Lu}[\p{Lu}\p{N}]+s?$/u;
|
|
33
|
+
|
|
34
|
+
const acronymAt = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean => {
|
|
35
|
+
const token = tokens[index];
|
|
36
|
+
return unit === "word" && token !== undefined && ACRONYM.test(token.surface) && token.features?.["Emph"] !== "Yes";
|
|
37
|
+
};
|
|
38
|
+
|
|
28
39
|
/**
|
|
29
40
|
* 英語で名詞のすぐ前の動詞は、名詞を飾る語(形容詞を挟んでも同じ)(the upcoming fiscal year、the Disclosing Party、the borrow checker)で、
|
|
30
41
|
* 述語ではない。日本語の名詞の前の動詞(〜にあるコンポーネント)は言い回しの一部になるので、接続詞の後ろの用語の中(inCoordinatedNoun)だけを外す。
|
|
31
42
|
*/
|
|
32
43
|
const modifiesNoun = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean =>
|
|
33
|
-
(unit === "word" && tokens[index]?.pos === "VERB" && NOUNS.has(tokens[index + 1]?.pos ?? "")
|
|
44
|
+
(unit === "word" && tokens[index]?.pos === "VERB" && (NOUNS.has(tokens[index + 1]?.pos ?? "") || acronymAt(tokens, index + 1, unit))) ||
|
|
45
|
+
inCoordinatedNoun(tokens, index, unit);
|
|
34
46
|
|
|
35
|
-
/** 英語で大文字の名前の一部になった動詞(Procedures Guide、the Location Object)も、述語ではない。 */
|
|
36
|
-
const namePartAt = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean =>
|
|
47
|
+
/** 英語で大文字の名前の一部になった動詞(Procedures Guide、the Location Object)と略語(AI)も、述語ではない。 */
|
|
48
|
+
const namePartAt = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean =>
|
|
49
|
+
unit === "word" && (isNamePart(tokens, index) || acronymAt(tokens, index, unit));
|
|
37
50
|
|
|
38
51
|
const isName = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean => {
|
|
39
52
|
const token = tokens[index];
|
|
@@ -71,19 +84,49 @@ const OBJECT_START = new Set(["DET", "PRON", "NUM"]);
|
|
|
71
84
|
* 英語で、窓の最後の名詞の形の動詞の前が名詞と形容詞だけ(先頭の冠詞は許す)で、後ろに目的語が続かなければ、動詞は名詞の続きの
|
|
72
85
|
* 読み違い(the federal funds rate の rate、small business subcontracting)。窓の中に機能語があれば言い回し(your contract says)。
|
|
73
86
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (unit !== "word" || verb?.pos !== "VERB" || !isNounShaped(verb) || OBJECT_START.has(tokens[index + 1]?.pos ?? "")) return false;
|
|
87
|
+
/** 窓の最後の語が index で、その前が名詞と形容詞だけの用語(先頭の冠詞は許す)か。 */
|
|
88
|
+
const closesTerm = (tokens: readonly Token[], index: number, window: Span): boolean => {
|
|
77
89
|
const touched = tokens.flatMap((token, at) => (overlaps(token, window) ? [at] : []));
|
|
78
90
|
if (touched.at(-1) !== index) return false;
|
|
79
91
|
const before = touched.slice(0, -1).filter((at, order) => !(order === 0 && tokens[at]?.pos === "DET"));
|
|
80
92
|
return before.length >= MIN_COMPOUND_WORDS && before.every((at) => COMPOUND_POS.has(tokens[at]?.pos ?? ""));
|
|
81
93
|
};
|
|
82
94
|
|
|
95
|
+
const endsNounCompound = (tokens: readonly Token[], index: number, window: Span, unit: LengthUnit): boolean => {
|
|
96
|
+
const verb = tokens[index];
|
|
97
|
+
if (unit !== "word" || verb?.pos !== "VERB" || !isNounShaped(verb) || OBJECT_START.has(tokens[index + 1]?.pos ?? "")) return false;
|
|
98
|
+
return closesTerm(tokens, index, window);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const BE = new Set(["be", "is", "are", "was", "were"]);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 英語で、用語のすぐ後ろの be で窓が終わる(the anticipatory mode is)。繰り返しているのは主語の用語で、be はその後ろに何を言うかの
|
|
105
|
+
* 入り口にすぎない。言い回しなら be の後ろまで同じになる。
|
|
106
|
+
*/
|
|
107
|
+
const copulaAfterTerm = (tokens: readonly Token[], index: number, window: Span, unit: LengthUnit): boolean => {
|
|
108
|
+
const token = tokens[index];
|
|
109
|
+
return unit === "word" && token !== undefined && BE.has(token.lemma ?? token.surface.toLowerCase()) && closesTerm(tokens, index, window);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** 名詞の入る所の始まり: 前置詞と接続詞(of、that、because)、限定詞、what、読点でない句読点(: の後ろ)。 */
|
|
113
|
+
const NOUN_SLOT_OPENERS = new Set(["ADP", "SCONJ", "DET", "PRON"]);
|
|
114
|
+
|
|
115
|
+
const opensNounSlot = (token: Token | undefined): boolean =>
|
|
116
|
+
token !== undefined && (NOUN_SLOT_OPENERS.has(token.pos) || (token.pos === "PUNCT" && token.surface !== ","));
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 英語で、名詞の入る所に置いた -ing 形(what occupying the anticipatory mode requires、: occupying the … is)は行為の名前で、
|
|
120
|
+
* 文書の用語として繰り返す。述語ではない。文頭と読点の後ろの -ing 形は分詞の節(Using the form, send …)と見分けられないので外さない。
|
|
121
|
+
*/
|
|
122
|
+
const gerundAsNoun = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean =>
|
|
123
|
+
unit === "word" && tokens[index]?.features?.["VerbForm"] === "Ger" && opensNounSlot(tokens[index - 1]);
|
|
124
|
+
|
|
83
125
|
const countsAsPredicate = (tokens: readonly Token[], index: number, window: Span, unit: LengthUnit): boolean => {
|
|
84
126
|
const token = tokens[index];
|
|
85
127
|
if (token === undefined || !PREDICATE_POS.has(token.pos) || !overlaps(token, window)) return false;
|
|
86
128
|
if (modifiesNoun(tokens, index, unit) || namePartAt(tokens, index, unit) || endsNounCompound(tokens, index, window, unit)) return false;
|
|
129
|
+
if (gerundAsNoun(tokens, index, unit) || copulaAfterTerm(tokens, index, window, unit)) return false;
|
|
87
130
|
return !isCut(token, window) || !onlyNamesBeside(tokens, index, window, unit);
|
|
88
131
|
};
|
|
89
132
|
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { wordsOf } from "./structure.ts";
|
|
2
|
+
import { MIN_DOCUMENT_LENGTH } from "./signals.ts";
|
|
3
|
+
import { compacted, linkedIn, placeAt } from "./gram-place.ts";
|
|
4
|
+
import { charWindows, wordWindows } from "./gram-windows.ts";
|
|
5
|
+
import {
|
|
6
|
+
fieldLabelSpans,
|
|
7
|
+
fixedEndingSpans,
|
|
8
|
+
furnitureMask,
|
|
9
|
+
isFurniture,
|
|
10
|
+
partReferenceSpans,
|
|
11
|
+
quotedClosingSpans,
|
|
12
|
+
quotedSpans,
|
|
13
|
+
referenceClosings,
|
|
14
|
+
} from "./gram-furniture.ts";
|
|
15
|
+
import { hasPredicateIn } from "./gram-predicate.ts";
|
|
16
|
+
import { gramPassagesOf } from "./gram-passages.ts";
|
|
17
|
+
import { entryOpeners, nounFragments, rowEndCells, sectionOpeners } from "./gram-openers.ts";
|
|
18
|
+
import { nameSpans, touchesAny } from "../team-names.ts";
|
|
19
|
+
import type { Detector, Finding, LengthUnit, ProseDocument, Sentence, Span, StructureNode } from "../plugin.ts";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 同じ言い回しの繰り返し。文字の並びで見るので、adapter の語の区切り(wordSplit)が要らない。英語の窓は空白で語の切れ目にそろえる。
|
|
23
|
+
* spec §10 が n-gram を選んだのはこのためで、新しい言語でそのまま動く。
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* 窓の幅は単位で分ける。同じ 8 文字でも、日本語では 4〜5 形態素だが英語では 1 語半にしかならない。
|
|
27
|
+
* 英語の窓は語の切れ目にそろえ、18 文字に届くまで語を足す。文字で切ると " generat" のような語の断片が上位に来る。
|
|
28
|
+
* 18 は、文字で切っていた頃の 20 文字の窓から前後の空白を除いた長さ(" juxtaposed to said ")。
|
|
29
|
+
*/
|
|
30
|
+
const GRAM = { char: 8, word: 18 };
|
|
31
|
+
|
|
32
|
+
const windowsOf = (text: string, unit: LengthUnit): Span[] => (unit === "char" ? charWindows(text, GRAM.char) : wordWindows(text, GRAM.word));
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 名前ではなく言い回しだけを数える。実文書で測ったら、上位は
|
|
36
|
+
* 「AGENTS.m」「シンギュラリティ」のような固有名詞と識別子だった。名前は繰り返して当たり前。
|
|
37
|
+
*
|
|
38
|
+
* 言い回しは、その言語の「つなぎの材料」を含む。日本語ならひらがな、英語なら語の切れ目。
|
|
39
|
+
* どちらを見るかは adapter が宣言する単位で決める。ひらがなを持たない char 単位の言語が
|
|
40
|
+
* 来たら、この見分けは効かなくなる(そのときは adapter 側に判定を移す)。
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* つなぎが 1 つでは足りない。「detectorは」は用語に助詞が 1 つ付いただけで、
|
|
44
|
+
* 繰り返して当たり前の**用語**であって言い回しではない。
|
|
45
|
+
* 実文書で測ると、本物の言い回しはひらがなを 7 つ前後含み、用語+助詞は 1〜2 だった。
|
|
46
|
+
*/
|
|
47
|
+
const CONNECTIVE = { char: /[ぁ-ゖ].*[ぁ-ゖ].*[ぁ-ゖ]/u, word: /\S \S.*\S \S/u };
|
|
48
|
+
|
|
49
|
+
const isPhrasing = (gram: string, unit: LengthUnit): boolean => CONNECTIVE[unit].test(gram);
|
|
50
|
+
|
|
51
|
+
/** 英語は大文字と小文字を区別せずに数える。文頭の "Proposals submitted via" も文中の "proposals submitted via" も同じ言い回し。 */
|
|
52
|
+
const keyOf = (gram: string, unit: LengthUnit): string => (unit === "word" ? gram.toLowerCase() : gram);
|
|
53
|
+
|
|
54
|
+
/** 文書が定義した語(以下「X」という、「X」とは)。定義した語は言い換えられない名前で、繰り返して当たり前。 */
|
|
55
|
+
const definedTerms = (node: StructureNode | undefined): string[] => {
|
|
56
|
+
if (node === undefined) return [];
|
|
57
|
+
const term = node.kind === "definition" ? node.attrs["term"] : undefined;
|
|
58
|
+
return [...(typeof term === "string" ? [term] : []), ...node.children.flatMap(definedTerms)];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const namesOf = (doc: ProseDocument): readonly string[] => {
|
|
62
|
+
const names = [...(doc.names ?? []), ...definedTerms(doc.structure)];
|
|
63
|
+
return doc.lengthUnit === "char" ? names.map((name) => name.replace(/\s+/gu, "")) : names;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** 語彙表 ngram-fixed-ending: 項目ごとに同じ形で結ぶ書式の結び(〜ものとすること。)。 */
|
|
67
|
+
const fixedEndingsOf = (doc: ProseDocument): string[] => (doc.lexicons["ngram-fixed-ending"] ?? []).map((entry) => entry.pattern);
|
|
68
|
+
|
|
69
|
+
/** 語句の出現。書かれたままの語句と、文と、文の中の範囲(sentence.text の位置)。 */
|
|
70
|
+
type Occurrence = { readonly gram: string; readonly sentence: Sentence; readonly place: Span | undefined };
|
|
71
|
+
|
|
72
|
+
type Tally = Map<string, Occurrence[]>;
|
|
73
|
+
|
|
74
|
+
type Context = {
|
|
75
|
+
readonly doc: ProseDocument;
|
|
76
|
+
readonly names: readonly string[];
|
|
77
|
+
readonly endings: readonly string[];
|
|
78
|
+
readonly closings: ReadonlySet<string>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** 数えない範囲: 名前(触れる窓を外す)と、飾り(過半を覆う窓を外す)。 */
|
|
82
|
+
const excludedIn = (context: Context, sentence: Sentence, text: string, source: ReturnType<typeof compacted>): { named: Span[]; mask: boolean[] } => {
|
|
83
|
+
const unit = context.doc.lengthUnit;
|
|
84
|
+
const named = [...nameSpans(text, context.names), ...fieldLabelSpans(text, unit), ...partReferenceSpans(text, unit)];
|
|
85
|
+
const mask = furnitureMask(text, linkedIn(context.doc, sentence, source));
|
|
86
|
+
[...fixedEndingSpans(text, context.endings), ...quotedSpans(text), ...quotedClosingSpans(text, context.closings)].forEach((span) =>
|
|
87
|
+
mask.fill(true, span.start, span.end),
|
|
88
|
+
);
|
|
89
|
+
return { named, mask };
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 文をまたいで数えない。文の終わりと次の文の始まりが繋がると、固有名詞が言い回しに見える。
|
|
94
|
+
* 一つの文の中の繰り返しは 1 回と数える。一つの文で項目を並べる(平成25年度に指定が解除された…、平成26年度に指定が解除された…)のは並べ方で、言い直しではない。
|
|
95
|
+
* 並べた名前にかかる語句も数えない。名前が繰り返されれば、その前後(「the …」)も一緒に繰り返されるのは当たり前。
|
|
96
|
+
* 一覧の飾り(gram-furniture.ts)も数えない。項目ごとに繰り返すのはひな形で、書き手ではない。
|
|
97
|
+
*/
|
|
98
|
+
const tallySentence = (context: Context, sentence: Sentence, tally: Tally): void => {
|
|
99
|
+
const unit = context.doc.lengthUnit;
|
|
100
|
+
const source = compacted(sentence.text, unit);
|
|
101
|
+
const { named, mask } = excludedIn(context, sentence, source.text, source);
|
|
102
|
+
const seen = new Set<string>();
|
|
103
|
+
windowsOf(source.text, unit)
|
|
104
|
+
.filter((window) => !touchesAny(named, window.start, window.end) && !isFurniture(source.text, mask, window))
|
|
105
|
+
.forEach((window) => {
|
|
106
|
+
const gram = source.text.slice(window.start, window.end);
|
|
107
|
+
const key = keyOf(gram, unit);
|
|
108
|
+
if (seen.has(key)) return;
|
|
109
|
+
seen.add(key);
|
|
110
|
+
const occurrence = { gram, sentence, place: placeAt(source, window) };
|
|
111
|
+
const list = tally.get(key);
|
|
112
|
+
if (list === undefined) tally.set(key, [occurrence]);
|
|
113
|
+
else list.push(occurrence);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const gramsOf = (context: Context, sentences: readonly Sentence[]): Tally => {
|
|
118
|
+
const tally: Tally = new Map();
|
|
119
|
+
sentences.forEach((sentence) => tallySentence(context, sentence, tally));
|
|
120
|
+
return tally;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* ひな形の文: 参照の項目の説明の段落(`max-age` の節、定義の並びの「: 」)と、句点の無い名詞で終わる一行(表の欄、項目の名前)と、その欄が
|
|
125
|
+
* 2 つ続いた後ろの一行の文(表の行の最後の欄)。
|
|
126
|
+
* ここに出るのは書式の繰り返しで、ここに出たぶんは数えない。
|
|
127
|
+
*/
|
|
128
|
+
const templatesOf = (doc: ProseDocument): ReadonlySet<Sentence> => {
|
|
129
|
+
const fragments = new Set(nounFragments(doc.sentences, doc.source));
|
|
130
|
+
return new Set([...entryOpeners(doc.sections, doc.source), ...fragments, ...rowEndCells(doc.sentences, fragments, doc.source)]);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** 文書の題(一番上の見出し)。題にある言い回しは文書の主題で、繰り返して当たり前(CCライセンスを付与する際の…)。 */
|
|
134
|
+
const titleOf = (doc: ProseDocument): string =>
|
|
135
|
+
keyOf(
|
|
136
|
+
doc.sections
|
|
137
|
+
.filter((section) => section.depth === 1)
|
|
138
|
+
.map((section) => compacted(section.heading, doc.lengthUnit).text)
|
|
139
|
+
.join("\n"),
|
|
140
|
+
doc.lengthUnit,
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
type Repeat = { readonly key: string; readonly occurrences: readonly Occurrence[] };
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 範囲(gram-passages.ts)ごとに数える。よくある質問の別々の答えは別の範囲。節の最初の文(gram-openers.ts)にだけ出るものは節のひな形。
|
|
147
|
+
* 節の書き出しは書き手の地の文でもあるので、ほかの所にも出れば書き出しのぶんも数える(節ごとの口癖)。
|
|
148
|
+
*/
|
|
149
|
+
const repeatsOf = (doc: ProseDocument, limit: number): Repeat[] => {
|
|
150
|
+
const closings = referenceClosings(doc.sentences.map((sentence) => compacted(sentence.text, doc.lengthUnit).text));
|
|
151
|
+
const context = { doc, names: namesOf(doc), endings: fixedEndingsOf(doc), closings };
|
|
152
|
+
const templates = templatesOf(doc);
|
|
153
|
+
const openers = sectionOpeners(doc.sections, doc.source);
|
|
154
|
+
const title = titleOf(doc);
|
|
155
|
+
return gramPassagesOf(doc.sections).flatMap((sentences) =>
|
|
156
|
+
[...gramsOf(context, sentences).entries()].flatMap(([key, all]) => {
|
|
157
|
+
const occurrences = all.filter((occurrence) => !templates.has(occurrence.sentence));
|
|
158
|
+
const opensEverySection = occurrences.every((occurrence) => openers.has(occurrence.sentence));
|
|
159
|
+
return occurrences.length > limit && isPhrasing(key, doc.lengthUnit) && !title.includes(key) && !opensEverySection ? [{ key, occurrences }] : [];
|
|
160
|
+
}),
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const predicateAt = (occurrence: Occurrence, unit: LengthUnit): boolean | undefined => {
|
|
165
|
+
const { sentence, place } = occurrence;
|
|
166
|
+
if (sentence.tokens === undefined || place === undefined) return undefined;
|
|
167
|
+
const start = sentence.span.start;
|
|
168
|
+
return hasPredicateIn(sentence.tokens, { start: start + place.start, end: start + place.end }, unit);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 語句が文の中で占める範囲に、述語になる動詞か助動詞があるか(gram-predicate.ts)。出現ごとに見て、半分以上にあれば言い回し。
|
|
173
|
+
* 解析器は同じ語を所によって読み違える(adverse health effects they believe の effects を動詞と読む)。一つの出現では決めない。
|
|
174
|
+
* 品詞が無ければ見分けられないので、これまでどおり言い回しとして数える。
|
|
175
|
+
*/
|
|
176
|
+
const hasPredicate = (occurrences: readonly Occurrence[], unit: LengthUnit): boolean => {
|
|
177
|
+
const judged = occurrences.map((occurrence) => predicateAt(occurrence, unit)).filter((found) => found !== undefined);
|
|
178
|
+
return judged.length === 0 || judged.filter(Boolean).length * 2 >= judged.length;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const ngramRepetition: Detector = (doc, options): Finding[] => {
|
|
182
|
+
if (wordsOf(doc) < MIN_DOCUMENT_LENGTH[doc.lengthUnit]) return [];
|
|
183
|
+
const worst = repeatsOf(doc, options.limit)
|
|
184
|
+
.toSorted((left, right) => right.occurrences.length - left.occurrences.length)
|
|
185
|
+
.find(({ occurrences }) => hasPredicate(occurrences, doc.lengthUnit));
|
|
186
|
+
if (worst === undefined) return [];
|
|
187
|
+
const first = worst.occurrences.find((occurrence) => occurrence.place !== undefined) ?? worst.occurrences[0];
|
|
188
|
+
const at = first?.sentence;
|
|
189
|
+
return [
|
|
190
|
+
{
|
|
191
|
+
rule: "ngram-repetition",
|
|
192
|
+
severity: "info",
|
|
193
|
+
line: 0,
|
|
194
|
+
column: 0,
|
|
195
|
+
quote: at?.text.trim() ?? worst.key,
|
|
196
|
+
values: { word: first?.gram ?? worst.key, count: worst.occurrences.length, limit: options.limit, offset: at?.span.start ?? 0 },
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
};
|
|
@@ -60,10 +60,19 @@ export const isTitleCase = (heading: string, fixedCase: ReadonlySet<string> = ne
|
|
|
60
60
|
* 見出しより前の導入部(深さ 0)は見出しではないので数えない。
|
|
61
61
|
*/
|
|
62
62
|
export const pageTitleOf = <T extends { readonly depth: number }>(sections: readonly T[]): T | undefined => {
|
|
63
|
+
const title = enclosingHeadingOf(sections);
|
|
64
|
+
return title?.depth === TITLE_DEPTH ? title : undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The first heading, when no other heading is as shallow: it encloses every other heading, so it names the document even
|
|
69
|
+
* below depth 1 ("### §1030. Fraud…" over the notes' "#### Amendments") and after a preamble that is not a heading.
|
|
70
|
+
*/
|
|
71
|
+
export const enclosingHeadingOf = <T extends { readonly depth: number }>(sections: readonly T[]): T | undefined => {
|
|
63
72
|
const headed = sections.filter((section) => section.depth > 0);
|
|
64
73
|
const first = headed[0];
|
|
65
|
-
if (first
|
|
66
|
-
return
|
|
74
|
+
if (first === undefined || headed.some((section) => section !== first && section.depth <= first.depth)) return undefined;
|
|
75
|
+
return first;
|
|
67
76
|
};
|
|
68
77
|
|
|
69
78
|
export type CaseCounts = { readonly titleCase: number; readonly sentenceCase: number };
|
|
@@ -2,6 +2,7 @@ import type { Detector, Finding, MarkupHeading, ProseDocument } from "../plugin.
|
|
|
2
2
|
import { findingAt, writtenHeadings } from "./markup-finding.ts";
|
|
3
3
|
import { pageTitleOf } from "./heading-case.ts";
|
|
4
4
|
import { minorityWithin } from "../orthography.ts";
|
|
5
|
+
import { isFieldLabel } from "../field-label-heading.ts";
|
|
5
6
|
|
|
6
7
|
/** A mark a heading may end with or go without: a colon or a full stop, in either width. A question mark belongs to the words. */
|
|
7
8
|
const END_MARK = /[::.。]$/u;
|
|
@@ -37,7 +38,8 @@ export const endMarkOf = (heading: string, words: readonly string[] = []): strin
|
|
|
37
38
|
return END_MARK.exec(shown)?.[0] ?? "";
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
/** label: the heading labels a field's value (isFieldLabel), and is compared only with other labels. */
|
|
42
|
+
type Judged = { readonly heading: MarkupHeading; readonly mark: string; readonly label: boolean };
|
|
41
43
|
|
|
42
44
|
const LOWER_CASE = /\p{Ll}/u;
|
|
43
45
|
/** A word of this many capitals is a word set in capitals, not only an acronym (AGENCY, DATES; not FAQ). */
|
|
@@ -49,8 +51,14 @@ const CAPITALS_WORD = /\p{Lu}{4,}/u;
|
|
|
49
51
|
*/
|
|
50
52
|
export const isCapitalsHeading = (heading: string): boolean => !LOWER_CASE.test(heading) && CAPITALS_WORD.test(heading);
|
|
51
53
|
|
|
52
|
-
/** Headings compared with one another: the same depth,
|
|
53
|
-
const kindOf = (entry: Judged): string => `${String(entry.heading.depth)}:${String(isCapitalsHeading(entry.heading.text))}`;
|
|
54
|
+
/** Headings compared with one another: the same depth, the same case (capitals or ordinary), and labels apart from titles. */
|
|
55
|
+
const kindOf = (entry: Judged): string => `${String(entry.heading.depth)}:${String(isCapitalsHeading(entry.heading.text))}:${String(entry.label)}`;
|
|
56
|
+
|
|
57
|
+
/** The text under a heading, up to the next heading of any depth or the end of the document. */
|
|
58
|
+
const bodyOf = (doc: ProseDocument, heading: MarkupHeading): string => {
|
|
59
|
+
const next = (doc.markup?.headings ?? []).map((other) => other.start).filter((start) => start >= heading.end);
|
|
60
|
+
return doc.source.slice(heading.end, next.length === 0 ? doc.source.length : Math.min(...next));
|
|
61
|
+
};
|
|
54
62
|
|
|
55
63
|
/** The odd ones among headings of one kind, each with the usual side's first heading and count. */
|
|
56
64
|
const oddOfKind = (doc: ProseDocument, judged: readonly Judged[]): Finding[] => {
|
|
@@ -81,7 +89,7 @@ export const headingEndMark: Detector = (doc, options): Finding[] => {
|
|
|
81
89
|
.filter((heading) => heading !== title)
|
|
82
90
|
.flatMap((heading): Judged[] => {
|
|
83
91
|
const mark = endMarkOf(heading.text, words);
|
|
84
|
-
return mark === undefined ? [] : [{ heading, mark }];
|
|
92
|
+
return mark === undefined ? [] : [{ heading, mark, label: isFieldLabel(heading.text, bodyOf(doc, heading)) }];
|
|
85
93
|
});
|
|
86
94
|
const kinds = [...new Set(judged.map(kindOf))];
|
|
87
95
|
return kinds
|
|
@@ -3,6 +3,36 @@ import { findingAt, markupOf } from "./markup-finding.ts";
|
|
|
3
3
|
|
|
4
4
|
export type SkippedHeading = { readonly heading: MarkupHeading; readonly from: number };
|
|
5
5
|
|
|
6
|
+
/** 「1 」「2.1 」「4.2.1. 」のような節番号で始まる見出し。全角の数字と句点も数える。 */
|
|
7
|
+
const SECTION_NUMBER = /^([0-90-9]{1,3}(?:[..][0-90-9]{1,3})*)[..]?\s/u;
|
|
8
|
+
const NUMBERED_OUTLINE_MIN_HEADINGS = 3;
|
|
9
|
+
|
|
10
|
+
/** 節番号の桁の数(「2.1」は 2)。番号で始まらない見出しは 0。 */
|
|
11
|
+
const numberParts = (heading: MarkupHeading): number => SECTION_NUMBER.exec(heading.text.trim())?.[1]?.split(/[..]/u).length ?? 0;
|
|
12
|
+
|
|
13
|
+
const isNumbered = (heading: MarkupHeading): boolean => numberParts(heading) > 0;
|
|
14
|
+
|
|
15
|
+
/** 桁の多い番号ほど深い段にある(「1」の下に「1.1」)。版番号「1.0.0」が並ぶだけの変更履歴は入れ子ではない。 */
|
|
16
|
+
const isNestedNumbering = (numbered: readonly MarkupHeading[]): boolean =>
|
|
17
|
+
numbered.some((outer) => numbered.some((inner) => numberParts(inner) > numberParts(outer) && inner.depth > outer.depth));
|
|
18
|
+
|
|
19
|
+
/** 節番号が入れ子で振られた文書で、番号の付いた見出しのうち一番深い段。そうでない文書は undefined。 */
|
|
20
|
+
const deepestNumberedDepth = (headings: readonly MarkupHeading[]): number | undefined => {
|
|
21
|
+
const numbered = headings.filter(isNumbered);
|
|
22
|
+
return numbered.length >= NUMBERED_OUTLINE_MIN_HEADINGS && isNestedNumbering(numbered) ? Math.max(...numbered.map((heading) => heading.depth)) : undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 文書の骨組みになる見出し。文字の無い見出し(プレスリリースの終わりの印「###」)は見出しではない。
|
|
27
|
+
* 節番号が入れ子で振られた文書では番号が骨組みなので、一番深い番号より深い番号無しの見出しは段落の頭の小見出し
|
|
28
|
+
* (LaTeX の \paragraph、論文の HTML が h6 にする「Abstract」)で、深さを比べない。
|
|
29
|
+
*/
|
|
30
|
+
export const outlineHeadings = (headings: readonly MarkupHeading[]): MarkupHeading[] => {
|
|
31
|
+
const titled = headings.filter((heading) => heading.text.trim() !== "");
|
|
32
|
+
const deepest = deepestNumberedDepth(titled);
|
|
33
|
+
return deepest === undefined ? titled : titled.filter((heading) => heading.depth <= deepest || isNumbered(heading));
|
|
34
|
+
};
|
|
35
|
+
|
|
6
36
|
/**
|
|
7
37
|
* 一つ前の見出しより二段以上深い見出し(## の次の ####)。最初の見出しは何段から始めてもよい。
|
|
8
38
|
* 飛んだ後は、飛んだ先の深さを基準にする(#### の次の #### は飛んでいない)。markdownlint の MD001 と同じ数え方。
|
|
@@ -14,6 +44,6 @@ export const skippedHeadings = (headings: readonly MarkupHeading[]): SkippedHead
|
|
|
14
44
|
});
|
|
15
45
|
|
|
16
46
|
export const headingLevelSkip: Detector = (doc): Finding[] =>
|
|
17
|
-
skippedHeadings(markupOf(doc)?.headings ?? []).map(({ heading, from }) =>
|
|
47
|
+
skippedHeadings(outlineHeadings(markupOf(doc)?.headings ?? [])).map(({ heading, from }) =>
|
|
18
48
|
findingAt(doc, heading, { heading: heading.text, from, to: heading.depth, expected: from + 1 }),
|
|
19
49
|
);
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { Detector, Finding, LexiconEntry } from "../plugin.ts";
|
|
2
2
|
import { findingAt, writtenHeadings } from "./markup-finding.ts";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
numberingMinorities,
|
|
5
|
+
numberingStyleOf,
|
|
6
|
+
numberMarkOf,
|
|
7
|
+
opensNumbering,
|
|
8
|
+
UNNUMBERED,
|
|
9
|
+
type NumberingMinority,
|
|
10
|
+
type NumberLabel,
|
|
11
|
+
} from "../heading-numbering.ts";
|
|
4
12
|
|
|
5
13
|
const labelsOf = (entries: readonly LexiconEntry[]): NumberLabel[] =>
|
|
6
14
|
entries.map((entry) => ({ word: entry.pattern, position: entry.position === "after" ? "after" : "before" }));
|
|
7
15
|
|
|
8
|
-
/**
|
|
9
|
-
const AFTER_MATTER = /^[\s::、]/u;
|
|
16
|
+
/** 前後の見出しの語のあとに続いてよい区切りか番号(「付録: 用語」「Appendix A」「図1」)。 */
|
|
17
|
+
const AFTER_MATTER = /^[\s::、0-90-9]/u;
|
|
10
18
|
|
|
11
19
|
/** 番号を付けない前後の見出し(目次・参考文献・付録 A)か。言葉全体が語彙表の語か、語彙表の語に区切りが続くとき。 */
|
|
12
20
|
const isFrontOrBackMatter = (text: string, words: readonly string[]): boolean => {
|
|
@@ -33,6 +41,7 @@ export const headingNumbering: Detector = (doc): Finding[] => {
|
|
|
33
41
|
style: styles[at] ?? UNNUMBERED,
|
|
34
42
|
skipped: isFrontOrBackMatter(heading.text, matter),
|
|
35
43
|
opens: opensNumbering(heading.text, labels),
|
|
44
|
+
mark: numberMarkOf(heading.text, labels),
|
|
36
45
|
}));
|
|
37
46
|
return numberingMinorities(read).flatMap((minority) => {
|
|
38
47
|
const heading = headings[minority.at];
|