chaffjs 0.34.0 → 0.36.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 +12 -0
- package/README.md +15 -0
- package/dist/announced-count.d.ts +2 -0
- package/dist/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +29 -7
- package/dist/announced-count.js.map +1 -1
- package/dist/capitals-passage.d.ts +3 -0
- package/dist/capitals-passage.d.ts.map +1 -0
- package/dist/capitals-passage.js +26 -0
- package/dist/capitals-passage.js.map +1 -0
- package/dist/chronology-rows.d.ts +9 -0
- package/dist/chronology-rows.d.ts.map +1 -0
- package/dist/chronology-rows.js +79 -0
- package/dist/chronology-rows.js.map +1 -0
- package/dist/coined-hyphen-name.d.ts +13 -0
- package/dist/coined-hyphen-name.d.ts.map +1 -0
- package/dist/coined-hyphen-name.js +21 -0
- package/dist/coined-hyphen-name.js.map +1 -0
- package/dist/company-name-run.d.ts +8 -0
- package/dist/company-name-run.d.ts.map +1 -0
- package/dist/company-name-run.js +30 -0
- package/dist/company-name-run.js.map +1 -0
- package/dist/company-names.d.ts +6 -1
- package/dist/company-names.d.ts.map +1 -1
- package/dist/company-names.js +22 -3
- package/dist/company-names.js.map +1 -1
- package/dist/compound-head.d.ts +7 -0
- package/dist/compound-head.d.ts.map +1 -0
- package/dist/compound-head.js +19 -0
- package/dist/compound-head.js.map +1 -0
- package/dist/date-format.d.ts +8 -3
- package/dist/date-format.d.ts.map +1 -1
- package/dist/date-format.js +36 -3
- package/dist/date-format.js.map +1 -1
- package/dist/derived/count-per-period.d.ts +23 -0
- package/dist/derived/count-per-period.d.ts.map +1 -0
- package/dist/derived/count-per-period.js +14 -0
- package/dist/derived/count-per-period.js.map +1 -0
- package/dist/detectors/acronym-context.d.ts +5 -1
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +32 -4
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-definition.d.ts +13 -0
- package/dist/detectors/acronym-definition.d.ts.map +1 -0
- package/dist/detectors/acronym-definition.js +90 -0
- package/dist/detectors/acronym-definition.js.map +1 -0
- package/dist/detectors/acronym-expansion.d.ts +5 -1
- package/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +35 -3
- package/dist/detectors/acronym-expansion.js.map +1 -1
- package/dist/detectors/acronym-known.d.ts +19 -0
- package/dist/detectors/acronym-known.d.ts.map +1 -0
- package/dist/detectors/acronym-known.js +32 -0
- package/dist/detectors/acronym-known.js.map +1 -0
- package/dist/detectors/acronym-link.d.ts +14 -0
- package/dist/detectors/acronym-link.d.ts.map +1 -0
- package/dist/detectors/acronym-link.js +32 -0
- package/dist/detectors/acronym-link.js.map +1 -0
- package/dist/detectors/acronym-lone.d.ts +13 -0
- package/dist/detectors/acronym-lone.d.ts.map +1 -0
- package/dist/detectors/acronym-lone.js +22 -0
- package/dist/detectors/acronym-lone.js.map +1 -0
- package/dist/detectors/acronym-name.d.ts +62 -0
- package/dist/detectors/acronym-name.d.ts.map +1 -0
- package/dist/detectors/acronym-name.js +94 -0
- package/dist/detectors/acronym-name.js.map +1 -0
- package/dist/detectors/addressee-edge.d.ts +13 -0
- package/dist/detectors/addressee-edge.d.ts.map +1 -0
- package/dist/detectors/addressee-edge.js +13 -0
- package/dist/detectors/addressee-edge.js.map +1 -0
- package/dist/detectors/announced-count.d.ts.map +1 -1
- package/dist/detectors/announced-count.js +1 -0
- package/dist/detectors/announced-count.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts +4 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +28 -3
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts +7 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +13 -8
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bracket-specified.d.ts +6 -0
- package/dist/detectors/bracket-specified.d.ts.map +1 -0
- package/dist/detectors/bracket-specified.js +23 -0
- package/dist/detectors/bracket-specified.js.map +1 -0
- package/dist/detectors/broken-link.d.ts +6 -0
- package/dist/detectors/broken-link.d.ts.map +1 -1
- package/dist/detectors/broken-link.js +23 -2
- package/dist/detectors/broken-link.js.map +1 -1
- package/dist/detectors/capitalised-term.d.ts +14 -2
- package/dist/detectors/capitalised-term.d.ts.map +1 -1
- package/dist/detectors/capitalised-term.js +115 -4
- package/dist/detectors/capitalised-term.js.map +1 -1
- package/dist/detectors/caps-caption.d.ts +12 -0
- package/dist/detectors/caps-caption.d.ts.map +1 -0
- package/dist/detectors/caps-caption.js +89 -0
- package/dist/detectors/caps-caption.js.map +1 -0
- package/dist/detectors/caps-phrase.d.ts +6 -0
- package/dist/detectors/caps-phrase.d.ts.map +1 -0
- package/dist/detectors/caps-phrase.js +16 -0
- package/dist/detectors/caps-phrase.js.map +1 -0
- package/dist/detectors/char-shape.d.ts +1 -0
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +72 -30
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/cited-title.d.ts +3 -2
- package/dist/detectors/cited-title.d.ts.map +1 -1
- package/dist/detectors/cited-title.js +14 -3
- package/dist/detectors/cited-title.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts +1 -1
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +9 -4
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/concrete-evidence.d.ts +13 -1
- package/dist/detectors/concrete-evidence.d.ts.map +1 -1
- package/dist/detectors/concrete-evidence.js +59 -0
- package/dist/detectors/concrete-evidence.js.map +1 -1
- package/dist/detectors/contraction-minority.d.ts +11 -0
- package/dist/detectors/contraction-minority.d.ts.map +1 -0
- package/dist/detectors/contraction-minority.js +10 -0
- package/dist/detectors/contraction-minority.js.map +1 -0
- package/dist/detectors/counter-edge.d.ts +7 -1
- package/dist/detectors/counter-edge.d.ts.map +1 -1
- package/dist/detectors/counter-edge.js +40 -2
- package/dist/detectors/counter-edge.js.map +1 -1
- package/dist/detectors/date-any-year.d.ts +12 -5
- package/dist/detectors/date-any-year.d.ts.map +1 -1
- package/dist/detectors/date-any-year.js +69 -12
- package/dist/detectors/date-any-year.js.map +1 -1
- package/dist/detectors/date-format.d.ts.map +1 -1
- package/dist/detectors/date-format.js +2 -1
- package/dist/detectors/date-format.js.map +1 -1
- package/dist/detectors/date-heading-year.d.ts +18 -0
- package/dist/detectors/date-heading-year.d.ts.map +1 -0
- package/dist/detectors/date-heading-year.js +38 -0
- package/dist/detectors/date-heading-year.js.map +1 -0
- package/dist/detectors/date-year.d.ts +19 -3
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +69 -8
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/deadline-unit.d.ts +20 -0
- package/dist/detectors/deadline-unit.d.ts.map +1 -0
- package/dist/detectors/deadline-unit.js +19 -0
- package/dist/detectors/deadline-unit.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +59 -12
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +6 -3
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +17 -4
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/doubled-across-aside.d.ts +9 -0
- package/dist/detectors/doubled-across-aside.d.ts.map +1 -0
- package/dist/detectors/doubled-across-aside.js +27 -0
- package/dist/detectors/doubled-across-aside.js.map +1 -0
- package/dist/detectors/doubled-punctuation.d.ts +3 -3
- package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
- package/dist/detectors/doubled-punctuation.js +23 -4
- 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 +2 -1
- package/dist/detectors/doubled-word.js.map +1 -1
- package/dist/detectors/due-date.d.ts.map +1 -1
- package/dist/detectors/due-date.js +6 -0
- package/dist/detectors/due-date.js.map +1 -1
- package/dist/detectors/ellipsis.d.ts.map +1 -1
- package/dist/detectors/ellipsis.js +13 -1
- package/dist/detectors/ellipsis.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +31 -1
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +76 -14
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +5 -1
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +3 -2
- package/dist/detectors/fact-consistency.js.map +1 -1
- package/dist/detectors/field-label.d.ts +7 -0
- package/dist/detectors/field-label.d.ts.map +1 -0
- package/dist/detectors/field-label.js +23 -0
- package/dist/detectors/field-label.js.map +1 -0
- package/dist/detectors/footnote-mismatch.d.ts +6 -1
- package/dist/detectors/footnote-mismatch.d.ts.map +1 -1
- package/dist/detectors/footnote-mismatch.js +28 -7
- package/dist/detectors/footnote-mismatch.js.map +1 -1
- package/dist/detectors/graded-step.d.ts +20 -0
- package/dist/detectors/graded-step.d.ts.map +1 -0
- package/dist/detectors/graded-step.js +33 -0
- package/dist/detectors/graded-step.js.map +1 -0
- package/dist/detectors/gram-openers.d.ts +8 -0
- package/dist/detectors/gram-openers.d.ts.map +1 -0
- package/dist/detectors/gram-openers.js +16 -0
- package/dist/detectors/gram-openers.js.map +1 -0
- package/dist/detectors/gram-passages.d.ts +11 -0
- package/dist/detectors/gram-passages.d.ts.map +1 -0
- package/dist/detectors/gram-passages.js +26 -0
- package/dist/detectors/gram-passages.js.map +1 -0
- package/dist/detectors/gram-place.d.ts +3 -1
- package/dist/detectors/gram-place.d.ts.map +1 -1
- package/dist/detectors/gram-place.js +8 -0
- package/dist/detectors/gram-place.js.map +1 -1
- package/dist/detectors/gram-predicate.d.ts.map +1 -1
- package/dist/detectors/gram-predicate.js +37 -3
- package/dist/detectors/gram-predicate.js.map +1 -1
- package/dist/detectors/heading-echo.d.ts.map +1 -1
- package/dist/detectors/heading-echo.js +28 -2
- package/dist/detectors/heading-echo.js.map +1 -1
- package/dist/detectors/heading-end-mark.d.ts +8 -3
- package/dist/detectors/heading-end-mark.d.ts.map +1 -1
- package/dist/detectors/heading-end-mark.js +18 -8
- package/dist/detectors/heading-end-mark.js.map +1 -1
- package/dist/detectors/heading-names.d.ts +7 -0
- package/dist/detectors/heading-names.d.ts.map +1 -0
- package/dist/detectors/heading-names.js +24 -0
- package/dist/detectors/heading-names.js.map +1 -0
- package/dist/detectors/heading-numbering.d.ts.map +1 -1
- package/dist/detectors/heading-numbering.js +7 -2
- package/dist/detectors/heading-numbering.js.map +1 -1
- package/dist/detectors/ime-residue.d.ts +1 -1
- package/dist/detectors/ime-residue.d.ts.map +1 -1
- package/dist/detectors/ime-residue.js +4 -3
- package/dist/detectors/ime-residue.js.map +1 -1
- package/dist/detectors/inch-mark.d.ts +10 -0
- package/dist/detectors/inch-mark.d.ts.map +1 -0
- package/dist/detectors/inch-mark.js +48 -0
- package/dist/detectors/inch-mark.js.map +1 -0
- package/dist/detectors/kanji-compound-slip.d.ts +3 -0
- package/dist/detectors/kanji-compound-slip.d.ts.map +1 -0
- package/dist/detectors/kanji-compound-slip.js +50 -0
- package/dist/detectors/kanji-compound-slip.js.map +1 -0
- package/dist/detectors/kutoten-consistency.d.ts +10 -2
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +76 -12
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lexicon.d.ts +0 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +37 -25
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/link-shape.d.ts.map +1 -1
- package/dist/detectors/link-shape.js +9 -3
- package/dist/detectors/link-shape.js.map +1 -1
- package/dist/detectors/list-item-ending.d.ts +18 -0
- package/dist/detectors/list-item-ending.d.ts.map +1 -0
- package/dist/detectors/list-item-ending.js +35 -0
- package/dist/detectors/list-item-ending.js.map +1 -0
- package/dist/detectors/list-parallel.d.ts +18 -5
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +116 -36
- package/dist/detectors/list-parallel.js.map +1 -1
- package/dist/detectors/list-sentence.d.ts +4 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -1
- package/dist/detectors/list-sentence.js +1 -1
- package/dist/detectors/list-sentence.js.map +1 -1
- package/dist/detectors/mark-shape.d.ts +15 -5
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +64 -10
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/mentioned-phrase.d.ts +9 -0
- package/dist/detectors/mentioned-phrase.d.ts.map +1 -0
- package/dist/detectors/mentioned-phrase.js +25 -0
- package/dist/detectors/mentioned-phrase.js.map +1 -0
- package/dist/detectors/middle-dot.d.ts +2 -2
- package/dist/detectors/middle-dot.d.ts.map +1 -1
- package/dist/detectors/middle-dot.js +4 -2
- package/dist/detectors/middle-dot.js.map +1 -1
- package/dist/detectors/modal-conflict.d.ts.map +1 -1
- package/dist/detectors/modal-conflict.js +5 -2
- package/dist/detectors/modal-conflict.js.map +1 -1
- package/dist/detectors/name-variant-apart.d.ts +27 -0
- package/dist/detectors/name-variant-apart.d.ts.map +1 -0
- package/dist/detectors/name-variant-apart.js +51 -0
- package/dist/detectors/name-variant-apart.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +18 -11
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/notice-paragraph.d.ts +9 -0
- package/dist/detectors/notice-paragraph.d.ts.map +1 -0
- package/dist/detectors/notice-paragraph.js +21 -0
- package/dist/detectors/notice-paragraph.js.map +1 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +15 -2
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/number-unit.d.ts.map +1 -1
- package/dist/detectors/number-unit.js +24 -1
- package/dist/detectors/number-unit.js.map +1 -1
- package/dist/detectors/numeral-opener.d.ts +6 -0
- package/dist/detectors/numeral-opener.d.ts.map +1 -1
- package/dist/detectors/numeral-opener.js +24 -1
- package/dist/detectors/numeral-opener.js.map +1 -1
- package/dist/detectors/numeral-word.d.ts +15 -0
- package/dist/detectors/numeral-word.d.ts.map +1 -0
- package/dist/detectors/numeral-word.js +26 -0
- package/dist/detectors/numeral-word.js.map +1 -0
- package/dist/detectors/obligation-without-deadline.d.ts +5 -1
- package/dist/detectors/obligation-without-deadline.d.ts.map +1 -1
- package/dist/detectors/obligation-without-deadline.js +44 -23
- package/dist/detectors/obligation-without-deadline.js.map +1 -1
- package/dist/detectors/open-end-class.d.ts +16 -0
- package/dist/detectors/open-end-class.d.ts.map +1 -0
- package/dist/detectors/open-end-class.js +65 -0
- package/dist/detectors/open-end-class.js.map +1 -0
- package/dist/detectors/open-end-condition.d.ts +7 -0
- package/dist/detectors/open-end-condition.d.ts.map +1 -0
- package/dist/detectors/open-end-condition.js +35 -0
- package/dist/detectors/open-end-condition.js.map +1 -0
- package/dist/detectors/open-end-names.d.ts +9 -3
- package/dist/detectors/open-end-names.d.ts.map +1 -1
- package/dist/detectors/open-end-names.js +5 -2
- package/dist/detectors/open-end-names.js.map +1 -1
- package/dist/detectors/open-end-question.d.ts +15 -0
- package/dist/detectors/open-end-question.d.ts.map +1 -0
- package/dist/detectors/open-end-question.js +37 -0
- package/dist/detectors/open-end-question.js.map +1 -0
- package/dist/detectors/open-end-scope.d.ts +16 -0
- package/dist/detectors/open-end-scope.d.ts.map +1 -0
- package/dist/detectors/open-end-scope.js +47 -0
- package/dist/detectors/open-end-scope.js.map +1 -0
- package/dist/detectors/opening-date.d.ts +10 -0
- package/dist/detectors/opening-date.d.ts.map +1 -0
- package/dist/detectors/opening-date.js +33 -0
- package/dist/detectors/opening-date.js.map +1 -0
- package/dist/detectors/ordinary-phrase.d.ts +20 -0
- package/dist/detectors/ordinary-phrase.d.ts.map +1 -0
- package/dist/detectors/ordinary-phrase.js +54 -0
- package/dist/detectors/ordinary-phrase.js.map +1 -0
- package/dist/detectors/organisation-run.d.ts +18 -0
- package/dist/detectors/organisation-run.d.ts.map +1 -0
- package/dist/detectors/organisation-run.js +80 -0
- package/dist/detectors/organisation-run.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +65 -21
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +6 -1
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/outline-label.d.ts +14 -0
- package/dist/detectors/outline-label.d.ts.map +1 -0
- package/dist/detectors/outline-label.js +32 -0
- package/dist/detectors/outline-label.js.map +1 -0
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +38 -1
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/page-marker.d.ts +6 -0
- package/dist/detectors/page-marker.d.ts.map +1 -0
- package/dist/detectors/page-marker.js +19 -0
- package/dist/detectors/page-marker.js.map +1 -0
- package/dist/detectors/parallel-definition.d.ts +16 -0
- package/dist/detectors/parallel-definition.d.ts.map +1 -0
- package/dist/detectors/parallel-definition.js +51 -0
- package/dist/detectors/parallel-definition.js.map +1 -0
- package/dist/detectors/person-consistency.d.ts +2 -1
- package/dist/detectors/person-consistency.d.ts.map +1 -1
- package/dist/detectors/person-consistency.js +5 -3
- package/dist/detectors/person-consistency.js.map +1 -1
- package/dist/detectors/phrase-match.d.ts +2 -0
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +11 -4
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +18 -3
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/placeholder.d.ts +3 -1
- package/dist/detectors/placeholder.d.ts.map +1 -1
- package/dist/detectors/placeholder.js +8 -3
- package/dist/detectors/placeholder.js.map +1 -1
- package/dist/detectors/postcode-end.d.ts +3 -0
- package/dist/detectors/postcode-end.d.ts.map +1 -0
- package/dist/detectors/postcode-end.js +15 -0
- package/dist/detectors/postcode-end.js.map +1 -0
- package/dist/detectors/prose-total-words.d.ts +5 -0
- package/dist/detectors/prose-total-words.d.ts.map +1 -0
- package/dist/detectors/prose-total-words.js +14 -0
- package/dist/detectors/prose-total-words.js.map +1 -0
- package/dist/detectors/reference-text.d.ts.map +1 -1
- package/dist/detectors/reference-text.js +1 -0
- package/dist/detectors/reference-text.js.map +1 -1
- package/dist/detectors/registry/kanji-compound-slip.d.ts +3 -0
- package/dist/detectors/registry/kanji-compound-slip.d.ts.map +1 -0
- package/dist/detectors/registry/kanji-compound-slip.js +3 -0
- package/dist/detectors/registry/kanji-compound-slip.js.map +1 -0
- package/dist/detectors/registry/phrase-in-use.d.ts +3 -0
- package/dist/detectors/registry/phrase-in-use.d.ts.map +1 -0
- package/dist/detectors/registry/phrase-in-use.js +3 -0
- package/dist/detectors/registry/phrase-in-use.js.map +1 -0
- package/dist/detectors/registry/unfilled-placeholder.d.ts.map +1 -1
- package/dist/detectors/registry/unfilled-placeholder.js +2 -2
- package/dist/detectors/registry/unfilled-placeholder.js.map +1 -1
- package/dist/detectors/registry/vague-density.js +1 -1
- package/dist/detectors/registry/vague-density.js.map +1 -1
- package/dist/detectors/request-owner.d.ts +6 -2
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +57 -7
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/requirement-smell.d.ts.map +1 -1
- package/dist/detectors/requirement-smell.js +39 -7
- package/dist/detectors/requirement-smell.js.map +1 -1
- package/dist/detectors/scaled-figure-unit.d.ts +28 -0
- package/dist/detectors/scaled-figure-unit.d.ts.map +1 -0
- package/dist/detectors/scaled-figure-unit.js +78 -0
- package/dist/detectors/scaled-figure-unit.js.map +1 -0
- package/dist/detectors/sentence-counts.d.ts +2 -0
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +18 -7
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +2 -0
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +10 -3
- 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 +24 -16
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-load.d.ts +4 -1
- package/dist/detectors/sentence-load.d.ts.map +1 -1
- package/dist/detectors/sentence-load.js +9 -2
- package/dist/detectors/sentence-load.js.map +1 -1
- package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
- package/dist/detectors/sentence-rhythm.js +6 -3
- package/dist/detectors/sentence-rhythm.js.map +1 -1
- package/dist/detectors/series-label.d.ts +2 -1
- package/dist/detectors/series-label.d.ts.map +1 -1
- package/dist/detectors/series-label.js +10 -4
- package/dist/detectors/series-label.js.map +1 -1
- package/dist/detectors/signals.d.ts +4 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +91 -52
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +21 -19
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +2 -1
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/subject-name-line.d.ts +8 -0
- package/dist/detectors/subject-name-line.d.ts.map +1 -0
- package/dist/detectors/subject-name-line.js +53 -0
- package/dist/detectors/subject-name-line.js.map +1 -0
- package/dist/detectors/table-header.d.ts.map +1 -1
- package/dist/detectors/table-header.js +13 -1
- package/dist/detectors/table-header.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +4 -1
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/template-sections.d.ts +14 -0
- package/dist/detectors/template-sections.d.ts.map +1 -0
- package/dist/detectors/template-sections.js +25 -0
- package/dist/detectors/template-sections.js.map +1 -0
- package/dist/detectors/term-mention-sentence.d.ts +4 -0
- package/dist/detectors/term-mention-sentence.d.ts.map +1 -0
- package/dist/detectors/term-mention-sentence.js +28 -0
- package/dist/detectors/term-mention-sentence.js.map +1 -0
- package/dist/detectors/titled-run.d.ts +23 -0
- package/dist/detectors/titled-run.d.ts.map +1 -0
- package/dist/detectors/titled-run.js +39 -0
- package/dist/detectors/titled-run.js.map +1 -0
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +13 -5
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
- package/dist/detectors/unbalanced-bracket.js +4 -0
- package/dist/detectors/unbalanced-bracket.js.map +1 -1
- package/dist/detectors/undefined-term.d.ts.map +1 -1
- package/dist/detectors/undefined-term.js +8 -0
- package/dist/detectors/undefined-term.js.map +1 -1
- package/dist/detectors/unfilled-placeholder.d.ts +4 -0
- package/dist/detectors/unfilled-placeholder.d.ts.map +1 -0
- package/dist/detectors/unfilled-placeholder.js +9 -0
- package/dist/detectors/unfilled-placeholder.js.map +1 -0
- package/dist/detectors/vague-density.d.ts +8 -0
- package/dist/detectors/vague-density.d.ts.map +1 -0
- package/dist/detectors/vague-density.js +65 -0
- package/dist/detectors/vague-density.js.map +1 -0
- package/dist/document-paragraphs.d.ts +4 -0
- package/dist/document-paragraphs.d.ts.map +1 -0
- package/dist/document-paragraphs.js +24 -0
- package/dist/document-paragraphs.js.map +1 -0
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +2 -19
- package/dist/document.js.map +1 -1
- package/dist/facts/fact-scope.d.ts +10 -1
- package/dist/facts/fact-scope.d.ts.map +1 -1
- package/dist/facts/fact-scope.js +34 -3
- package/dist/facts/fact-scope.js.map +1 -1
- package/dist/facts/table-facts.d.ts +12 -2
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +22 -4
- package/dist/facts/table-facts.js.map +1 -1
- package/dist/figure-references.d.ts +3 -0
- package/dist/figure-references.d.ts.map +1 -1
- package/dist/figure-references.js +6 -2
- package/dist/figure-references.js.map +1 -1
- package/dist/format-template.d.ts +3 -0
- package/dist/format-template.d.ts.map +1 -0
- package/dist/format-template.js +13 -0
- package/dist/format-template.js.map +1 -0
- package/dist/formula-brackets.d.ts +7 -0
- package/dist/formula-brackets.d.ts.map +1 -0
- package/dist/formula-brackets.js +29 -0
- package/dist/formula-brackets.js.map +1 -0
- package/dist/grade-api.d.ts +9 -2
- package/dist/grade-api.d.ts.map +1 -1
- package/dist/grade-api.js +31 -15
- package/dist/grade-api.js.map +1 -1
- package/dist/heading-numbering.d.ts +5 -2
- package/dist/heading-numbering.d.ts.map +1 -1
- package/dist/heading-numbering.js +27 -6
- package/dist/heading-numbering.js.map +1 -1
- package/dist/html/html-markdown.d.ts.map +1 -1
- package/dist/html/html-markdown.js +2 -1
- package/dist/html/html-markdown.js.map +1 -1
- package/dist/html/html-site-chrome.d.ts +5 -0
- package/dist/html/html-site-chrome.d.ts.map +1 -0
- package/dist/html/html-site-chrome.js +33 -0
- package/dist/html/html-site-chrome.js.map +1 -0
- package/dist/joined-view.d.ts.map +1 -1
- package/dist/joined-view.js +1 -0
- package/dist/joined-view.js.map +1 -1
- package/dist/kanji-compound-slip.d.ts +32 -0
- package/dist/kanji-compound-slip.d.ts.map +1 -0
- package/dist/kanji-compound-slip.js +63 -0
- package/dist/kanji-compound-slip.js.map +1 -0
- package/dist/latin-company-form.d.ts +6 -0
- package/dist/latin-company-form.d.ts.map +1 -0
- package/dist/latin-company-form.js +32 -0
- package/dist/latin-company-form.js.map +1 -0
- package/dist/latin-word-boundary.d.ts +15 -0
- package/dist/latin-word-boundary.d.ts.map +1 -0
- package/dist/latin-word-boundary.js +40 -0
- package/dist/latin-word-boundary.js.map +1 -0
- package/dist/lexicon-genres.d.ts +2 -0
- package/dist/lexicon-genres.d.ts.map +1 -1
- package/dist/lexicon-genres.js +1 -1
- package/dist/lexicon-genres.js.map +1 -1
- package/dist/link-shape.d.ts +5 -0
- package/dist/link-shape.d.ts.map +1 -1
- package/dist/link-shape.js +18 -0
- package/dist/link-shape.js.map +1 -1
- package/dist/link-title.d.ts +4 -0
- package/dist/link-title.d.ts.map +1 -0
- package/dist/link-title.js +33 -0
- package/dist/link-title.js.map +1 -0
- package/dist/list-item-paragraphs.d.ts +15 -0
- package/dist/list-item-paragraphs.d.ts.map +1 -0
- package/dist/list-item-paragraphs.js +19 -0
- package/dist/list-item-paragraphs.js.map +1 -0
- package/dist/literal-quote.d.ts +12 -0
- package/dist/literal-quote.d.ts.map +1 -0
- package/dist/literal-quote.js +43 -0
- package/dist/literal-quote.js.map +1 -0
- package/dist/nado-closed-list.d.ts.map +1 -1
- package/dist/nado-closed-list.js +39 -5
- package/dist/nado-closed-list.js.map +1 -1
- package/dist/name-end-letter.d.ts +5 -0
- package/dist/name-end-letter.d.ts.map +1 -1
- package/dist/name-end-letter.js +8 -0
- package/dist/name-end-letter.js.map +1 -1
- package/dist/name-given-before.d.ts +15 -0
- package/dist/name-given-before.d.ts.map +1 -0
- package/dist/name-given-before.js +30 -0
- package/dist/name-given-before.js.map +1 -0
- package/dist/name-separator.d.ts +2 -2
- package/dist/name-separator.d.ts.map +1 -1
- package/dist/name-separator.js +79 -5
- package/dist/name-separator.js.map +1 -1
- package/dist/name-variants.d.ts +3 -1
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +8 -7
- package/dist/name-variants.js.map +1 -1
- package/dist/name-word-order.d.ts +9 -5
- package/dist/name-word-order.d.ts.map +1 -1
- package/dist/name-word-order.js +47 -15
- package/dist/name-word-order.js.map +1 -1
- package/dist/nominal-stem.d.ts +26 -0
- package/dist/nominal-stem.d.ts.map +1 -0
- package/dist/nominal-stem.js +70 -0
- package/dist/nominal-stem.js.map +1 -0
- package/dist/person-forms.d.ts +8 -0
- package/dist/person-forms.d.ts.map +1 -1
- package/dist/person-forms.js +12 -0
- package/dist/person-forms.js.map +1 -1
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/preamble-paragraphs.d.ts +3 -2
- package/dist/preamble-paragraphs.d.ts.map +1 -1
- package/dist/preamble-paragraphs.js +8 -2
- package/dist/preamble-paragraphs.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 +6 -2
- package/dist/sentence-load.js.map +1 -1
- package/dist/spacing-code.d.ts +1 -0
- package/dist/spacing-code.d.ts.map +1 -1
- package/dist/spacing-code.js +4 -1
- package/dist/spacing-code.js.map +1 -1
- package/dist/split-noun.d.ts +10 -0
- package/dist/split-noun.d.ts.map +1 -0
- package/dist/split-noun.js +50 -0
- package/dist/split-noun.js.map +1 -0
- package/dist/structure/attached-parts.d.ts +11 -0
- package/dist/structure/attached-parts.d.ts.map +1 -0
- package/dist/structure/attached-parts.js +31 -0
- package/dist/structure/attached-parts.js.map +1 -0
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +7 -4
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/cited-document-section.d.ts +7 -0
- package/dist/structure/cited-document-section.d.ts.map +1 -0
- package/dist/structure/cited-document-section.js +33 -0
- package/dist/structure/cited-document-section.js.map +1 -0
- package/dist/structure/contents-lines.d.ts +7 -0
- package/dist/structure/contents-lines.d.ts.map +1 -0
- package/dist/structure/contents-lines.js +51 -0
- package/dist/structure/contents-lines.js.map +1 -0
- package/dist/structure/defining-names.d.ts +37 -0
- package/dist/structure/defining-names.d.ts.map +1 -0
- package/dist/structure/defining-names.js +122 -0
- package/dist/structure/defining-names.js.map +1 -0
- package/dist/structure/definition-use.d.ts +3 -2
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +99 -31
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/html-text-blocks.d.ts +8 -0
- package/dist/structure/html-text-blocks.d.ts.map +1 -0
- package/dist/structure/html-text-blocks.js +47 -0
- package/dist/structure/html-text-blocks.js.map +1 -0
- package/dist/structure/issues.d.ts +5 -2
- package/dist/structure/issues.d.ts.map +1 -1
- package/dist/structure/issues.js +24 -6
- package/dist/structure/issues.js.map +1 -1
- package/dist/structure/labelled-date-order.d.ts +4 -1
- package/dist/structure/labelled-date-order.d.ts.map +1 -1
- package/dist/structure/labelled-date-order.js +2 -2
- package/dist/structure/labelled-date-order.js.map +1 -1
- package/dist/structure/labelled-order.d.ts +3 -0
- package/dist/structure/labelled-order.d.ts.map +1 -1
- package/dist/structure/labelled-order.js +8 -3
- package/dist/structure/labelled-order.js.map +1 -1
- package/dist/structure/list-lead-in.d.ts +19 -0
- package/dist/structure/list-lead-in.d.ts.map +1 -0
- package/dist/structure/list-lead-in.js +85 -0
- package/dist/structure/list-lead-in.js.map +1 -0
- package/dist/structure/list-numbering.d.ts +20 -4
- package/dist/structure/list-numbering.d.ts.map +1 -1
- package/dist/structure/list-numbering.js +65 -9
- package/dist/structure/list-numbering.js.map +1 -1
- package/dist/structure/listed-paragraph.d.ts +16 -0
- package/dist/structure/listed-paragraph.d.ts.map +1 -0
- package/dist/structure/listed-paragraph.js +37 -0
- package/dist/structure/listed-paragraph.js.map +1 -0
- package/dist/structure/modal-conflict.d.ts +7 -2
- package/dist/structure/modal-conflict.d.ts.map +1 -1
- package/dist/structure/modal-conflict.js +36 -7
- package/dist/structure/modal-conflict.js.map +1 -1
- package/dist/structure/negated-act.d.ts +17 -0
- package/dist/structure/negated-act.d.ts.map +1 -0
- package/dist/structure/negated-act.js +32 -0
- package/dist/structure/negated-act.js.map +1 -0
- package/dist/structure/numbering.d.ts +5 -2
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +49 -12
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/prose-total.d.ts +4 -0
- package/dist/structure/prose-total.d.ts.map +1 -1
- package/dist/structure/prose-total.js +16 -6
- package/dist/structure/prose-total.js.map +1 -1
- package/dist/structure/reference-text.d.ts +9 -1
- package/dist/structure/reference-text.d.ts.map +1 -1
- package/dist/structure/reference-text.js +21 -3
- package/dist/structure/reference-text.js.map +1 -1
- package/dist/structure/repeated-number.d.ts +24 -0
- package/dist/structure/repeated-number.d.ts.map +1 -0
- package/dist/structure/repeated-number.js +89 -0
- package/dist/structure/repeated-number.js.map +1 -0
- package/dist/structure/rounded-amount.d.ts +8 -0
- package/dist/structure/rounded-amount.d.ts.map +1 -0
- package/dist/structure/rounded-amount.js +48 -0
- package/dist/structure/rounded-amount.js.map +1 -0
- package/dist/structure/section-names.d.ts +12 -0
- package/dist/structure/section-names.d.ts.map +1 -0
- package/dist/structure/section-names.js +26 -0
- package/dist/structure/section-names.js.map +1 -0
- package/dist/structure/side-step.d.ts +8 -0
- package/dist/structure/side-step.d.ts.map +1 -0
- package/dist/structure/side-step.js +21 -0
- package/dist/structure/side-step.js.map +1 -0
- package/dist/structure/spanned-label-blank.d.ts +8 -0
- package/dist/structure/spanned-label-blank.d.ts.map +1 -0
- package/dist/structure/spanned-label-blank.js +37 -0
- package/dist/structure/spanned-label-blank.js.map +1 -0
- package/dist/structure/universal.d.ts +3 -1
- package/dist/structure/universal.d.ts.map +1 -1
- package/dist/structure/universal.js +9 -2
- package/dist/structure/universal.js.map +1 -1
- package/dist/structure/unspaced-heading.d.ts +10 -0
- package/dist/structure/unspaced-heading.d.ts.map +1 -0
- package/dist/structure/unspaced-heading.js +24 -0
- package/dist/structure/unspaced-heading.js.map +1 -0
- package/dist/structure/versioned-label.d.ts +16 -0
- package/dist/structure/versioned-label.d.ts.map +1 -0
- package/dist/structure/versioned-label.js +48 -0
- package/dist/structure/versioned-label.js.map +1 -0
- package/dist/structure/written-headings.d.ts +31 -0
- package/dist/structure/written-headings.d.ts.map +1 -0
- package/dist/structure/written-headings.js +119 -0
- package/dist/structure/written-headings.js.map +1 -0
- package/dist/structure/written-list-path.d.ts +10 -0
- package/dist/structure/written-list-path.d.ts.map +1 -0
- package/dist/structure/written-list-path.js +37 -0
- package/dist/structure/written-list-path.js.map +1 -0
- package/dist/structure/written-resolve.d.ts +12 -0
- package/dist/structure/written-resolve.d.ts.map +1 -0
- package/dist/structure/written-resolve.js +55 -0
- package/dist/structure/written-resolve.js.map +1 -0
- package/dist/title-line.d.ts +21 -0
- package/dist/title-line.d.ts.map +1 -0
- package/dist/title-line.js +27 -0
- package/dist/title-line.js.map +1 -0
- package/package.json +3 -3
- package/rules/all-caps-shouting.yaml +2 -2
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/bare-url-mix.yaml +2 -2
- package/rules/bracket-nesting.yaml +2 -2
- package/rules/bracket-width-consistency.yaml +2 -2
- package/rules/broken-link.yaml +2 -2
- package/rules/cliche.yaml +4 -3
- package/rules/code-fence-language-mix.yaml +2 -2
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +2 -2
- package/rules/contraction-consistency.yaml +13 -13
- package/rules/dangling-figure-reference.yaml +2 -2
- package/rules/dangling-reference.yaml +2 -2
- package/rules/date-without-year.yaml +10 -2
- package/rules/defined-name-repeated.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/doubled-punctuation.yaml +4 -4
- package/rules/doubled-word.yaml +2 -2
- package/rules/duplicate-definition.yaml +2 -2
- package/rules/duration-mismatch.yaml +2 -2
- package/rules/email-greeting-closing.yaml +2 -2
- package/rules/email-subject-length.yaml +2 -2
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/fact-conflict.yaml +2 -2
- package/rules/footnote-mismatch.yaml +2 -2
- package/rules/heading-echo.yaml +2 -2
- package/rules/heading-end-punctuation-mix.yaml +2 -2
- package/rules/heading-numbering-mix.yaml +2 -2
- package/rules/ime-residue.yaml +2 -2
- package/rules/kanji-compound-slip.yaml +67 -0
- package/rules/kutoten-consistency.yaml +4 -4
- package/rules/latin-spacing.yaml +4 -4
- package/rules/list-item-form-mix.yaml +2 -2
- package/rules/max-kanji-continuous.yaml +7 -3
- package/rules/max-sentence-length.yaml +3 -2
- package/rules/modal-conflict.yaml +1 -0
- package/rules/nado-closed-list.yaml +2 -2
- package/rules/name-variant.yaml +2 -2
- package/rules/ngram-repetition.yaml +2 -2
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-mixed-desumasu.yaml +3 -3
- package/rules/no-nakaguro-parallel.yaml +2 -0
- package/rules/number-without-unit.yaml +9 -4
- package/rules/numbering-gap.yaml +7 -2
- package/rules/numeral-sentence-start.yaml +2 -2
- package/rules/obligation-without-deadline.yaml +2 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/oxford-comma-consistency.yaml +3 -3
- package/rules/preamble-length.yaml +2 -2
- package/rules/reference-title-mismatch.yaml +2 -2
- package/rules/repeated-sentence-ending.yaml +3 -2
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/requirement-smell.yaml +3 -3
- package/rules/sentence-rhythm.yaml +2 -2
- package/rules/table-header-variant.yaml +2 -2
- package/rules/teki-overuse.yaml +3 -2
- package/rules/title-case-consistency.yaml +2 -2
- package/rules/total-mismatch.yaml +2 -2
- package/rules/translationese-density.yaml +2 -2
- package/rules/unbalanced-bracket.yaml +2 -2
- package/rules/undefined-acronym.yaml +15 -4
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-word-density.yaml +2 -2
- package/skills/chaff/SKILL.md +7 -1
- package/src/announced-count.ts +35 -8
- package/src/capitals-passage.ts +31 -0
- package/src/chronology-rows.ts +86 -0
- package/src/coined-hyphen-name.ts +27 -0
- package/src/company-name-run.ts +37 -0
- package/src/company-names.ts +24 -3
- package/src/compound-head.ts +25 -0
- package/src/date-format.ts +43 -4
- package/src/derived/count-per-period.ts +28 -0
- package/src/detectors/acronym-context.ts +34 -6
- package/src/detectors/acronym-definition.ts +123 -0
- package/src/detectors/acronym-expansion.ts +47 -6
- package/src/detectors/acronym-known.ts +40 -0
- package/src/detectors/acronym-link.ts +37 -0
- package/src/detectors/acronym-lone.ts +26 -0
- package/src/detectors/acronym-name.ts +140 -0
- package/src/detectors/addressee-edge.ts +16 -0
- package/src/detectors/announced-count.ts +1 -0
- package/src/detectors/bare-comparative.ts +44 -3
- package/src/detectors/blank-structure.ts +21 -10
- package/src/detectors/bracket-specified.ts +25 -0
- package/src/detectors/broken-link.ts +26 -2
- package/src/detectors/capitalised-term.ts +154 -4
- package/src/detectors/caps-caption.ts +103 -0
- package/src/detectors/caps-phrase.ts +17 -0
- package/src/detectors/char-shape.ts +99 -26
- package/src/detectors/cited-title.ts +15 -3
- package/src/detectors/clause-shape.ts +14 -4
- package/src/detectors/concrete-evidence.ts +77 -1
- package/src/detectors/contraction-minority.ts +11 -0
- package/src/detectors/counter-edge.ts +40 -2
- package/src/detectors/date-any-year.ts +79 -12
- package/src/detectors/date-format.ts +2 -1
- package/src/detectors/date-heading-year.ts +55 -0
- package/src/detectors/date-year.ts +107 -14
- package/src/detectors/deadline-unit.ts +40 -0
- package/src/detectors/defined-term-form.ts +58 -17
- package/src/detectors/definition-use.ts +7 -3
- package/src/detectors/derived-numbers.ts +19 -4
- package/src/detectors/doubled-across-aside.ts +36 -0
- package/src/detectors/doubled-punctuation.ts +28 -7
- package/src/detectors/doubled-word.ts +2 -1
- package/src/detectors/due-date.ts +10 -1
- package/src/detectors/ellipsis.ts +16 -1
- package/src/detectors/email-letter.ts +97 -21
- package/src/detectors/en-shape.ts +5 -1
- package/src/detectors/fact-consistency.ts +3 -2
- package/src/detectors/field-label.ts +25 -0
- package/src/detectors/footnote-mismatch.ts +39 -7
- package/src/detectors/graded-step.ts +52 -0
- package/src/detectors/gram-openers.ts +21 -0
- package/src/detectors/gram-passages.ts +36 -0
- package/src/detectors/gram-place.ts +10 -1
- package/src/detectors/gram-predicate.ts +43 -3
- package/src/detectors/heading-echo.ts +31 -3
- package/src/detectors/heading-end-mark.ts +23 -10
- package/src/detectors/heading-names.ts +31 -0
- package/src/detectors/heading-numbering.ts +7 -2
- package/src/detectors/ime-residue.ts +4 -3
- package/src/detectors/inch-mark.ts +49 -0
- package/src/detectors/kanji-compound-slip.ts +61 -0
- package/src/detectors/kutoten-consistency.ts +93 -14
- package/src/detectors/lexicon.ts +44 -24
- package/src/detectors/link-shape.ts +10 -3
- package/src/detectors/list-item-ending.ts +51 -0
- package/src/detectors/list-parallel.ts +158 -33
- package/src/detectors/list-sentence.ts +5 -1
- package/src/detectors/mark-shape.ts +70 -10
- package/src/detectors/mentioned-phrase.ts +38 -0
- package/src/detectors/middle-dot.ts +7 -2
- package/src/detectors/modal-conflict.ts +5 -2
- package/src/detectors/name-variant-apart.ts +63 -0
- package/src/detectors/name-variant.ts +30 -12
- package/src/detectors/notice-paragraph.ts +33 -0
- package/src/detectors/number-style.ts +14 -2
- package/src/detectors/number-unit.ts +28 -1
- package/src/detectors/numeral-opener.ts +27 -1
- package/src/detectors/numeral-word.ts +33 -0
- package/src/detectors/obligation-without-deadline.ts +29 -4
- package/src/detectors/open-end-class.ts +78 -0
- package/src/detectors/open-end-condition.ts +40 -0
- package/src/detectors/open-end-names.ts +9 -3
- package/src/detectors/open-end-question.ts +50 -0
- package/src/detectors/open-end-scope.ts +62 -0
- package/src/detectors/opening-date.ts +47 -0
- package/src/detectors/ordinary-phrase.ts +62 -0
- package/src/detectors/organisation-run.ts +97 -0
- package/src/detectors/orthographic-variant.ts +103 -27
- package/src/detectors/orthography.ts +10 -1
- package/src/detectors/outline-label.ts +48 -0
- package/src/detectors/oxford-comma.ts +40 -1
- package/src/detectors/page-marker.ts +26 -0
- package/src/detectors/parallel-definition.ts +64 -0
- package/src/detectors/person-consistency.ts +5 -3
- package/src/detectors/phrase-match.ts +16 -5
- package/src/detectors/placeholder-text.ts +18 -3
- package/src/detectors/placeholder.ts +10 -3
- package/src/detectors/postcode-end.ts +16 -0
- package/src/detectors/prose-total-words.ts +18 -0
- package/src/detectors/reference-text.ts +1 -0
- package/src/detectors/registry/kanji-compound-slip.ts +4 -0
- package/src/detectors/registry/phrase-in-use.ts +4 -0
- package/src/detectors/registry/unfilled-placeholder.ts +2 -2
- package/src/detectors/registry/vague-density.ts +1 -1
- package/src/detectors/request-owner.ts +71 -8
- package/src/detectors/requirement-smell.ts +53 -7
- package/src/detectors/scaled-figure-unit.ts +103 -0
- package/src/detectors/sentence-counts.ts +24 -8
- package/src/detectors/sentence-ending.ts +12 -3
- package/src/detectors/sentence-length.ts +14 -6
- package/src/detectors/sentence-load.ts +9 -2
- package/src/detectors/sentence-rhythm.ts +8 -4
- package/src/detectors/series-label.ts +13 -4
- package/src/detectors/signals.ts +105 -55
- package/src/detectors/structure-tree.ts +22 -20
- package/src/detectors/structure.ts +2 -1
- package/src/detectors/subject-name-line.ts +66 -0
- package/src/detectors/table-header.ts +15 -1
- package/src/detectors/technical-docs.ts +5 -1
- package/src/detectors/template-sections.ts +37 -0
- package/src/detectors/term-mention-sentence.ts +31 -0
- package/src/detectors/titled-run.ts +48 -0
- package/src/detectors/token-shape.ts +14 -5
- package/src/detectors/unbalanced-bracket.ts +3 -0
- package/src/detectors/undefined-term.ts +8 -0
- package/src/detectors/unfilled-placeholder.ts +10 -0
- package/src/detectors/vague-density.ts +84 -0
- package/src/document-paragraphs.ts +27 -0
- package/src/document.ts +3 -23
- package/src/facts/fact-scope.ts +53 -4
- package/src/facts/table-facts.ts +43 -6
- package/src/figure-references.ts +7 -2
- package/src/format-template.ts +15 -0
- package/src/formula-brackets.ts +36 -0
- package/src/grade-api.ts +38 -16
- package/src/heading-numbering.ts +35 -8
- package/src/html/html-markdown.ts +2 -1
- package/src/html/html-site-chrome.ts +47 -0
- package/src/joined-view.ts +1 -0
- package/src/kanji-compound-slip.ts +98 -0
- package/src/latin-company-form.ts +38 -0
- package/src/latin-word-boundary.ts +46 -0
- package/src/lexicon-genres.ts +1 -1
- package/src/link-shape.ts +19 -0
- package/src/link-title.ts +38 -0
- package/src/list-item-paragraphs.ts +22 -0
- package/src/literal-quote.ts +55 -0
- package/src/nado-closed-list.ts +48 -5
- package/src/name-end-letter.ts +9 -0
- package/src/name-given-before.ts +40 -0
- package/src/name-separator.ts +91 -5
- package/src/name-variants.ts +21 -11
- package/src/name-word-order.ts +62 -17
- package/src/nominal-stem.ts +93 -0
- package/src/person-forms.ts +15 -0
- package/src/plugin.ts +5 -0
- package/src/preamble-paragraphs.ts +13 -3
- package/src/sentence-load.ts +7 -2
- package/src/spacing-code.ts +5 -1
- package/src/split-noun.ts +63 -0
- package/src/structure/attached-parts.ts +32 -0
- package/src/structure/build.ts +7 -4
- package/src/structure/cited-document-section.ts +42 -0
- package/src/structure/contents-lines.ts +63 -0
- package/src/structure/defining-names.ts +155 -0
- package/src/structure/definition-use.ts +116 -25
- package/src/structure/html-text-blocks.ts +45 -0
- package/src/structure/issues.ts +26 -7
- package/src/structure/labelled-date-order.ts +5 -2
- package/src/structure/labelled-order.ts +12 -3
- package/src/structure/list-lead-in.ts +94 -0
- package/src/structure/list-numbering.ts +100 -11
- package/src/structure/listed-paragraph.ts +45 -0
- package/src/structure/modal-conflict.ts +42 -7
- package/src/structure/negated-act.ts +49 -0
- package/src/structure/numbering.ts +70 -26
- package/src/structure/prose-total.ts +20 -6
- package/src/structure/reference-text.ts +25 -3
- package/src/structure/repeated-number.ts +110 -0
- package/src/structure/rounded-amount.ts +55 -0
- package/src/structure/section-names.ts +32 -0
- package/src/structure/side-step.ts +21 -0
- package/src/structure/spanned-label-blank.ts +39 -0
- package/src/structure/universal.ts +11 -2
- package/src/structure/unspaced-heading.ts +27 -0
- package/src/structure/versioned-label.ts +52 -0
- package/src/structure/written-headings.ts +137 -0
- package/src/structure/written-list-path.ts +46 -0
- package/src/structure/written-resolve.ts +64 -0
- package/src/title-line.ts +52 -0
|
@@ -8,6 +8,7 @@ import { quoteAt } from "./structure-tree.ts";
|
|
|
8
8
|
import { amountColumnOf, isTotalRowGap, type BodyRow } from "../structure/total-row-blank.ts";
|
|
9
9
|
import { isAmountNameLine, isTotalLine } from "../structure/total-line.ts";
|
|
10
10
|
import { isTotalLabel, withoutLeadingBlankCells } from "../structure/total.ts";
|
|
11
|
+
import { isSpannedLabelGap } from "../structure/spanned-label-blank.ts";
|
|
11
12
|
|
|
12
13
|
/** Fewer body rows than this, and one blank is as likely a choice as a gap. */
|
|
13
14
|
const MIN_BODY_ROWS = 3;
|
|
@@ -67,8 +68,6 @@ const cellOffset = (cell: MarkdownNode | undefined, row: MarkdownNode | undefine
|
|
|
67
68
|
/** Whether a row is a total, subtotal or tax row, judged from the row's source text. */
|
|
68
69
|
export type IsTotalRow = (rowText: string) => boolean;
|
|
69
70
|
|
|
70
|
-
const NO_TOTAL_ROWS: IsTotalRow = () => false;
|
|
71
|
-
|
|
72
71
|
const rowSource = (source: string, row: MarkdownNode): string => {
|
|
73
72
|
const span = spanOf(row);
|
|
74
73
|
return span === undefined ? "" : source.slice(span.start, span.end);
|
|
@@ -79,30 +78,40 @@ const bodyRowOf = (source: string, row: MarkdownNode, isTotalRow: IsTotalRow): B
|
|
|
79
78
|
cells: (row.children ?? []).map((cell) => (shows(cell) ? sourceOf(source, cell) : undefined)),
|
|
80
79
|
});
|
|
81
80
|
|
|
81
|
+
/** How a table's rows are read: which rows are totals, and the total words that make a cell a row label (Total score). */
|
|
82
|
+
type TableReading = { readonly isTotalRow: IsTotalRow; readonly totalWords: readonly string[] };
|
|
83
|
+
|
|
84
|
+
const NO_TOTALS: TableReading = { isTotalRow: () => false, totalWords: [] };
|
|
85
|
+
|
|
82
86
|
/**
|
|
83
87
|
* The one blank body cell of a column whose other body rows are all filled, unless it is a total row's blank beside its
|
|
84
|
-
* amount
|
|
88
|
+
* amount, or the second column of a label that spans two (| Total score | | 5 |). Such a blank still counts as a second
|
|
89
|
+
* blank, so the rows it shares a column with stay as unreported as before.
|
|
85
90
|
*/
|
|
86
|
-
const columnBlank = (source: string,
|
|
91
|
+
const columnBlank = (source: string, table: TableRows, totalWords: readonly string[], column: number): Blank[] => {
|
|
92
|
+
const { header, body, rows } = table;
|
|
87
93
|
const blanks = rows.flatMap((row, index) => (row.cells[column] === undefined ? [index] : []));
|
|
88
94
|
const at = blanks[0];
|
|
89
95
|
const row = at === undefined ? undefined : rows[at];
|
|
90
96
|
if (blanks.length !== 1 || at === undefined || row === undefined) return [];
|
|
91
97
|
if (isTotalRowGap(row, column, amountColumnOf(rows, header.children?.length ?? 0))) return [];
|
|
98
|
+
if (isSpannedLabelGap(row.cells, column, totalWords)) return [];
|
|
92
99
|
const offset = cellOffset(body[at]?.children?.[column], body[at]);
|
|
93
100
|
const name = sourceOf(source, header.children?.[column]);
|
|
94
101
|
return offset === undefined || name === "" ? [] : [{ offset, name }];
|
|
95
102
|
};
|
|
96
103
|
|
|
104
|
+
type TableRows = { readonly header: MarkdownNode; readonly body: readonly MarkdownNode[]; readonly rows: readonly BodyRow[] };
|
|
105
|
+
|
|
97
106
|
/** The first column is skipped: a blank there often means "same as above". */
|
|
98
|
-
const tableBlanksOf = (source: string, table: MarkdownNode,
|
|
107
|
+
const tableBlanksOf = (source: string, table: MarkdownNode, reading: TableReading): Blank[] => {
|
|
99
108
|
const [header, ...body] = table.children ?? [];
|
|
100
109
|
if (header === undefined || body.length < MIN_BODY_ROWS) return [];
|
|
101
|
-
const rows = body.map((row) => bodyRowOf(source, row, isTotalRow));
|
|
110
|
+
const rows = body.map((row) => bodyRowOf(source, row, reading.isTotalRow));
|
|
102
111
|
const columns = header.children?.length ?? 0;
|
|
103
112
|
return Array.from({ length: columns }, (_unused, column) => column)
|
|
104
113
|
.slice(1)
|
|
105
|
-
.flatMap((column) => columnBlank(source, header, body, rows, column));
|
|
114
|
+
.flatMap((column) => columnBlank(source, { header, body, rows }, reading.totalWords, column));
|
|
106
115
|
};
|
|
107
116
|
|
|
108
117
|
/** Quoted material is someone else's: email replies the document model found, and every Markdown blockquote. */
|
|
@@ -118,8 +127,8 @@ const blocksOutsideQuotes = (source: string, type: string, replies: readonly Spa
|
|
|
118
127
|
};
|
|
119
128
|
|
|
120
129
|
/** Blank cells in every table outside quotes. */
|
|
121
|
-
export const tableBlanks = (source: string, replies: readonly Span[] = [],
|
|
122
|
-
blocksOutsideQuotes(source, "table", replies).flatMap((table) => tableBlanksOf(source, table,
|
|
130
|
+
export const tableBlanks = (source: string, replies: readonly Span[] = [], reading: TableReading = NO_TOTALS): Blank[] =>
|
|
131
|
+
blocksOutsideQuotes(source, "table", replies).flatMap((table) => tableBlanksOf(source, table, reading));
|
|
123
132
|
|
|
124
133
|
type Item = { readonly node: MarkdownNode; readonly text: string | undefined; readonly empty: boolean };
|
|
125
134
|
|
|
@@ -192,5 +201,7 @@ const totalRowOf = (doc: ProseDocument): IsTotalRow => {
|
|
|
192
201
|
return (rowText) => isTotalLine(rowText, totals) || isAmountNameLine(rowText, totals) || isTotalLabel(withoutLeadingBlankCells(rowText), taxes);
|
|
193
202
|
};
|
|
194
203
|
|
|
195
|
-
export const emptyTableCell: Detector = findingsOf("empty-table-cell", (doc) =>
|
|
204
|
+
export const emptyTableCell: Detector = findingsOf("empty-table-cell", (doc) =>
|
|
205
|
+
tableBlanks(doc.source, doc.replyQuotes ?? [], { isTotalRow: totalRowOf(doc), totalWords: patternsOf(doc, "total-label") }),
|
|
206
|
+
);
|
|
196
207
|
export const emptyListItem: Detector = findingsOf("empty-list-item", (doc) => listBlanks(doc.source, doc.replyQuotes ?? []));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { asideAt } from "./open-end-names.ts";
|
|
2
|
+
|
|
3
|
+
// A vague word pinned down by the bracket right after it: 一定の事項(インボイスに記載が必要な事項), a reasonable fee (USD 50).
|
|
4
|
+
// The aside says what the word leaves open, so the word is not vague there. An aside that only gives the phrase a name
|
|
5
|
+
// (以下「措置」という, hereinafter the "Fee") pins nothing down. Pure: the words that start a name come in.
|
|
6
|
+
|
|
7
|
+
/** What may stand between the vague word and the bracket: the noun it qualifies (事項, fee), no punctuation. */
|
|
8
|
+
const BEFORE_BRACKET = /^[\p{L}\p{N}\p{M} ]{0,12}?(?=[((])/u;
|
|
9
|
+
|
|
10
|
+
const startsWithName = (aside: string, nameMarkers: readonly string[]): boolean => {
|
|
11
|
+
const lower = aside.trimStart().toLowerCase();
|
|
12
|
+
return nameMarkers.some((marker) => marker !== "" && lower.startsWith(marker.toLowerCase()));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Whether the words right after end (an offset in text) are pinned down by a bracket: at most a short noun, then an
|
|
17
|
+
* aside that opens and closes and holds more than a name. nameMarkers: the words that start a name (以下, hereinafter).
|
|
18
|
+
*/
|
|
19
|
+
export const specifiedByBracket = (text: string, end: number, nameMarkers: readonly string[]): boolean => {
|
|
20
|
+
const rest = text.slice(end);
|
|
21
|
+
const before = BEFORE_BRACKET.exec(rest);
|
|
22
|
+
if (before === null) return false;
|
|
23
|
+
const aside = asideAt(text, end + before[0].length);
|
|
24
|
+
return aside !== undefined && aside.trim() !== "" && !startsWithName(aside, nameMarkers);
|
|
25
|
+
};
|
|
@@ -62,12 +62,36 @@ const CITATION_NUMBERS = /^[\d\s,,、–-]+$/u;
|
|
|
62
62
|
/** 画像の参照(`![alt][label]`)の頭の印。指摘の範囲に含める。 */
|
|
63
63
|
const IMAGE_MARK = "!";
|
|
64
64
|
|
|
65
|
+
/** 印の前の逃がし(\)を数えるのに見る字数。 */
|
|
66
|
+
const ESCAPE_REACH = 16;
|
|
67
|
+
const BACKSLASH = "\\";
|
|
68
|
+
|
|
69
|
+
/** 字の並びの終わりに続く \ の数。 */
|
|
70
|
+
const trailingBackslashes = (text: string): number => {
|
|
71
|
+
const reversed = [...text].reverse();
|
|
72
|
+
const other = reversed.findIndex((char) => char !== BACKSLASH);
|
|
73
|
+
return other === -1 ? reversed.length : other;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** start の括弧の直前に、逃がしていない ! がある(「\![x][]」は画像ではなくリンク)。 */
|
|
77
|
+
const imageAt = (source: string, start: number): boolean => {
|
|
78
|
+
if (source.charAt(start - 1) !== IMAGE_MARK) return false;
|
|
79
|
+
return trailingBackslashes(source.slice(Math.max(0, start - 1 - ESCAPE_REACH), start - 1)) % 2 === 0;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 名前を省いた画像の参照(`![Complete][]`)は、サイトが全ページに定義を足す印や絵(mdBook の前処理、サイト共通の定義)。
|
|
84
|
+
* 画像の行き先をページの中で一度も書かずに名前だけで呼ぶのは、定義がページの外にあるとき。名前を書いた形(`![alt][logo]`)と
|
|
85
|
+
* リンク(`[text][]`)は指摘する。
|
|
86
|
+
*/
|
|
87
|
+
export const siteDefinedImage = (source: string, start: number, label: string): boolean => label === "" && imageAt(source, start);
|
|
88
|
+
|
|
65
89
|
export const unresolvedReferences = (source: string, markup: Markup): Span[] =>
|
|
66
90
|
markup.texts.flatMap((text) =>
|
|
67
91
|
[...source.slice(text.start, text.end).matchAll(REFERENCE_LIKE)]
|
|
68
|
-
.filter((match) => !CITATION_NUMBERS.test(match[1] ?? ""))
|
|
92
|
+
.filter((match) => !CITATION_NUMBERS.test(match[1] ?? "") && !siteDefinedImage(source, text.start + match.index, match[2] ?? ""))
|
|
69
93
|
.map((match) => ({ start: text.start + match.index, end: text.start + match.index + match[0].length }))
|
|
70
|
-
.map((span) => (source
|
|
94
|
+
.map((span) => (imageAt(source, span.start) ? { start: span.start - 1, end: span.end } : span)),
|
|
71
95
|
);
|
|
72
96
|
|
|
73
97
|
const emptyLinks = (doc: ProseDocument, markup: Markup): Finding[] =>
|
|
@@ -16,6 +16,18 @@ export type CapitalisedWords = {
|
|
|
16
16
|
readonly divisions: readonly string[];
|
|
17
17
|
/** Small words inside one name (Statement of Work, Trials and Betas). */
|
|
18
18
|
readonly joiners: readonly string[];
|
|
19
|
+
/** Words that end a longer name the run only starts (Federal Food, Drug, and Cosmetic Act). */
|
|
20
|
+
readonly nameEnds: readonly string[];
|
|
21
|
+
/** Company forms and places, which end a name right after a comma too (Post Holdings, Inc.; Canton, Ohio). */
|
|
22
|
+
readonly formEnds: readonly string[];
|
|
23
|
+
/** Words before the quoted label in brackets that define the run ((the "FDA")). */
|
|
24
|
+
readonly definitionMarkers: readonly string[];
|
|
25
|
+
/** Words opening brackets that say where the run is defined ((as defined in the Merger Agreement)). */
|
|
26
|
+
readonly definedElsewhere: readonly string[];
|
|
27
|
+
/** Words before a party's capacity after its name (Citibank, N.A., as Administrative Agent). */
|
|
28
|
+
readonly capacityMarkers: readonly string[];
|
|
29
|
+
/** Articles, which may stand between a capacity word and the capacity (as the Borrower). */
|
|
30
|
+
readonly articles: readonly string[];
|
|
19
31
|
};
|
|
20
32
|
|
|
21
33
|
/** A term the document defines; bare is a definition with no defining word (("GPC")), which names more than it defines. */
|
|
@@ -100,15 +112,144 @@ const writtenInLowerCase = (text: string, term: string): boolean => {
|
|
|
100
112
|
return new RegExp(String.raw`(?<!\p{L})${words}(?:e?s)?(?!\p{L})`, "u").test(text);
|
|
101
113
|
};
|
|
102
114
|
|
|
115
|
+
/** How many tokens past a run a longer name may still end (’s Investors Service, Inc: five). */
|
|
116
|
+
const NAME_REACH = 8;
|
|
117
|
+
/** Marks inside one name: Post Holdings, Inc; Davis Polk & Wardwell LLP; Moody’s Investors Service. */
|
|
118
|
+
const NAME_GLUE = new Set([",", "&", ".", "'s", "’s"]);
|
|
119
|
+
const DIGIT_START = /^\d/u;
|
|
120
|
+
|
|
121
|
+
/** The last word of each name-ending entry (Kingdom of United Kingdom), without a closing full stop. */
|
|
122
|
+
const lastWordsOf = (entries: readonly string[]): Set<string> =>
|
|
123
|
+
new Set(
|
|
124
|
+
entries
|
|
125
|
+
.flatMap((entry) =>
|
|
126
|
+
entry
|
|
127
|
+
.split(/[\s,]+/u)
|
|
128
|
+
.filter((word) => word !== "")
|
|
129
|
+
.slice(-1),
|
|
130
|
+
)
|
|
131
|
+
.map((word) => word.replace(/\.$/u, "")),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
/** Commas in a serial name's list (Federal Food, Drug, and Cosmetic Act). */
|
|
135
|
+
const SERIAL_COMMAS = 2;
|
|
136
|
+
|
|
137
|
+
type NameEnds = { readonly names: ReadonlySet<string>; readonly forms: ReadonlySet<string>; readonly formEntries: ReadonlySet<string> };
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Across a comma, a company form or a place ends the run's name only as the whole of what follows the comma (Post
|
|
141
|
+
* Holdings, Inc; London, United Kingdom), and a name word only at the end of a serial list of two commas, the last
|
|
142
|
+
* followed by a joiner (Federal Food, Drug, and Cosmetic Act): Confidential Information, Receiving Party and Servicer,
|
|
143
|
+
* Navistar Securities Corporation are two things each.
|
|
144
|
+
*/
|
|
145
|
+
const endsName = (glued: readonly Token[], at: number, ends: NameEnds, joiners: ReadonlySet<string>): boolean => {
|
|
146
|
+
const surface = glued[at]?.surface ?? "";
|
|
147
|
+
const before = glued.slice(0, at);
|
|
148
|
+
const surfaces = before.map((token) => token.surface);
|
|
149
|
+
const comma = surfaces.lastIndexOf(",");
|
|
150
|
+
if (comma === -1) return ends.forms.has(surface) || ends.names.has(surface);
|
|
151
|
+
const afterComma = glued.slice(comma + 1, at + 1);
|
|
152
|
+
if (ends.formEntries.has(afterComma.map((token) => token.surface).join(" "))) return true;
|
|
153
|
+
const commas = surfaces.filter((each) => each === ",").length;
|
|
154
|
+
return ends.names.has(surface) && commas >= SERIAL_COMMAS && joiners.has(afterComma[0]?.surface ?? "");
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** The run only starts a longer name: the words after it, joined by commas, ampersands and joiners, reach a word that ends a name. */
|
|
158
|
+
const startsLongerName = (tokens: readonly Token[], end: number, ends: NameEnds, joiners: ReadonlySet<string>): boolean => {
|
|
159
|
+
const reach = tokens.slice(end, end + NAME_REACH);
|
|
160
|
+
const stop = reach.findIndex((token, at) => {
|
|
161
|
+
const before = tokens[end + at - 1];
|
|
162
|
+
return before === undefined || !adjacent(before, token) || !(NAME_GLUE.has(token.surface) || joiners.has(token.surface) || continues(token));
|
|
163
|
+
});
|
|
164
|
+
const glued = reach.slice(0, stop === -1 ? reach.length : stop);
|
|
165
|
+
return glued.some((_, at) => endsName(glued, at, ends, joiners));
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/** A number right after the run makes it a numbered name (Proposition 65, Vaccines 2Go) or a contents line's page. */
|
|
169
|
+
const numberedName = (last: Token, after: Token | undefined): boolean => after !== undefined && adjacent(last, after) && DIGIT_START.test(after.surface);
|
|
170
|
+
|
|
171
|
+
/** The words as written and with their first letter capitalised (the, The), as one alternation. */
|
|
172
|
+
const alternativesOf = (words: readonly string[]): string =>
|
|
173
|
+
words
|
|
174
|
+
.filter((word) => word !== "")
|
|
175
|
+
.flatMap((word) => [word, word.charAt(0).toUpperCase() + word.slice(1)])
|
|
176
|
+
.map(escapeRegExp)
|
|
177
|
+
.join("|");
|
|
178
|
+
|
|
179
|
+
/** A quoted label: a capitalised word or more in quotes, closing the brackets or followed by another label ("Buyer" or "PNC"). */
|
|
180
|
+
const QUOTED_LABEL = String.raw`["“]\p{Lu}[^"“”\n]{0,60}["”][ \t]*(?:\)|,|;|or[ \t]|and[ \t])`;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Brackets right after a run that define it, so the run is what a definition names, not a term in use: a quoted label
|
|
184
|
+
* (Food and Drug Administration (the "FDA"), Certificate of Analysis ("COA")) or a pointer to where it is defined
|
|
185
|
+
* (Closing (as defined in the Merger Agreement)). A quoted phrase in lower case (("including records")) is no label.
|
|
186
|
+
*/
|
|
187
|
+
const definitionAfterPattern = (words: CapitalisedWords): RegExp => {
|
|
188
|
+
const markers = alternativesOf(words.definitionMarkers);
|
|
189
|
+
const elsewhere = alternativesOf(words.definedElsewhere);
|
|
190
|
+
const label = markers === "" ? QUOTED_LABEL : String.raw`(?:(?:${markers})[ \t]+)*${QUOTED_LABEL}`;
|
|
191
|
+
const opening = elsewhere === "" ? label : String.raw`(?:${label}|(?:${elsewhere})(?!\p{L}))`;
|
|
192
|
+
return new RegExp(String.raw`^[ \t]*\([ \t]*${opening}`, "u");
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/** How much text after a run the bracket check reads. */
|
|
196
|
+
const DEFINITION_AFTER_CHARS = 120;
|
|
197
|
+
|
|
198
|
+
/** The initials of a run's words, with and without its joiners (PFHOF and PFHF for Pro Football Hall of Fame). */
|
|
199
|
+
const initialsOf = (term: string, joiners: ReadonlySet<string>): string[] => {
|
|
200
|
+
const words = term.split(/[\s-]+/u).filter((word) => word !== "");
|
|
201
|
+
const initials = (kept: readonly string[]): string => kept.map((word) => word.charAt(0).toUpperCase()).join("");
|
|
202
|
+
return words.length < 2 ? [] : [initials(words), initials(words.filter((word) => !joiners.has(word)))];
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The run names the capacity a named party acts in, in a list of parties to some agreement (Citibank, N.A., as
|
|
207
|
+
* Administrative Agent; the Company, as the Borrower): the name, a comma, a capacity word and perhaps an article.
|
|
208
|
+
*/
|
|
209
|
+
const capacityOfAName = (tokens: readonly Token[], start: number, words: CapitalisedWords): boolean => {
|
|
210
|
+
const before = tokens[start - 1];
|
|
211
|
+
const at = before !== undefined && words.articles.includes(before.surface) ? start - 2 : start - 1;
|
|
212
|
+
const marker = tokens[at];
|
|
213
|
+
const comma = tokens[at - 1];
|
|
214
|
+
const name = tokens[at - 2];
|
|
215
|
+
if (marker === undefined || comma?.surface !== "," || name === undefined) return false;
|
|
216
|
+
return words.capacityMarkers.includes(marker.surface) && (continues(name) || name.surface === ".");
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Whether a run is a name by what surrounds it: a number after it, a longer name it starts, brackets after it that
|
|
221
|
+
* define it, initials that spell a term the document defines (“IRS” means the Internal Revenue Service), or a capacity.
|
|
222
|
+
*/
|
|
223
|
+
type NameCue = (tokens: readonly Token[], start: number, end: number, term: string) => boolean;
|
|
224
|
+
|
|
225
|
+
const nameCues = (input: CapitalisedInput, joiners: ReadonlySet<string>): NameCue => {
|
|
226
|
+
const words = input.words;
|
|
227
|
+
const ends = { names: lastWordsOf(words.nameEnds), forms: lastWordsOf(words.formEnds), formEntries: new Set(words.formEnds) };
|
|
228
|
+
const definitionAfter = definitionAfterPattern(words);
|
|
229
|
+
const abbreviations = new Set([...input.defined.map((definition) => definition.term), ...input.named].filter((term) => ACRONYM.test(term)));
|
|
230
|
+
return (tokens, start, end, term) => {
|
|
231
|
+
const last = tokens[end - 1];
|
|
232
|
+
if (last === undefined) return false;
|
|
233
|
+
return (
|
|
234
|
+
numberedName(last, tokens[end]) ||
|
|
235
|
+
startsLongerName(tokens, end, ends, joiners) ||
|
|
236
|
+
definitionAfter.test(input.source.slice(last.span.end, last.span.end + DEFINITION_AFTER_CHARS)) ||
|
|
237
|
+
initialsOf(term, joiners).some((initials) => abbreviations.has(initials)) ||
|
|
238
|
+
capacityOfAName(tokens, start, words)
|
|
239
|
+
);
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
103
243
|
/**
|
|
104
244
|
* The first use of each capitalised run used inside a sentence like a defined term that names nothing the language
|
|
105
245
|
* package lists, is not set apart by markup, is never written in lower case, and neither is nor holds a defined or named
|
|
106
|
-
* term in any case.
|
|
246
|
+
* term in any case. A run that starts a longer name, carries a number, or is defined by the brackets after it is a name.
|
|
107
247
|
*/
|
|
108
248
|
export const capitalisedTerms = (input: CapitalisedInput): CapitalisedTerm[] => {
|
|
109
249
|
const defining = input.defined.filter((definition) => definition.bare !== true && DEFINED_FORM.test(definition.term));
|
|
110
250
|
if (defining.length < MIN_DEFINED) return [];
|
|
111
251
|
const joiners = new Set(input.words.joiners);
|
|
252
|
+
const isName = nameCues(input, joiners);
|
|
112
253
|
const divisions = new Set(input.words.divisions.flatMap(formsOf));
|
|
113
254
|
const known = new Set([...input.defined.map((definition) => definition.term), ...input.named, ...input.words.names].flatMap(formsOf));
|
|
114
255
|
const isKnown = (term: string): boolean => partsOf(term).some((part) => formsOf(part).some((form) => known.has(form)));
|
|
@@ -119,7 +260,8 @@ export const capitalisedTerms = (input: CapitalisedInput): CapitalisedTerm[] =>
|
|
|
119
260
|
if (first === undefined || last === undefined || !placedLikeATerm(tokens[start - 1], tokens[end])) return [];
|
|
120
261
|
if (inside(first.span.start, input.marked) || formsOf(first.surface).some((form) => divisions.has(form))) return [];
|
|
121
262
|
const term = input.source.slice(first.span.start, last.span.end);
|
|
122
|
-
|
|
263
|
+
if (isKnown(term) || isName(tokens, start, end, term)) return [];
|
|
264
|
+
return writtenInLowerCase(input.readable, term) ? [] : [{ offset: first.span.start, term }];
|
|
123
265
|
}),
|
|
124
266
|
);
|
|
125
267
|
return uses.filter((use, index) => uses.findIndex((other) => formsOf(other.term).some((form) => formsOf(use.term).includes(form))) === index);
|
|
@@ -130,12 +272,20 @@ const QUOTED = /["“]([^"“”\n]{1,80}?)[,.]?["”]/gu;
|
|
|
130
272
|
const HTML_ELEMENT = /<([a-z][a-z0-9]*)\b[^>]*>[^<]*<\/\1>/giu;
|
|
131
273
|
const TABLE_ROW = /^[ \t]*\|.*$/gmu;
|
|
132
274
|
const ITEM_LABEL = /^[ \t]*(?:[*+-]|\d+[.)])[ \t]+[^:\n]{1,80}:/gmu;
|
|
275
|
+
const CAPTION_WORD = String.raw`\p{Lu}[\p{L}'’-]*`;
|
|
276
|
+
const CAPTION_SMALL = String.raw`(?:of|and|or|to|the|for|with|in|on|a|an|by|from|under|upon|as|at|not)[ \t]+`;
|
|
277
|
+
/** A clause's run-in caption: its number, then capitalised words up to a full stop or colon (5.8 No Representation or Warranty.). */
|
|
278
|
+
const CAPTION = new RegExp(
|
|
279
|
+
String.raw`(?:^|(?<=[.;:][ \t]+))[ \t]*(?:(?:Section|Article|SECTION|ARTICLE)[ \t]+)?(?:\d+(?:\.\d+)*\.?|\([a-z\d]{1,4}\))[ \t]+` +
|
|
280
|
+
String.raw`${CAPTION_WORD}(?:(?:[ \t]+|[;,][ \t]*)(?:${CAPTION_SMALL})*${CAPTION_WORD}){0,10}(?=[.:](?:\s|$))`,
|
|
281
|
+
"gmu",
|
|
282
|
+
);
|
|
133
283
|
|
|
134
284
|
const spansOf = (source: string, pattern: RegExp): Span[] =>
|
|
135
285
|
[...source.matchAll(pattern)].map((match) => ({ start: match.index, end: match.index + match[0].length }));
|
|
136
286
|
|
|
137
|
-
/** Bold, HTML elements, table rows
|
|
138
|
-
export const setApartSpans = (source: string): Span[] => [BOLD, HTML_ELEMENT, TABLE_ROW, ITEM_LABEL].flatMap((pattern) => spansOf(source, pattern));
|
|
287
|
+
/** Bold, HTML elements, table rows, list items' labels and clauses' run-in captions: labels and cells, not running text. */
|
|
288
|
+
export const setApartSpans = (source: string): Span[] => [BOLD, HTML_ELEMENT, TABLE_ROW, ITEM_LABEL, CAPTION].flatMap((pattern) => spansOf(source, pattern));
|
|
139
289
|
|
|
140
290
|
const LINK_DESTINATION = /\]\([^)\n]*\)|<?https?:\/\/[^\s)>]+>?/gu;
|
|
141
291
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captions set in capitals: a capital run that opens a paragraph and ends in a colon ("AGENCY:", "DIRECT HIRE AUTHORITY:
|
|
3
|
+
* This position is …"), or that is a paragraph of its own ("WORKING GROUP MEMBERS"). Notices, forms and reports set their
|
|
4
|
+
* captions this way by convention, and prose that names one ("the FOR FURTHER INFORMATION CONTACT section") repeats it.
|
|
5
|
+
* A line of a hard-wrapped paragraph in capitals (a disclaimer) has text above it, so it is no caption.
|
|
6
|
+
*/
|
|
7
|
+
import { linesOf, type Line } from "../structure/lines.ts";
|
|
8
|
+
import type { Span } from "../plugin.ts";
|
|
9
|
+
|
|
10
|
+
/** Markdown heading or list marks and spaces that may stand before a caption on its line. */
|
|
11
|
+
const LINE_LEAD = /^[ \t]*(?:#{1,6}[ \t]+|[-*+][ \t]+)?$/u;
|
|
12
|
+
const BLANK_LINE = /^[ \t\r]*$/u;
|
|
13
|
+
const LINE_END = /^[ \t\r]*(?:\n|$)/u;
|
|
14
|
+
const LEAD = /^[ \t]*(?:#{1,6}[ \t]+|[-*+][ \t]+)?/u;
|
|
15
|
+
const CAPITAL_RUN = /^[A-Z][A-Z']*(?:,? [A-Z][A-Z']*)*/u;
|
|
16
|
+
|
|
17
|
+
/** The line before the one that starts at lineStart, or undefined at the start of the source. */
|
|
18
|
+
const lineBefore = (source: string, lineStart: number): string | undefined =>
|
|
19
|
+
lineStart === 0 ? undefined : source.slice(source.lastIndexOf("\n", lineStart - 2) + 1, lineStart - 1);
|
|
20
|
+
|
|
21
|
+
const opensParagraph = (source: string, lineStart: number): boolean => {
|
|
22
|
+
const above = lineBefore(source, lineStart);
|
|
23
|
+
return above === undefined || BLANK_LINE.test(above);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Whether the text after a run ends the caption: a colon, or the end of a paragraph. */
|
|
27
|
+
const endsCaption = (rest: string): boolean => {
|
|
28
|
+
if (rest.startsWith(":")) return true;
|
|
29
|
+
if (!LINE_END.test(rest)) return false;
|
|
30
|
+
const next = rest.slice(rest.indexOf("\n") + 1).split("\n", 1)[0] ?? "";
|
|
31
|
+
return !rest.includes("\n") || BLANK_LINE.test(next);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Whether the capital run at [start, end) of the source is a caption: it opens its paragraph and ends in a colon or the paragraph's end. */
|
|
35
|
+
export const isCaptionAt = (source: string, start: number, end: number): boolean => {
|
|
36
|
+
const lineStart = source.lastIndexOf("\n", start - 1) + 1;
|
|
37
|
+
return LINE_LEAD.test(source.slice(lineStart, start)) && opensParagraph(source, lineStart) && endsCaption(source.slice(end));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** The capital run that opens a line, after its heading or list mark, with where it starts in the source. */
|
|
41
|
+
const runOpening = (line: string, lineStart: number): { readonly words: string; readonly start: number } | undefined => {
|
|
42
|
+
const lead = LEAD.exec(line)?.[0].length ?? 0;
|
|
43
|
+
const words = CAPITAL_RUN.exec(line.slice(lead))?.[0];
|
|
44
|
+
return words === undefined ? undefined : { words, start: lineStart + lead };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** The captions a source sets in capitals, each as its words ("FOR FURTHER INFORMATION CONTACT"). */
|
|
48
|
+
export const captionsOf = (source: string): ReadonlySet<string> => {
|
|
49
|
+
const lines = source.split("\n");
|
|
50
|
+
const starts = lines.reduce<number[]>(
|
|
51
|
+
(acc, line) => {
|
|
52
|
+
acc.push((acc.at(-1) ?? 0) + line.length + 1);
|
|
53
|
+
return acc;
|
|
54
|
+
},
|
|
55
|
+
[0],
|
|
56
|
+
);
|
|
57
|
+
return new Set(
|
|
58
|
+
lines.flatMap((line, at) => {
|
|
59
|
+
const run = runOpening(line, starts[at] ?? 0);
|
|
60
|
+
return run !== undefined && isCaptionAt(source, run.start, run.start + run.words.length) ? [run.words] : [];
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** A line ends a sentence when its last mark, past closing quotes and brackets, is a period, a question or an exclamation mark. */
|
|
66
|
+
const SENTENCE_END = /[.!?]["'”’)\]]*[ \t\r]*$/u;
|
|
67
|
+
const UPPER = /[A-Z]/u;
|
|
68
|
+
const LOWER = /[a-z]/u;
|
|
69
|
+
|
|
70
|
+
const isCapitalLine = (line: Line): boolean => {
|
|
71
|
+
const bare = line.text.replace(LEAD, "");
|
|
72
|
+
return UPPER.test(bare) && !LOWER.test(bare);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** The lines in paragraphs: runs of lines between blank lines. */
|
|
76
|
+
const paragraphsOf = (lines: readonly Line[]): Line[][] =>
|
|
77
|
+
lines.reduce<Line[][]>((paragraphs, line, index) => {
|
|
78
|
+
if (BLANK_LINE.test(line.text)) return paragraphs;
|
|
79
|
+
const above = lines[index - 1];
|
|
80
|
+
if (above !== undefined && !BLANK_LINE.test(above.text)) paragraphs.at(-1)?.push(line);
|
|
81
|
+
else paragraphs.push([line]);
|
|
82
|
+
return paragraphs;
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
const spanOf = (paragraph: readonly Line[]): Span[] => {
|
|
86
|
+
const first = paragraph[0];
|
|
87
|
+
const last = paragraph.at(-1);
|
|
88
|
+
return first === undefined || last === undefined ? [] : [{ start: first.start, end: last.start + last.text.length }];
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The paragraphs in capitals at the head of a document, before its first sentence: a letterhead, an office's name, an
|
|
93
|
+
* address block (BOARD OF GOVERNORS / WASHINGTON, D.C. 20551). Every line is in capitals and none ends a sentence, so a
|
|
94
|
+
* disclaimer in capitals, which is sentences, is not one. A document with no sentence has no head to tell apart.
|
|
95
|
+
*/
|
|
96
|
+
export const letterheadSpans = (source: string): Span[] => {
|
|
97
|
+
const paragraphs = paragraphsOf(linesOf(source));
|
|
98
|
+
const firstSentence = paragraphs.findIndex((paragraph) => paragraph.some((line) => SENTENCE_END.test(line.text)));
|
|
99
|
+
return paragraphs
|
|
100
|
+
.slice(0, Math.max(firstSentence, 0))
|
|
101
|
+
.filter((paragraph) => paragraph.every(isCapitalLine))
|
|
102
|
+
.flatMap(spanOf);
|
|
103
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Phrases set in capitals by convention ("NOW, THEREFORE, BE IT RESOLVED" in a resolution). Pure.
|
|
2
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
3
|
+
|
|
4
|
+
const COMMA_OR_SPACE = /,?\s+/u;
|
|
5
|
+
|
|
6
|
+
const wordsOf = (text: string): string => text.trim().split(COMMA_OR_SPACE).join(" ");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Whether a run of capitals is made only of the listed phrases of several words, one after another ("NOW, THEREFORE" then
|
|
10
|
+
* "BE IT RESOLVED"). A comma after a word, as a run of capitals writes it, is ignored. One-word entries (MUST) match nothing here.
|
|
11
|
+
*/
|
|
12
|
+
export const isConventionalPhrase = (run: string, entries: Iterable<string>): boolean => {
|
|
13
|
+
const phrases = [...entries].map(wordsOf).filter((phrase) => phrase.includes(" "));
|
|
14
|
+
if (phrases.length === 0) return false;
|
|
15
|
+
const one = `(?:${phrases.map(escapeRegExp).join("|")})`;
|
|
16
|
+
return new RegExp(`^${one}(?: ${one})*$`, "u").test(wordsOf(run));
|
|
17
|
+
};
|