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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// name-variant: a slip in one word of a title the document repeats ("National Industrial Recover Act" once beside
|
|
2
|
+
// "National Industrial Recovery Act"). A title of a law or a body ends in a head word (Act, Commission) and is made of
|
|
3
|
+
// ordinary words, which the tagger may read as a verb (Recover), so it is read from the capitals, not from the tagger. Pure.
|
|
4
|
+
import { isEndLetterApart } from "./name-end-letter.ts";
|
|
5
|
+
import { isNearWord } from "./name-variants.ts";
|
|
6
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
7
|
+
|
|
8
|
+
export type TitleSlip = { readonly offset: number; readonly surface: string; readonly usual: string };
|
|
9
|
+
|
|
10
|
+
/** A title has two words or more before its head: two-word titles (Trade Act, Power Act) are often two laws. */
|
|
11
|
+
const MIN_TITLE_WORDS = 3;
|
|
12
|
+
const WORD = "\\p{Lu}[\\p{L}'’]*";
|
|
13
|
+
|
|
14
|
+
type Title = { readonly offset: number; readonly words: readonly string[] };
|
|
15
|
+
|
|
16
|
+
/** Runs of capitalised words ending in a head word, and each tail of them of MIN_TITLE_WORDS words or more. */
|
|
17
|
+
const titlesIn = (text: string, heads: readonly string[]): Title[] => {
|
|
18
|
+
if (heads.length === 0) return [];
|
|
19
|
+
const head = heads.map(escapeRegExp).join("|");
|
|
20
|
+
const pattern = new RegExp(`(?<![\\p{L}'’-])(?:${WORD}[ \\t]+){${String(MIN_TITLE_WORDS - 1)},}(?:${head})(?![\\p{L}'’-])`, "gu");
|
|
21
|
+
return [...text.matchAll(pattern)].flatMap((found) => {
|
|
22
|
+
const placed = [...found[0].matchAll(/\S+/gu)].map((word) => ({ word: word[0], offset: (found.index ?? 0) + (word.index ?? 0) }));
|
|
23
|
+
const words = placed.map(({ word }) => word);
|
|
24
|
+
return placed.slice(0, words.length - MIN_TITLE_WORDS + 1).map(({ offset }, index) => ({ offset, words: words.slice(index) }));
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** One word, lower-cased, one letter apart: replaced, swapped or dropped inside, or its last letter dropped or added (not s). */
|
|
29
|
+
const isWordSlip = (word: string, usual: string): boolean => {
|
|
30
|
+
const [left, right] = [word.toLowerCase(), usual.toLowerCase()];
|
|
31
|
+
return isNearWord(left, right) || isEndLetterApart(left, right);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Whether words is usual with one word other than the head slipped. */
|
|
35
|
+
const isSlipOf = (words: readonly string[], usual: readonly string[]): boolean => {
|
|
36
|
+
if (words.length !== usual.length || words.at(-1) !== usual.at(-1)) return false;
|
|
37
|
+
const differing = words.flatMap((word, index) => (word === usual[index] ? [] : [index]));
|
|
38
|
+
const [at] = differing;
|
|
39
|
+
return differing.length === 1 && at !== undefined && isWordSlip(words[at] ?? "", usual[at] ?? "");
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Titles written once that are a repeated title (two times or more) with one word slipped. A title is read at its longest
|
|
44
|
+
* tail that matches: "the National Industrial Recover Act" is compared as "National Industrial Recover Act".
|
|
45
|
+
*/
|
|
46
|
+
export const titleSlipsIn = (text: string, heads: readonly string[]): TitleSlip[] => {
|
|
47
|
+
const titles = titlesIn(text, heads);
|
|
48
|
+
const counts = new Map<string, number>();
|
|
49
|
+
titles.forEach((title) => counts.set(title.words.join(" "), (counts.get(title.words.join(" ")) ?? 0) + 1));
|
|
50
|
+
const repeated = [...counts].flatMap(([surface, count]) => (count >= 2 ? [surface.split(" ")] : []));
|
|
51
|
+
const slips = titles.flatMap((title): TitleSlip[] => {
|
|
52
|
+
const surface = title.words.join(" ");
|
|
53
|
+
const usual = counts.get(surface) === 1 ? repeated.find((words) => isSlipOf(title.words, words)) : undefined;
|
|
54
|
+
return usual === undefined ? [] : [{ offset: title.offset, surface, usual: usual.join(" ") }];
|
|
55
|
+
});
|
|
56
|
+
return slips.filter(
|
|
57
|
+
(slip) => !slips.some((other) => other.offset < slip.offset && other.offset + other.surface.length === slip.offset + slip.surface.length),
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// name-variant: pairs that look like one name written two ways but are two things — a list mark inside two ordinary words,
|
|
2
|
+
// one direction and its inverse, a word and its form with another ending, a word capitalised by its place. Pure.
|
|
3
|
+
|
|
4
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
5
|
+
|
|
6
|
+
const LOWER = /\p{Ll}/u;
|
|
7
|
+
const UPPER = /\p{Lu}/u;
|
|
8
|
+
/** Capitals after a surname prefix: three or more, so a product name ending in an acronym (MacOS) stays a name. */
|
|
9
|
+
const CAPITALS_AFTER = /^\p{Lu}{3,}$/u;
|
|
10
|
+
const WORD_BREAK = /[\s&・-]+/u;
|
|
11
|
+
|
|
12
|
+
/** A word in capitals, or in capitals after a surname prefix from the lexicon name-capitals-prefix (McCAUL, DesJARLAIS). */
|
|
13
|
+
const isCapitalsWord = (word: string, prefixes: readonly string[]): boolean =>
|
|
14
|
+
!LOWER.test(word) || prefixes.some((prefix) => word.startsWith(prefix) && CAPITALS_AFTER.test(word.slice(prefix.length)));
|
|
15
|
+
|
|
16
|
+
/** Whether a name is set in capitals, as a roster sets it (MICHAEL T. McCAUL, SCOTT DesJARLAIS). */
|
|
17
|
+
export const isSetInCapitals = (surface: string, prefixes: readonly string[]): boolean =>
|
|
18
|
+
UPPER.test(surface) && surface.split(WORD_BREAK).every((word) => isCapitalsWord(word, prefixes));
|
|
19
|
+
|
|
20
|
+
const HAN = /\p{Script=Han}/u;
|
|
21
|
+
const LIST_MARK = "・";
|
|
22
|
+
|
|
23
|
+
/** Whether name differs from usual only by ・ placed between two kanji (動物園・水族館): the mark lists two things there. */
|
|
24
|
+
export const isListedPair = (name: string, usual: string): boolean => {
|
|
25
|
+
const [marked, plain] = name.length > usual.length ? [name, usual] : [usual, name];
|
|
26
|
+
const chars = [...marked];
|
|
27
|
+
const between = chars.some((char, index) => char === LIST_MARK && HAN.test(chars[index - 1] ?? "") && HAN.test(chars[index + 1] ?? ""));
|
|
28
|
+
return between && marked.replaceAll(LIST_MARK, "") === plain;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const LETTERS = /^\p{Script=Latin}+$/u;
|
|
32
|
+
|
|
33
|
+
/** The two sides of a direction word. A word in Latin letters stands between spaces (to, not the "to" in Toronto). */
|
|
34
|
+
const sidesOf = (name: string, direction: string): readonly string[] => {
|
|
35
|
+
const word = escapeRegExp(direction);
|
|
36
|
+
const separator = LETTERS.test(direction) ? new RegExp(`\\s+${word}\\s+`, "u") : new RegExp(word, "u");
|
|
37
|
+
return name.split(separator).map((side) => side.trim());
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Whether name and usual are one pair of words in the two orders around a word of direction (ASCII to binary, binary to ASCII). */
|
|
41
|
+
export const isInverseOrder = (name: string, usual: string, directions: readonly string[]): boolean =>
|
|
42
|
+
directions.some((direction) => {
|
|
43
|
+
const [from, to, ...rest] = sidesOf(name, direction);
|
|
44
|
+
const [usualFrom, usualTo, ...usualRest] = sidesOf(usual, direction);
|
|
45
|
+
return rest.length === 0 && usualRest.length === 0 && from !== "" && to !== "" && from === usualTo && to === usualFrom;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/** An ending a word may take instead of another (Texas, Texan; Romans, Romano): from the lexicon name-word-ending. */
|
|
49
|
+
export type WordEnding = { readonly ending: string; readonly insteadOf: string };
|
|
50
|
+
|
|
51
|
+
const ONE_WORD = /^\p{L}+$/u;
|
|
52
|
+
|
|
53
|
+
/** Whether two one-word names differ only in a last letter that the lexicon calls another form of the word (Texan for Texas). */
|
|
54
|
+
export const isOtherEnding = (name: string, usual: string, endings: readonly WordEnding[]): boolean => {
|
|
55
|
+
if (!ONE_WORD.test(name) || !ONE_WORD.test(usual) || name.length !== usual.length || name.slice(0, -1) !== usual.slice(0, -1)) return false;
|
|
56
|
+
const [nameEnd, usualEnd] = [name.slice(-1).toLowerCase(), usual.slice(-1).toLowerCase()];
|
|
57
|
+
return endings.some(({ ending, insteadOf }) => (ending === nameEnd && insteadOf === usualEnd) || (ending === usualEnd && insteadOf === nameEnd));
|
|
58
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// name-variant points at a name one letter away from a more frequent one. Two one-word names that are forms of one
|
|
2
|
+
// dictionary word are two words, not one name written two ways: a people and its country (Germans, Germany), a singular
|
|
3
|
+
// and its plural (Englishman, Englishmen), the people and the act (Crusaders, Crusades). Pure.
|
|
4
|
+
import { isKnownWord, type Speller, type Suffix } from "./spelling.ts";
|
|
5
|
+
import { usualIsMisspelt, type IsKnown } from "./name-misspelt-usual.ts";
|
|
6
|
+
|
|
7
|
+
/** A stem shorter than this is too short to say two words share it (bed, beds). */
|
|
8
|
+
const MIN_STEM = 3;
|
|
9
|
+
const ONE_WORD = /^\p{L}+$/u;
|
|
10
|
+
|
|
11
|
+
/** The word with one ending taken off (germans → german, englishmen → englishman), at least MIN_STEM letters long. */
|
|
12
|
+
const stemsOf = (word: string, suffixes: readonly Suffix[]): string[] =>
|
|
13
|
+
suffixes.flatMap(({ suffix, replacement }) =>
|
|
14
|
+
word.endsWith(suffix) && word.length - suffix.length >= MIN_STEM ? [`${word.slice(0, word.length - suffix.length)}${replacement}`] : [],
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
/** Letters the other word may add after the shared stem: Germany after german, crusades after crusade. Marker and Market (mark + et) share only a start. */
|
|
18
|
+
const MAX_ADDED = 1;
|
|
19
|
+
|
|
20
|
+
/** Whether word, with an ending taken off, is a dictionary word that other is, or is with one letter added. */
|
|
21
|
+
const isFormOf = (word: string, other: string, suffixes: readonly Suffix[], isKnown: IsKnown): boolean =>
|
|
22
|
+
stemsOf(word, suffixes).some((stem) => stem !== word && isKnown(stem) && other.startsWith(stem) && other.length - stem.length <= MAX_ADDED);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Whether two one-word names are forms of one dictionary word: both are dictionary words, and one of them, with its ending
|
|
26
|
+
* taken off, is the other, or the other less its last letter. Two names that are both in the dictionary but share no stem (Anderson, Andersen)
|
|
27
|
+
* are still a slip.
|
|
28
|
+
*/
|
|
29
|
+
export const areWordForms = (name: string, usual: string, suffixes: readonly Suffix[], isKnown: IsKnown): boolean => {
|
|
30
|
+
const [left, right] = [name.toLowerCase(), usual.toLowerCase()];
|
|
31
|
+
if (!ONE_WORD.test(left) || !ONE_WORD.test(right) || !isKnown(left) || !isKnown(right)) return false;
|
|
32
|
+
return isFormOf(left, right, suffixes, isKnown) || isFormOf(right, left, suffixes, isKnown);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Whether the dictionary says two forms are not one name written two ways: the usual form is a repeated slip of the
|
|
37
|
+
* pointed form's dictionary word (name-misspelt-usual.ts), or the two are forms of one word.
|
|
38
|
+
*/
|
|
39
|
+
export const isDictionaryPair = (name: string, usual: string, speller: Speller): boolean => {
|
|
40
|
+
const isKnown = (word: string): boolean => isKnownWord(word, speller);
|
|
41
|
+
return usualIsMisspelt(name, usual, isKnown) || areWordForms(name, usual, speller.suffixes, isKnown);
|
|
42
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Token } from "./plugin.ts";
|
|
2
|
+
import type { WordUse } from "./name-end-letter.ts";
|
|
3
|
+
import { isOrdinaryToken } from "./name-ordinary-word.ts";
|
|
4
|
+
|
|
5
|
+
// name-variant: how the document uses its Latin words, read from the tagger's tokens. Pure.
|
|
6
|
+
|
|
7
|
+
const LATIN_WORD = /^[A-Za-z]+$/u;
|
|
8
|
+
const LOWERCASE_WORD = /^[a-z]+$/u;
|
|
9
|
+
|
|
10
|
+
/** 文書が小文字で書くか、品詞解析が普通名詞と読む英字の語(文頭の Hurricane)。 */
|
|
11
|
+
const isCommonToken = (token: Token): boolean => LOWERCASE_WORD.test(token.surface) || (token.pos === "NOUN" && LATIN_WORD.test(token.surface));
|
|
12
|
+
|
|
13
|
+
/** 文書での英字の語の使い方。名前と読んだ語のうち小文字で書けばふつうの語と、普通名詞として書いた語。tokens は文書の語。 */
|
|
14
|
+
export const wordUseOf = (tokens: readonly Token[]): WordUse => ({
|
|
15
|
+
ordinary: new Set(tokens.flatMap((token) => (isOrdinaryToken(token) ? [token.surface.toLowerCase()] : []))),
|
|
16
|
+
common: new Set(tokens.flatMap((token) => (isCommonToken(token) ? [token.surface.toLowerCase()] : []))),
|
|
17
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// A newsletter's issue (メールマガジン第90号, Vol. 12): an issue number in the title. Pure. The words
|
|
2
|
+
// come from the language's newsletter-issue lexicon; an issue goes to every subscriber and takes no greeting and no closing.
|
|
3
|
+
import type { Lexicon } from "./plugin.ts";
|
|
4
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
5
|
+
|
|
6
|
+
/** The word before an issue's number (第, Vol.) and the one after it (号), each pair from one lexicon entry. */
|
|
7
|
+
export type IssueWords = readonly { readonly head: string; readonly tail: string }[];
|
|
8
|
+
|
|
9
|
+
const GROUP_SEPARATOR = "…";
|
|
10
|
+
|
|
11
|
+
/** Each entry's pattern is the issue number's form with … for the number (第…号, Vol. …). */
|
|
12
|
+
export const issueWordsOf = (lexicon: Lexicon): IssueWords =>
|
|
13
|
+
lexicon.flatMap((entry) => {
|
|
14
|
+
const parts = entry.pattern.split(GROUP_SEPARATOR);
|
|
15
|
+
const [head = "", tail = ""] = parts;
|
|
16
|
+
return parts.length !== 2 || head === "" ? [] : [{ head, tail }];
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const LATIN_LETTER = /^[A-Za-z]/u;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* An issue number: the head, a number, the tail, then a space, a bracket, a comma or the line's end (第90号 2025/11/12,
|
|
23
|
+
* 第506号(令和7年5月23日), Vol. 12[April]). A word after it makes it part of a name (第3号議案). A Latin head starts a
|
|
24
|
+
* word (not Tissue 3).
|
|
25
|
+
*/
|
|
26
|
+
const issuePatternOf = ({ head, tail }: IssueWords[number]): RegExp =>
|
|
27
|
+
new RegExp(`${LATIN_LETTER.test(head) ? "(?<![A-Za-z])" : ""}${escapeRegExp(head)}[0-90-9]+${escapeRegExp(tail)}(?=[\\s((【[[,、,]|$)`, "u");
|
|
28
|
+
|
|
29
|
+
/** A Markdown heading: the document's title. A subject line (件名:議案 第3号) or a citation (Vol. 12) in the body is not one. */
|
|
30
|
+
const HEADING = /^#{1,6}\s/u;
|
|
31
|
+
|
|
32
|
+
export const isHeadingLine = (line: string): boolean => HEADING.test(line.trim());
|
|
33
|
+
|
|
34
|
+
/** Whether a heading among the head lines (the lines before the first sentence) holds an issue number: the title of an issue. */
|
|
35
|
+
export const isIssueHead = (headLines: readonly string[], words: IssueWords): boolean => {
|
|
36
|
+
const patterns = words.map(issuePatternOf);
|
|
37
|
+
return headLines.some((line) => isHeadingLine(line) && patterns.some((pattern) => pattern.test(line.trim())));
|
|
38
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Paragraph, Sentence } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** 段落の頭の注の番号((1)、(2)、[3])。 */
|
|
4
|
+
const NOTE_LABEL = /^[ \t\u3000]*(?:[((]\s*(\d{1,3})\s*[))]|\[(\d{1,3})\])/u;
|
|
5
|
+
|
|
6
|
+
/** 注の並びと読む最少の数。番号の付いた段落が二つ続くだけなら、本文の (1)(2) の列挙と見分けがつかない。 */
|
|
7
|
+
const MIN_NOTES = 3;
|
|
8
|
+
|
|
9
|
+
/** 出典の印: URL か西暦の年(2020、1998)。注や文献の項目は出典を書き、本文の (1)(2) の列挙はふつう書かない。 */
|
|
10
|
+
const SOURCE_MARK = /https?:\/\/|(?<!\d)(?:1[89]|20)\d{2}(?!\d)/u;
|
|
11
|
+
|
|
12
|
+
/** 項目の半分以上が出典の印を持つ並びだけを、注や文献の一覧と読む。 */
|
|
13
|
+
const citesSources = (source: string, run: readonly Paragraph[]): boolean =>
|
|
14
|
+
run.filter((paragraph) => SOURCE_MARK.test(source.slice(paragraph.span.start, paragraph.span.end))).length * 2 >= run.length;
|
|
15
|
+
|
|
16
|
+
const labelOf = (source: string, paragraph: Paragraph): number | undefined => {
|
|
17
|
+
const match = NOTE_LABEL.exec(source.slice(paragraph.span.start, paragraph.span.end));
|
|
18
|
+
const label = match?.[1] ?? match?.[2];
|
|
19
|
+
return label === undefined ? undefined : Number(label);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** 1 から一つずつ増える番号の付いた段落の並び。番号の無い段落は間に挟まってよい。 */
|
|
23
|
+
const labelledRuns = (source: string, paragraphs: readonly Paragraph[]): Paragraph[][] =>
|
|
24
|
+
paragraphs.reduce<Paragraph[][]>((runs, paragraph) => {
|
|
25
|
+
const label = labelOf(source, paragraph);
|
|
26
|
+
if (label === undefined) return runs;
|
|
27
|
+
const run = runs.at(-1);
|
|
28
|
+
if (label === (run?.length ?? 0) + 1 && run !== undefined) run.push(paragraph);
|
|
29
|
+
else if (label === 1) runs.push([paragraph]);
|
|
30
|
+
return runs;
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
33
|
+
/** 並びの最初の番号の段落から最後の番号の段落までの段落か。番号の無い段落は、前の注の続き(文献を一行ずつ並べた段落)。 */
|
|
34
|
+
const isWithinRun = (run: readonly Paragraph[], paragraph: Paragraph): boolean =>
|
|
35
|
+
paragraph.span.start >= (run[0]?.span.start ?? Number.POSITIVE_INFINITY) && paragraph.span.start <= (run.at(-1)?.span.start ?? -1);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 注や文献の一覧の段落の文((1) 著者. 題. 誌名. 2020. / (2) …)。項目は名前や題を並べたもので、名詞で止めるのが書き方。
|
|
39
|
+
* 段落の頭に 1 から順に番号を付けた段落が MIN_NOTES 以上続き、その半分以上が出典の印(URL、西暦の年)を持つものだけを、一覧と読む。
|
|
40
|
+
* 一覧は最初の番号の段落から最後の番号の段落まで。間の番号の無い段落も、注の続きとして入れる。
|
|
41
|
+
*/
|
|
42
|
+
export const noteSentences = (source: string, paragraphs: readonly Paragraph[]): ReadonlySet<Sentence> =>
|
|
43
|
+
new Set(
|
|
44
|
+
labelledRuns(source, paragraphs)
|
|
45
|
+
.filter((run) => run.length >= MIN_NOTES && citesSources(source, run))
|
|
46
|
+
.flatMap((run) => paragraphs.filter((paragraph) => isWithinRun(run, paragraph)))
|
|
47
|
+
.flatMap((paragraph) => paragraph.sentences),
|
|
48
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { proseText } from "./measure.ts";
|
|
2
|
+
import type { ProseDocument, Sentence } from "./plugin.ts";
|
|
3
|
+
|
|
4
|
+
/** 書き出しとして読む文の数。最初の文だけでは、一般論のあとに具体が続くのか分からない。 */
|
|
5
|
+
export const OPENING_PROSE_SENTENCES = 3;
|
|
6
|
+
|
|
7
|
+
/** 文として閉じているか。日付・署名・「6 min read」のような冒頭の飾りの行は句点で終わらない。 */
|
|
8
|
+
const TERMINATED = /[。..!?!?…‥][」』】”"'))]*$/u;
|
|
9
|
+
|
|
10
|
+
const DIGIT = /[0-90-9]/u;
|
|
11
|
+
|
|
12
|
+
const isProse = (sentence: Sentence): boolean => sentence.listItem !== true && sentence.embeddedLanguage === undefined;
|
|
13
|
+
|
|
14
|
+
/** 文を含む節の終わり。次の節の文は書き出しではない。 */
|
|
15
|
+
const sectionEnd = (doc: ProseDocument, sentence: Sentence): number =>
|
|
16
|
+
doc.sections.findLast((section) => section.span.start <= sentence.span.start)?.span.end ?? doc.source.length;
|
|
17
|
+
|
|
18
|
+
/** 書き出しの文。句点で閉じた最初の本文の文から、同じ節の、箇条書きでない文を数える。無ければ空。 */
|
|
19
|
+
export const openingProse = (doc: ProseDocument): readonly Sentence[] => {
|
|
20
|
+
const start = doc.sentences.findIndex((sentence) => isProse(sentence) && TERMINATED.test(proseText(sentence)));
|
|
21
|
+
const first = doc.sentences[start];
|
|
22
|
+
if (first === undefined) return [];
|
|
23
|
+
const end = sectionEnd(doc, first);
|
|
24
|
+
return doc.sentences
|
|
25
|
+
.slice(start)
|
|
26
|
+
.filter((sentence) => isProse(sentence) && sentence.span.end <= end)
|
|
27
|
+
.slice(0, OPENING_PROSE_SENTENCES);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** 最初の文が数(日付・件数・金額)を言うなら、書き出しはもう具体から始まっている。 */
|
|
31
|
+
export const opensWithNumber = (opening: readonly Sentence[]): boolean => opening[0] !== undefined && DIGIT.test(proseText(opening[0]));
|
package/src/paragraph-runs.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Runs of one-sentence paragraphs: paragraphs that follow one another with nothing but blank lines between them, each holding a
|
|
2
2
|
// single sentence. Pure: paragraphs and the source they are cut from come in.
|
|
3
|
-
import type { Paragraph } from "./plugin.ts";
|
|
3
|
+
import type { Paragraph, Span } from "./plugin.ts";
|
|
4
4
|
|
|
5
5
|
/** A line break, then nothing but spaces (an ideographic space too), then another line break. */
|
|
6
6
|
const BLANK_LINE = /\n[^\S\n]*\n/u;
|
|
@@ -24,13 +24,47 @@ const SENTENCE_END = /[。..!?!?]["'”’」』))\]]}}】》〕〉
|
|
|
24
24
|
export const endsAsSentence = (source: string, paragraph: Paragraph): boolean =>
|
|
25
25
|
SENTENCE_END.test(source.slice(paragraph.span.start, paragraph.span.end).trim());
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* A mark a paragraph opens with to set itself out as an item (○ a case, ・ a point, ※ a note). A run of such paragraphs is a
|
|
29
|
+
* list the writer marked by hand, not prose split into one-sentence paragraphs. A doubled mark (○○県, ○●) stands for a name.
|
|
30
|
+
*/
|
|
31
|
+
const ITEM_MARK = /^[ \t\u3000]*[○◯◎●・•■□◆◇▪▫★☆▶►➢✓※*](?![○◯◎●・•■□◆◇▪▫★☆▶►➢✓※*])/u;
|
|
32
|
+
|
|
33
|
+
/** A speaker's mark in minutes (○委員長(石井章君)\u3000…): it opens a turn of speech, which is prose. */
|
|
34
|
+
const SPEAKER_MARK = /^[ \t\u3000]*[○◯〇][^\s()()、。,.「」『』::]{1,20}(?:([^)\n]{0,40}))?\u3000/u;
|
|
35
|
+
|
|
36
|
+
/** Whether a paragraph opens with an item mark rather than a speaker's mark. */
|
|
37
|
+
export const opensAsItem = (source: string, paragraph: Paragraph): boolean => {
|
|
38
|
+
const text = source.slice(paragraph.span.start, paragraph.span.end);
|
|
39
|
+
return ITEM_MARK.test(text) && !SPEAKER_MARK.test(text);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A reference list's entry label before its text ([7], [RFC2119], [WEB-ORIGIN]). Entries set one per paragraph are a list
|
|
44
|
+
* written as plain text, not prose split into one-sentence paragraphs.
|
|
45
|
+
*/
|
|
46
|
+
const REFERENCE_LABEL = /^\s*\[[^\]\s]{1,32}\]\s/u;
|
|
47
|
+
|
|
48
|
+
/** Whether a paragraph is an entry of a reference list: inside one found by its heading, or opening with an entry label. */
|
|
49
|
+
export const isReferenceEntry = (source: string, paragraph: Paragraph, referenceLists: readonly Span[]): boolean =>
|
|
50
|
+
REFERENCE_LABEL.test(source.slice(paragraph.span.start, paragraph.span.end)) ||
|
|
51
|
+
referenceLists.some((list) => list.start <= paragraph.span.start && paragraph.span.start < list.end);
|
|
52
|
+
|
|
53
|
+
/** Whether a paragraph can be counted in a run: one sentence, ending as a sentence, not an item or a reference entry. */
|
|
54
|
+
const counts = (source: string, paragraph: Paragraph, referenceLists: readonly Span[]): boolean =>
|
|
55
|
+
paragraph.sentences.length === 1 &&
|
|
56
|
+
endsAsSentence(source, paragraph) &&
|
|
57
|
+
!opensAsItem(source, paragraph) &&
|
|
58
|
+
!isReferenceEntry(source, paragraph, referenceLists);
|
|
59
|
+
|
|
27
60
|
/**
|
|
28
61
|
* Each run of adjacent one-sentence paragraphs, in document order, as the paragraphs it holds. A paragraph of two sentences or
|
|
29
|
-
* more, a paragraph that does not end as a sentence, or
|
|
62
|
+
* more, a paragraph that does not end as a sentence, opens with an item mark or is a reference list's entry, or anything
|
|
63
|
+
* between two paragraphs, ends the run.
|
|
30
64
|
*/
|
|
31
|
-
export const oneSentenceRuns = (source: string, paragraphs: readonly Paragraph[]): Paragraph[][] =>
|
|
65
|
+
export const oneSentenceRuns = (source: string, paragraphs: readonly Paragraph[], referenceLists: readonly Span[] = []): Paragraph[][] =>
|
|
32
66
|
paragraphs.reduce<Paragraph[][]>((runs, paragraph, at) => {
|
|
33
|
-
if (
|
|
67
|
+
if (!counts(source, paragraph, referenceLists)) return runs;
|
|
34
68
|
const previous = paragraphs[at - 1];
|
|
35
69
|
const current = runs.at(-1);
|
|
36
70
|
const continues = previous !== undefined && current?.at(-1) === previous && isAdjacent(source, previous, paragraph);
|
package/src/plugin.ts
CHANGED
|
@@ -247,6 +247,8 @@ export type Section = {
|
|
|
247
247
|
readonly sentences: readonly Sentence[];
|
|
248
248
|
/** この節に含まれる強調(Markdown の ** **)の数。 */
|
|
249
249
|
readonly strongCount: number;
|
|
250
|
+
/** その強調の範囲(`**` を含む、source の上)。buildDocument は必ず入れる。 */
|
|
251
|
+
readonly strongs?: readonly Span[];
|
|
250
252
|
/** 見出し直後の最初の文。heading-echo が見る。 */
|
|
251
253
|
readonly firstSentence: Sentence | undefined;
|
|
252
254
|
};
|
|
@@ -290,6 +292,10 @@ export type DocumentProfile = {
|
|
|
290
292
|
readonly walkRate?: { readonly metresPerMinute: number; readonly roundUp: boolean } | undefined;
|
|
291
293
|
/** ラベルが「消費税込み」とだけ書き、ラベルにも文書にも税率が無いときの税率(%)。 */
|
|
292
294
|
readonly taxRate?: number | undefined;
|
|
295
|
+
/** ト書きを囲む括弧(戯曲の「(」「)」)。中身は台詞の文の一部ではなく、台詞と別に文に分ける。 */
|
|
296
|
+
readonly stageDirections?: { readonly open: string; readonly close: string } | undefined;
|
|
297
|
+
/** 段落の中の行の終わりで文を切る。詩の行は句点が無くても一つで立ち、連を一つの文として読まない。 */
|
|
298
|
+
readonly lineBreaksEndSentences?: boolean | undefined;
|
|
293
299
|
};
|
|
294
300
|
|
|
295
301
|
/**
|
package/src/profile/parse.ts
CHANGED
|
@@ -37,6 +37,14 @@ const asideOf = (value: unknown): RelativeVocabulary["aside"] => {
|
|
|
37
37
|
return open === undefined || close === undefined ? undefined : { open, close };
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
const isOneChar = (value: string): boolean => [...value].length === 1;
|
|
41
|
+
|
|
42
|
+
/** 開きと閉じが、違う 1 字ずつでなければ読まない。括弧は 1 字ずつ数えて対にする。 */
|
|
43
|
+
const stageDirectionsOf = (value: unknown): DocumentProfile["stageDirections"] => {
|
|
44
|
+
const pair = asideOf(value);
|
|
45
|
+
return pair !== undefined && isOneChar(pair.open) && isOneChar(pair.close) && pair.open !== pair.close ? pair : undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
40
48
|
/** 括弧の開き・閉じと、目印が一つも無ければ読まない。 */
|
|
41
49
|
const substitutionOf = (value: unknown): RelativeVocabulary["substitution"] => {
|
|
42
50
|
if (!isRecord(value)) return undefined;
|
|
@@ -105,6 +113,7 @@ const languagesOf = (id: string, raw: Record<string, unknown>): Record<string, D
|
|
|
105
113
|
const unnumbered = unnumberedOf(section["unnumbered"]);
|
|
106
114
|
const walkRate = walkRateOf(section["walk_rate"]);
|
|
107
115
|
const taxRate = taxRateOf(section["tax_rate"]);
|
|
116
|
+
const stageDirections = stageDirectionsOf(section["stage_directions"]);
|
|
108
117
|
return [
|
|
109
118
|
language,
|
|
110
119
|
{
|
|
@@ -118,6 +127,8 @@ const languagesOf = (id: string, raw: Record<string, unknown>): Record<string, D
|
|
|
118
127
|
...(section["quote_mentions_term"] === true ? { quoteMentionsTerm: true } : {}),
|
|
119
128
|
...(walkRate === undefined ? {} : { walkRate }),
|
|
120
129
|
...(taxRate === undefined ? {} : { taxRate }),
|
|
130
|
+
...(stageDirections === undefined ? {} : { stageDirections }),
|
|
131
|
+
...(section["line_breaks_end_sentences"] === true ? { lineBreaksEndSentences: true } : {}),
|
|
121
132
|
},
|
|
122
133
|
];
|
|
123
134
|
}),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// A bracket written straight after a closing quotation mark: the quotation's reading or translation (「天子有道」(天子に道有らば)).
|
|
2
|
+
// It renders the quoted text and keeps the quoted text's words and spelling, not the writer's. Pure.
|
|
3
|
+
|
|
4
|
+
import type { Span } from "./plugin.ts";
|
|
5
|
+
|
|
6
|
+
/** A Japanese quotation's closing mark, then a bracket that closes on the same text. */
|
|
7
|
+
const GLOSS_AFTER_QUOTE = /[」』][((][^()()]*[))]/gu;
|
|
8
|
+
|
|
9
|
+
/** Where each bracket written straight after a closing quotation mark lies in text, the brackets included. */
|
|
10
|
+
export const quoteGlossSpans = (text: string): Span[] =>
|
|
11
|
+
[...text.matchAll(GLOSS_AFTER_QUOTE)].map((match) => ({ start: match.index + 1, end: match.index + match[0].length }));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Words a document takes from elsewhere: a capitalised name (the Interagency Group) and a cited work (a reference list's entry,
|
|
2
|
+
// a citation written as a sentence). They keep the hyphens their owner gave them, unless the document writes the same name two
|
|
3
|
+
// ways (Co-working Space and Coworking Space), and a cited title keeps its ordinary words
|
|
4
|
+
// (factors beside the dataset FACTors). A capital the citing lost (arxiv for arXiv, ai-generated for AI-generated) is still
|
|
5
|
+
// the document's slip and is still compared. Pure.
|
|
6
|
+
|
|
7
|
+
/** Where a word was taken from: a capitalised name, or a cited work. */
|
|
8
|
+
export type Quoted = "name" | "cited";
|
|
9
|
+
|
|
10
|
+
/** A word, and for a word in a capitalised run, the run as written (Twenty-Nine Palms Band of Mission Indians), quoted or not. */
|
|
11
|
+
type QuotedWord = { readonly key: string; readonly spelling: string; readonly quoted?: Quoted | undefined; readonly name?: string | undefined };
|
|
12
|
+
|
|
13
|
+
/** The spelling without its hyphens: two spellings equal this way differ only in hyphenation (Interagency, inter-agency). */
|
|
14
|
+
const closedUp = (spelling: string): string => spelling.replaceAll("-", "");
|
|
15
|
+
|
|
16
|
+
/** A name without its case and hyphens: two names equal this way are one name (Co-working Space, Coworking Space). */
|
|
17
|
+
const nameKeyOf = (name: string): string => closedUp(name.toLowerCase());
|
|
18
|
+
|
|
19
|
+
/** The ways each group of words is written, grouped by keyOf and written as spellingOf gives. */
|
|
20
|
+
const spellingsBy = <Word>(words: readonly Word[], keyOf: (word: Word) => string, spellingOf: (word: Word) => string): Map<string, Set<string>> =>
|
|
21
|
+
words.reduce((groups, word) => groups.set(keyOf(word), (groups.get(keyOf(word)) ?? new Set<string>()).add(spellingOf(word))), new Map<string, Set<string>>());
|
|
22
|
+
|
|
23
|
+
const SMALL_LETTERS_ONLY = /^[\p{Ll}\d-]+$/u;
|
|
24
|
+
|
|
25
|
+
/** A cited word in small letters that the dictionary knows (factors): the title's own word, not a name written small. */
|
|
26
|
+
const isOrdinaryCitedWord = (word: QuotedWord, isWord: (word: string) => boolean): boolean =>
|
|
27
|
+
word.quoted === "cited" && SMALL_LETTERS_ONLY.test(word.spelling) && isWord(word.spelling);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The words without those taken from elsewhere where their way is their own: in a group of one key whose spellings differ only
|
|
31
|
+
* in hyphens, a cited word and a word of a name the document writes one way only; and a cited ordinary word in small letters. spelling is the word with the first letter of each part
|
|
32
|
+
* in small letters; isWord says whether the language's dictionary has a word.
|
|
33
|
+
*/
|
|
34
|
+
export const withoutQuotedSpellings = <Word extends QuotedWord>(words: readonly Word[], isWord: (word: string) => boolean): Word[] => {
|
|
35
|
+
const closed = spellingsBy(
|
|
36
|
+
words,
|
|
37
|
+
(word) => word.key,
|
|
38
|
+
(word) => closedUp(word.spelling),
|
|
39
|
+
);
|
|
40
|
+
const names = spellingsBy(
|
|
41
|
+
words.filter((word) => word.name !== undefined),
|
|
42
|
+
(word) => nameKeyOf(word.name ?? ""),
|
|
43
|
+
(word) => word.name ?? "",
|
|
44
|
+
);
|
|
45
|
+
const differsInHyphensOnly = (word: Word): boolean => closed.get(word.key)?.size === 1;
|
|
46
|
+
const isOwnWay = (word: Word): boolean => word.quoted === "cited" || names.get(nameKeyOf(word.name ?? ""))?.size === 1;
|
|
47
|
+
return words.filter((word) => word.quoted === undefined || !((differsInHyphensOnly(word) && isOwnWay(word)) || isOrdinaryCitedWord(word, isWord)));
|
|
48
|
+
};
|
package/src/render/semantic.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Finding, RuleDefinition } from "../plugin.ts";
|
|
2
|
-
import type
|
|
2
|
+
import { checkAppliesTo, type UserCheck } from "../checks.ts";
|
|
3
3
|
import type { Narrowing } from "../look-at.ts";
|
|
4
4
|
import type { Job as Plan, SemanticResult } from "../run-semantic.ts";
|
|
5
5
|
import { uiLanguageOf, type Texts, type UiLanguage } from "../ui.ts";
|
|
@@ -116,7 +116,7 @@ type Named = { readonly name: string; readonly howToFix: string };
|
|
|
116
116
|
const nameOf = (rule: string, rules: readonly RuleDefinition[], checks: readonly UserCheck[], language: string): Named => {
|
|
117
117
|
const built = rules.find((entry) => entry.id === rule);
|
|
118
118
|
if (built !== undefined) return { name: localized(built.name, language), howToFix: localized(built.how_to_fix, language) };
|
|
119
|
-
const user = checks.find((entry) => entry.id === rule);
|
|
119
|
+
const user = checks.find((entry) => entry.id === rule && checkAppliesTo(entry, language));
|
|
120
120
|
return { name: user?.name ?? rule, howToFix: user?.how_to_fix ?? "" };
|
|
121
121
|
};
|
|
122
122
|
|
package/src/return-type.ts
CHANGED
|
@@ -25,8 +25,10 @@ export type ReturnTypeClash = { readonly fn: string; readonly stated: string; re
|
|
|
25
25
|
type Stated = { readonly code: string; readonly written: string } | { readonly kind: string; readonly written: string };
|
|
26
26
|
|
|
27
27
|
type Statement = { readonly fn: string; readonly stated: Stated; readonly offset: number };
|
|
28
|
-
|
|
29
|
-
type
|
|
28
|
+
/** `settles` is what the body hands back: an async declaration's Promise<T> settles to T. */
|
|
29
|
+
type Signature = { readonly fn: string; readonly params: string; readonly returns: string; readonly settles: string; readonly offset: number };
|
|
30
|
+
/** `block` counts the fenced blocks opened so far, so the lines of one block share it. */
|
|
31
|
+
type Line = { readonly text: string; readonly start: number; readonly fenced: boolean; readonly section: number; readonly block: number };
|
|
30
32
|
|
|
31
33
|
const FENCE = /^ {0,3}(`{3,}|~{3,})/u;
|
|
32
34
|
const HEADING = /^ {0,3}#{1,6}[ \t]/u;
|
|
@@ -36,6 +38,11 @@ const IDENTIFIER = /^[A-Za-z_$][\w$]*/u;
|
|
|
36
38
|
const DECLARATION_HEAD = /^(?:(?:export|default|declare|async|public|static)\s+)*(?:(?:function\*?|def|fn|func)\s+)?/u;
|
|
37
39
|
const ARROW_HEAD = /^(?:(?:export|declare)\s+)*(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?/u;
|
|
38
40
|
const RETURN_MARK = /^\s*(?::|->)\s*/u;
|
|
41
|
+
const ASYNC_HEAD = /(?:^|\s)async\s/u;
|
|
42
|
+
const ASYNC_ARROW = /=\s*async\b/u;
|
|
43
|
+
const PROMISE = /^Promise<(.+)>$/u;
|
|
44
|
+
/** A TypeScript-handbook (twoslash) directive: the block shows code that does not compile, on purpose. */
|
|
45
|
+
const ERRORS_DIRECTIVE = /^\s*\/\/\s*@errors\b/u;
|
|
39
46
|
/** What may close a declaration line after its return type: an arrow's `=>` or a body's `{` with what follows, `;`, Python's `:`. */
|
|
40
47
|
const withoutDeclarationTail = (text: string): string => {
|
|
41
48
|
const cut = [text.indexOf("=>"), text.indexOf("{")].filter((at) => at !== -1);
|
|
@@ -64,18 +71,19 @@ const CODE_KINDS: ReadonlyMap<string, string> = new Map([
|
|
|
64
71
|
]);
|
|
65
72
|
|
|
66
73
|
const linesOf = (source: string): Line[] => {
|
|
67
|
-
const state = { start: 0, fence: "", section: 0 };
|
|
74
|
+
const state = { start: 0, fence: "", section: 0, block: 0 };
|
|
68
75
|
return source.split("\n").map((text) => {
|
|
69
76
|
const start = state.start;
|
|
70
77
|
state.start += text.length + 1;
|
|
71
78
|
const mark = FENCE.exec(text)?.[1];
|
|
72
79
|
const closes = mark !== undefined && state.fence !== "" && mark[0] === state.fence[0] && mark.length >= state.fence.length;
|
|
73
80
|
if (mark !== undefined && (state.fence === "" || closes)) {
|
|
81
|
+
if (!closes) state.block += 1;
|
|
74
82
|
state.fence = closes ? "" : mark;
|
|
75
|
-
return { text, start, fenced: true, section: state.section };
|
|
83
|
+
return { text, start, fenced: true, section: state.section, block: state.block };
|
|
76
84
|
}
|
|
77
85
|
if (state.fence === "" && HEADING.test(text)) state.section += 1;
|
|
78
|
-
return { text, start, fenced: state.fence !== "", section: state.section };
|
|
86
|
+
return { text, start, fenced: state.fence !== "", section: state.section, block: state.block };
|
|
79
87
|
});
|
|
80
88
|
};
|
|
81
89
|
|
|
@@ -133,12 +141,15 @@ const isReadableCode = (type: string): boolean => {
|
|
|
133
141
|
return TYPE_TEXT.test(type.trim()) && readable && members.some((member) => !NOTHING_TYPES.has(member));
|
|
134
142
|
};
|
|
135
143
|
|
|
136
|
-
|
|
144
|
+
type Declared = { readonly fn: string; readonly afterName: number; readonly isAsync: boolean };
|
|
145
|
+
|
|
146
|
+
/** The declared name, where it ends, and whether the declaration is async (read from the words around the name, not the name). */
|
|
147
|
+
const declaredAt = (line: string): Declared | undefined => {
|
|
137
148
|
const arrow = ARROW_HEAD.exec(line);
|
|
138
|
-
if (arrow?.[1] !== undefined) return { fn: arrow[1], afterName: arrow[0].length };
|
|
139
|
-
const
|
|
140
|
-
const fn = IDENTIFIER.exec(line.slice(
|
|
141
|
-
return fn === undefined ? undefined : { fn, afterName:
|
|
149
|
+
if (arrow?.[1] !== undefined) return { fn: arrow[1], afterName: arrow[0].length, isAsync: ASYNC_ARROW.test(arrow[0]) };
|
|
150
|
+
const head = DECLARATION_HEAD.exec(line)?.[0] ?? "";
|
|
151
|
+
const fn = IDENTIFIER.exec(line.slice(head.length))?.[0];
|
|
152
|
+
return fn === undefined ? undefined : { fn, afterName: head.length + fn.length, isAsync: ASYNC_HEAD.test(head) };
|
|
142
153
|
};
|
|
143
154
|
|
|
144
155
|
/** A declaration with a return type (`wrap(text: string): string[]`, `def f(x) -> str:`); a call has none. */
|
|
@@ -150,15 +161,23 @@ export const signatureOf = (line: string, offset = 0): Signature | undefined =>
|
|
|
150
161
|
const mark = close === -1 ? null : RETURN_MARK.exec(line.slice(close + 1));
|
|
151
162
|
if (close === -1 || mark === null) return undefined;
|
|
152
163
|
const returns = withoutDeclarationTail(line.slice(close + 1 + mark[0].length));
|
|
153
|
-
|
|
164
|
+
if (!TYPE_TEXT.test(returns)) return undefined;
|
|
165
|
+
const promised = declared.isAsync ? PROMISE.exec(returns)?.[1] : undefined;
|
|
166
|
+
return { fn: declared.fn, params: squeeze(line.slice(open + 1, close)), returns, settles: promised ?? returns, offset };
|
|
154
167
|
};
|
|
155
168
|
|
|
156
|
-
|
|
157
|
-
|
|
169
|
+
/** The blocks that say they show code which does not compile; their declarations are wrong on purpose. */
|
|
170
|
+
const blocksShowingErrors = (lines: readonly Line[]): Set<number> =>
|
|
171
|
+
new Set(lines.filter((line) => line.fenced && ERRORS_DIRECTIVE.test(line.text)).map((line) => line.block));
|
|
172
|
+
|
|
173
|
+
const signaturesOf = (lines: readonly Line[]): Signature[] => {
|
|
174
|
+
const showingErrors = blocksShowingErrors(lines);
|
|
175
|
+
return lines.flatMap((line) => {
|
|
158
176
|
const lead = line.text.length - line.text.trimStart().length;
|
|
159
|
-
const signature = line.fenced ? signatureOf(line.text.trim(), line.start + lead) : undefined;
|
|
177
|
+
const signature = line.fenced && !showingErrors.has(line.block) ? signatureOf(line.text.trim(), line.start + lead) : undefined;
|
|
160
178
|
return signature === undefined ? [] : [signature];
|
|
161
179
|
});
|
|
180
|
+
};
|
|
162
181
|
|
|
163
182
|
const escaped = (text: string): string => text.replace(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`);
|
|
164
183
|
|
|
@@ -328,14 +347,17 @@ const clashOf = (fn: string, stated: string, signature: Signature, offset: numbe
|
|
|
328
347
|
offset,
|
|
329
348
|
});
|
|
330
349
|
|
|
331
|
-
/**
|
|
350
|
+
/**
|
|
351
|
+
* Two declarations with the same parameters and different return types; overloads (other parameters) are left alone, and
|
|
352
|
+
* an async declaration's Promise<T> is compared as the T its body returns.
|
|
353
|
+
*/
|
|
332
354
|
const signatureClashes = (signatures: readonly Signature[]): ReturnTypeClash[] =>
|
|
333
355
|
signatures.flatMap((later, index) => {
|
|
334
356
|
const earlier = signatures
|
|
335
357
|
.slice(0, index)
|
|
336
358
|
.find(
|
|
337
359
|
(signature) =>
|
|
338
|
-
signature.fn === later.fn && signature.params === later.params && typeMembers(signature.
|
|
360
|
+
signature.fn === later.fn && signature.params === later.params && typeMembers(signature.settles).join("|") !== typeMembers(later.settles).join("|"),
|
|
339
361
|
);
|
|
340
362
|
return earlier === undefined ? [] : [clashOf(later.fn, later.returns, earlier, later.offset)];
|
|
341
363
|
});
|