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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { straightApostrophes } from "../orthography.ts";
|
|
2
|
+
|
|
3
|
+
const WORD = /[A-Za-z][A-Za-z'-]*/gu;
|
|
4
|
+
const POSSESSIVE = /'s$/u;
|
|
5
|
+
/** 番号が続く語(Example 4、Layer 1)は番号の札で、名前ではない。札の語は流儀によらず大文字で書く。 */
|
|
6
|
+
const NUMBER_FOLLOWS = /^\s+\d/u;
|
|
7
|
+
/** 引用符の中("Wakayama's Food Ingredients and Food Culture")は題名や人の言葉で、題の語は名前でなくても大文字になる。 */
|
|
8
|
+
const QUOTE_MARK = /[“”]/gu;
|
|
9
|
+
|
|
10
|
+
const outsideQuotes = (text: string): string =>
|
|
11
|
+
text
|
|
12
|
+
.replace(QUOTE_MARK, '"')
|
|
13
|
+
.split('"')
|
|
14
|
+
.filter((_, index) => index % 2 === 0)
|
|
15
|
+
.join(" ");
|
|
16
|
+
|
|
17
|
+
const startsUpper = (word: string): boolean => /^[A-Z]/u.test(word);
|
|
18
|
+
|
|
19
|
+
const midSentenceNames = (sentence: string): string[] =>
|
|
20
|
+
[...outsideQuotes(straightApostrophes(sentence)).matchAll(WORD)]
|
|
21
|
+
.slice(1)
|
|
22
|
+
.filter((match) => startsUpper(match[0]) && !NUMBER_FOLLOWS.test(match.input.slice(match.index + match[0].length)))
|
|
23
|
+
.map((match) => match[0].replace(POSSESSIVE, ""));
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 文書が文の途中で大文字で書く語(NOAA、Flood Inundation Mapping、Alaska)。固有の名前なので、見出しに出ても
|
|
27
|
+
* どちらの流儀でも大文字のまま。見出しの流儀の証拠に数えないよう、所有格の形(NOAA's)も添えて返す。
|
|
28
|
+
* 文の頭の語は、名前でなくても大文字になるので数えない。
|
|
29
|
+
*/
|
|
30
|
+
export const namesWrittenMidSentence = (sentences: readonly string[]): ReadonlySet<string> =>
|
|
31
|
+
new Set(sentences.flatMap(midSentenceNames).flatMap((name) => [name, `${name}'s`]));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Detector, Finding, LexiconEntry } from "../plugin.ts";
|
|
2
2
|
import { findingAt, writtenHeadings } from "./markup-finding.ts";
|
|
3
|
-
import { numberingMinorities, numberingStyleOf, UNNUMBERED, type NumberingMinority, type NumberLabel } from "../heading-numbering.ts";
|
|
3
|
+
import { numberingMinorities, numberingStyleOf, opensNumbering, UNNUMBERED, type NumberingMinority, type NumberLabel } from "../heading-numbering.ts";
|
|
4
4
|
|
|
5
5
|
const labelsOf = (entries: readonly LexiconEntry[]): NumberLabel[] =>
|
|
6
6
|
entries.map((entry) => ({ word: entry.pattern, position: entry.position === "after" ? "after" : "before" }));
|
|
@@ -28,7 +28,12 @@ export const headingNumbering: Detector = (doc): Finding[] => {
|
|
|
28
28
|
const labels = labelsOf(doc.lexicons["heading-number-label"] ?? []);
|
|
29
29
|
const matter = (doc.lexicons["unnumbered-heading"] ?? []).map((entry) => entry.pattern.toLowerCase());
|
|
30
30
|
const styles = headings.map((heading) => numberingStyleOf(heading.text, labels));
|
|
31
|
-
const read = headings.map((heading, at) => ({
|
|
31
|
+
const read = headings.map((heading, at) => ({
|
|
32
|
+
depth: heading.depth,
|
|
33
|
+
style: styles[at] ?? UNNUMBERED,
|
|
34
|
+
skipped: isFrontOrBackMatter(heading.text, matter),
|
|
35
|
+
opens: opensNumbering(heading.text, labels),
|
|
36
|
+
}));
|
|
32
37
|
return numberingMinorities(read).flatMap((minority) => {
|
|
33
38
|
const heading = headings[minority.at];
|
|
34
39
|
if (heading === undefined) return [];
|
|
@@ -6,15 +6,16 @@ import { quoteAround } from "./quote-around.ts";
|
|
|
6
6
|
/** One stray letter, and where it is in the text. */
|
|
7
7
|
export type StrayLetter = { readonly offset: number; readonly letter: string };
|
|
8
8
|
|
|
9
|
-
// Hiragana or kanji before (after katakana a letter is a label: サイズm, プランb), kana after.
|
|
10
|
-
|
|
9
|
+
// Hiragana or kanji before (after katakana a letter is a label: サイズm, プランb), kana after. Only a consonant: romaji
|
|
10
|
+
// input turns a vowel into kana at once, so a lone vowel is a word of its own (eラーニング, iモード), never a residue.
|
|
11
|
+
const STRAY = /(?<=[\p{Script=Hiragana}\p{Script=Han}々])[b-df-hj-np-tv-z](?=[\p{Script=Hiragana}\p{Script=Katakana}ー])/gu;
|
|
11
12
|
/** Marks that make the run around the letter a path, an address or an assignment (/docs/あaい, a=b). */
|
|
12
13
|
const PATH_MARK = /[/\\=@#]/u;
|
|
13
14
|
|
|
14
15
|
const runBefore = (text: string, offset: number): string => text.slice(0, offset).split(/\s/u).at(-1) ?? "";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* One lower-case
|
|
18
|
+
* One lower-case consonant between Japanese: hiragana or kanji before, kana after. A letter followed by a particle names
|
|
18
19
|
* something (変数xが, まずxを, をxで), so it is left alone; the particles come from the lexicon.
|
|
19
20
|
*/
|
|
20
21
|
export const strayLettersIn = (text: string, particles: readonly string[]): StrayLetter[] =>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A curly double quote written as the inch mark: a decimal number, then the mark, then a unit (".015 “Hg/hr",
|
|
3
|
+
* "29.92”Hg"). It quotes nothing, so it opens and closes nothing. text is the section, offset the mark's position.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A number with a decimal part right before the mark, with at most one space between. A year or a count never has one,
|
|
8
|
+
* so "In 1969 “Hurricane Camille struck" stays an unclosed quote.
|
|
9
|
+
*/
|
|
10
|
+
const DECIMAL_BEFORE = /\.\p{Nd}+[ \u00A0]?$/u;
|
|
11
|
+
|
|
12
|
+
/** A short run of letters right after the mark: the unit (Hg, in). */
|
|
13
|
+
const UNIT_AFTER = /^\p{L}{1,3}(?!\p{L})/u;
|
|
14
|
+
|
|
15
|
+
const LOOK_AROUND = 40;
|
|
16
|
+
const OPENING = "\u201C";
|
|
17
|
+
const CLOSING = "\u201D";
|
|
18
|
+
|
|
19
|
+
/** Where the paragraph holding offset ends: the next blank line, or the end of the text. */
|
|
20
|
+
const paragraphEnd = (text: string, offset: number): number => {
|
|
21
|
+
const blank = /\n[ \t\u3000]*\n/u.exec(text.slice(offset));
|
|
22
|
+
return blank === null ? text.length : offset + blank.index;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const betweenNumberAndUnit = (text: string, offset: number): boolean =>
|
|
26
|
+
DECIMAL_BEFORE.test(text.slice(Math.max(0, offset - LOOK_AROUND), offset)) && UNIT_AFTER.test(text.slice(offset + 1, offset + 1 + LOOK_AROUND));
|
|
27
|
+
|
|
28
|
+
/** A closing mark in rest that is not taken by an opening mark written after the start of rest. */
|
|
29
|
+
const closesEarlier = (rest: string): boolean => {
|
|
30
|
+
const depth = { open: 0, closed: false };
|
|
31
|
+
[...rest].forEach((mark) => {
|
|
32
|
+
if (depth.closed) return;
|
|
33
|
+
if (mark === OPENING) depth.open += 1;
|
|
34
|
+
else if (mark === CLOSING && depth.open === 0) depth.closed = true;
|
|
35
|
+
else if (mark === CLOSING) depth.open -= 1;
|
|
36
|
+
});
|
|
37
|
+
return depth.closed;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The mark at offset is an inch mark. An opening mark is one only when nothing in its paragraph closes it ("at 2.5
|
|
42
|
+
* “Hg” quotes something); a closing mark only when no quote is open.
|
|
43
|
+
*/
|
|
44
|
+
export const isInchMark = (text: string, offset: number, quoteOpen: boolean): boolean => {
|
|
45
|
+
const mark = text.charAt(offset);
|
|
46
|
+
if ((mark !== OPENING && mark !== CLOSING) || !betweenNumberAndUnit(text, offset)) return false;
|
|
47
|
+
if (mark === CLOSING) return !quoteOpen;
|
|
48
|
+
return !closesEarlier(text.slice(offset + 1, paragraphEnd(text, offset)));
|
|
49
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Detector, Finding, ProseDocument, Token } from "../plugin.ts";
|
|
2
|
+
import { compoundSlipsIn, type CompoundUse, type CompoundWord } from "../kanji-compound-slip.ts";
|
|
3
|
+
|
|
4
|
+
// Collects the document's kanji runs, from sentences, headings and table cells, each with the words the analyser cut it
|
|
5
|
+
// into, and hands them to compoundSlipsIn.
|
|
6
|
+
|
|
7
|
+
const KANJI_RUN = /[\p{Script=Han}々]+/gu;
|
|
8
|
+
|
|
9
|
+
/** The analyser's words over [offset, offset + run), by kanji index. A word without a reading is one the analyser does not know. */
|
|
10
|
+
const wordsOver = (run: string, offset: number, tokens: readonly Token[]): CompoundWord[] | undefined => {
|
|
11
|
+
const chars = Array.from(run);
|
|
12
|
+
const starts = chars.map((_, index) => offset + chars.slice(0, index).join("").length);
|
|
13
|
+
const indexOf = (position: number): number => starts.findIndex((start) => start >= position);
|
|
14
|
+
const words = tokens
|
|
15
|
+
.filter((token) => token.span.start < offset + run.length && token.span.end > offset)
|
|
16
|
+
.map((token) => {
|
|
17
|
+
const start = Math.max(0, indexOf(token.span.start));
|
|
18
|
+
const endIndex = indexOf(token.span.end);
|
|
19
|
+
const crossesRun = token.span.start < offset || token.span.end > offset + run.length;
|
|
20
|
+
return { start, end: endIndex === -1 ? starts.length : endIndex, known: token.reading !== undefined, crossesRun };
|
|
21
|
+
});
|
|
22
|
+
const covered = starts.every((_, index) => words.some((word) => word.start <= index && index < word.end));
|
|
23
|
+
return covered ? words : undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const usesIn = (text: string, base: number, tokens: readonly Token[]): CompoundUse[] =>
|
|
27
|
+
[...text.matchAll(KANJI_RUN)].map((match) => {
|
|
28
|
+
const offset = base + match.index;
|
|
29
|
+
return { compound: match[0], offset, words: wordsOver(match[0], offset, tokens) };
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const shifted = (tokens: readonly Token[], by: number): Token[] =>
|
|
33
|
+
tokens.map((token) => ({ ...token, span: { start: token.span.start + by, end: token.span.end + by } }));
|
|
34
|
+
|
|
35
|
+
const headingUses = (doc: ProseDocument): CompoundUse[] =>
|
|
36
|
+
doc.sections
|
|
37
|
+
.filter((section) => section.depth > 0)
|
|
38
|
+
.flatMap((section) => {
|
|
39
|
+
// A section's span starts after its heading line; a heading written differently from the source falls back to that line's start.
|
|
40
|
+
const found = doc.source.lastIndexOf(section.heading, section.span.start);
|
|
41
|
+
const base = found === -1 ? doc.source.lastIndexOf("\n", section.span.start - 1) + 1 : found;
|
|
42
|
+
return usesIn(section.heading, base, shifted(section.headingTokens ?? [], base));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const compoundUsesOf = (doc: ProseDocument): CompoundUse[] => [
|
|
46
|
+
...doc.sentences.flatMap((sentence) => usesIn(sentence.text, sentence.span.start, sentence.tokens ?? [])),
|
|
47
|
+
...headingUses(doc),
|
|
48
|
+
...(doc.tableCells?.() ?? []).flatMap((cell) => usesIn(cell.text, cell.start, cell.tokens ?? [])),
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
export const kanjiCompoundSlip: Detector = (doc, options): Finding[] => {
|
|
52
|
+
const ignored = new Set((options.lexicon ?? []).flatMap((entry) => Array.from(entry.pattern)));
|
|
53
|
+
return compoundSlipsIn(compoundUsesOf(doc), ignored).map((slip) => ({
|
|
54
|
+
rule: "",
|
|
55
|
+
severity: "info",
|
|
56
|
+
line: 0,
|
|
57
|
+
column: 0,
|
|
58
|
+
quote: slip.written,
|
|
59
|
+
values: { written: slip.written, usual: slip.usual, count: slip.usualCount, offset: slip.offset },
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Detector, Finding, Sentence, Span } from "../plugin.ts";
|
|
1
|
+
import type { Detector, Finding, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
2
|
+
import { latinCompanyFormRegExp, latinCompanyFormSpans } from "../latin-company-form.ts";
|
|
2
3
|
import { minorityOf } from "../orthography.ts";
|
|
3
4
|
import { isWithinAny, quotedSpans } from "../quoted-span.ts";
|
|
4
5
|
|
|
@@ -14,7 +15,9 @@ const MARKS = /[、,。.]/gu;
|
|
|
14
15
|
|
|
15
16
|
const DIGIT = /[\d0-9]/u;
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* 番号の印(行の頭や読点・空白・括弧の後ろの「1.」「2.」)。文の中の数の後ろの点(締切は10.)は文の終わり。
|
|
20
|
+
*/
|
|
18
21
|
const LIST_NUMBER = /(?:^|[\s、,,((])[\d0-9]{1,3}$/u;
|
|
19
22
|
const LIST_NUMBER_REACH = 4;
|
|
20
23
|
|
|
@@ -22,29 +25,96 @@ const LIST_NUMBER_REACH = 4;
|
|
|
22
25
|
const LATIN_LABEL = /(?:^|[^A-Za-zA-Za-z])[A-Za-zA-Za-z]{1,2}$/u;
|
|
23
26
|
const LATIN_LABEL_REACH = 3;
|
|
24
27
|
|
|
28
|
+
/** 片仮名の印(イ.ロ.ハ.)。語彙表 item-number の 1 字の片仮名で、前が片仮名でないとき(データ.の タ は語の終わり)。 */
|
|
29
|
+
const KATAKANA = /^[ァ-ヺー]$/u;
|
|
30
|
+
|
|
31
|
+
/** 句読点として数えない印と名前。kana は片仮名の項目の印、companyForms は英字の会社の形(CO.,LTD.)。 */
|
|
32
|
+
export type MarkExceptions = { readonly kana: ReadonlySet<string>; readonly companyForms: RegExp | undefined };
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 印の点の後ろには、同じ行に項目の本文が続く。行の終わりの点(対象はロ.、締切は(予定)10.)は句点。
|
|
36
|
+
* 文は「イ.」の点で割れることがあるので、文ではなく文書の行の続きを見る。
|
|
37
|
+
*/
|
|
38
|
+
const isFollowed = (source: string, offset: number): boolean => {
|
|
39
|
+
const lineEnd = source.indexOf("\n", offset);
|
|
40
|
+
return source.slice(offset + 1, lineEnd === -1 ? source.length : lineEnd).trim() !== "";
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type Place = { readonly text: string; readonly at: number; readonly source: string; readonly offset: number };
|
|
44
|
+
|
|
45
|
+
const isKanaLabel = ({ text, at, source, offset }: Place, kana: ReadonlySet<string>): boolean =>
|
|
46
|
+
kana.has(text.charAt(at - 1)) && !KATAKANA.test(text.charAt(at - 2)) && isFollowed(source, offset);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 括弧の後ろの番号。注の印の後ろ((注)2.)か、括弧で閉じた見出しの後ろの最初の番号(事項)1.)。数の後ろに本文が続くときだけ印と読む。
|
|
50
|
+
* 括弧で添えた語の後ろのほかの数(締切は(予定)10.)は文の終わり。
|
|
51
|
+
*/
|
|
52
|
+
const NOTE_NUMBER_LABEL = /[((]注[))][\d0-9]{1,3}$/u;
|
|
53
|
+
const CLOSED_FIRST_NUMBER = /[。))】]\]][11]$/u;
|
|
54
|
+
const NOTE_REACH = 6;
|
|
55
|
+
|
|
56
|
+
const FULLWIDTH_OFFSET = 0xfee0;
|
|
57
|
+
const TRAILING_NUMBER = /[\d0-9]{1,3}$/u;
|
|
58
|
+
const asNumber = (digits: string): number => Number(digits.replace(/[0-9]/gu, (char) => String.fromCharCode(char.charCodeAt(0) - FULLWIDTH_OFFSET)));
|
|
59
|
+
|
|
60
|
+
const NUMBER_POINT = /(?<![\d0-9])([\d0-9]{1,3})[..](?![\d0-9])/gu;
|
|
61
|
+
|
|
62
|
+
/** numbers の中に、1 から順に last まで、この順で並ぶか。 */
|
|
63
|
+
const countsUpTo = (numbers: readonly number[], last: number): boolean => numbers.reduce((next, number) => (number === next ? next + 1 : next), 1) > last;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 行が改行を失って続いた注(…(注)1.…持株会2.株式分割…3.有償…)の番号。同じ行の前に「1.」から一つ前までの番号の点が
|
|
67
|
+
* 順に並び、後ろに本文が続く。文の中の数の後ろの句点(締切は10.次回は11.)は、前に「1.」からの並びが無い。
|
|
68
|
+
*/
|
|
69
|
+
const isNextInRun = ({ source, offset }: Place): boolean => {
|
|
70
|
+
const lineStart = source.lastIndexOf("\n", offset) + 1;
|
|
71
|
+
const before = source.slice(lineStart, offset);
|
|
72
|
+
const digits = TRAILING_NUMBER.exec(before)?.[0];
|
|
73
|
+
if (digits === undefined || !isFollowed(source, offset)) return false;
|
|
74
|
+
const earlier = [...before.slice(0, -digits.length).matchAll(NUMBER_POINT)].map((match) => asNumber(match[1] ?? ""));
|
|
75
|
+
const previous = asNumber(digits) - 1;
|
|
76
|
+
return previous > 0 && countsUpTo(earlier, previous);
|
|
77
|
+
};
|
|
78
|
+
|
|
25
79
|
const isInsideNumber = (text: string, at: number): boolean => DIGIT.test(text.charAt(at - 1)) && DIGIT.test(text.charAt(at + 1));
|
|
26
80
|
|
|
27
|
-
const isLabelPeriod = (
|
|
28
|
-
|
|
81
|
+
const isLabelPeriod = (place: Place, kana: ReadonlySet<string>): boolean => {
|
|
82
|
+
const { text, at } = place;
|
|
83
|
+
const beforeNumber = text.slice(Math.max(0, at - LIST_NUMBER_REACH), at);
|
|
84
|
+
return (
|
|
85
|
+
isKanaLabel(place, kana) ||
|
|
86
|
+
((NOTE_NUMBER_LABEL.test(text.slice(Math.max(0, at - NOTE_REACH), at)) || CLOSED_FIRST_NUMBER.test(beforeNumber)) &&
|
|
87
|
+
isFollowed(place.source, place.offset)) ||
|
|
88
|
+
isNextInRun(place) ||
|
|
89
|
+
LIST_NUMBER.test(beforeNumber) ||
|
|
90
|
+
LATIN_LABEL.test(text.slice(Math.max(0, at - LATIN_LABEL_REACH), at))
|
|
91
|
+
);
|
|
92
|
+
};
|
|
29
93
|
|
|
30
94
|
/**
|
|
31
|
-
*
|
|
95
|
+
* 句読点として数えない「,」「.」。数の中の桁の区切りと小数点(1,000、3.5)、番号の印の点(1.はじめに、、2.確認、イ.)、
|
|
32
96
|
* 一、二文字の英字の印の後ろの点(Q.、No.)は、日本語の文の区切りではない。
|
|
33
97
|
*/
|
|
34
|
-
const isNotPunctuation = (
|
|
35
|
-
if (mark === ".") return isInsideNumber(text, at) || isLabelPeriod(
|
|
36
|
-
if (mark === ",") return isInsideNumber(text, at);
|
|
98
|
+
const isNotPunctuation = (place: Place, mark: string, kana: ReadonlySet<string>): boolean => {
|
|
99
|
+
if (mark === ".") return isInsideNumber(place.text, place.at) || isLabelPeriod(place, kana);
|
|
100
|
+
if (mark === ",") return isInsideNumber(place.text, place.at);
|
|
37
101
|
return false;
|
|
38
102
|
};
|
|
39
103
|
|
|
40
104
|
export type Mark = { readonly kind: Kind["id"]; readonly western: boolean; readonly mark: string; readonly offset: number };
|
|
41
105
|
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
106
|
+
/**
|
|
107
|
+
* 文の中の句読点。鉤括弧で引いたものの中は引いた元の書き方、英字の会社の形(CO.,LTD.)の中は名前の一部なので数えない。
|
|
108
|
+
* offset は文書の中の位置。
|
|
109
|
+
*/
|
|
110
|
+
export const marksIn = (sentence: Sentence, source: string, exceptions: MarkExceptions): Mark[] => {
|
|
111
|
+
const skipped: readonly Span[] = [...quotedSpans(sentence.text), ...latinCompanyFormSpans(sentence.text, exceptions.companyForms)];
|
|
45
112
|
return [...sentence.text.matchAll(MARKS)]
|
|
46
|
-
.filter((match) =>
|
|
47
|
-
|
|
113
|
+
.filter((match) => {
|
|
114
|
+
const place = { text: sentence.text, at: match.index, source, offset: sentence.span.start + match.index };
|
|
115
|
+
return !isNotPunctuation(place, match[0], exceptions.kana);
|
|
116
|
+
})
|
|
117
|
+
.filter((match) => !isWithinAny(skipped, { start: match.index, end: match.index }))
|
|
48
118
|
.map((match) => {
|
|
49
119
|
const western = match[0] === "," || match[0] === ".";
|
|
50
120
|
const kind = match[0] === "、" || match[0] === "," ? "comma" : "period";
|
|
@@ -76,14 +146,23 @@ const findingOf = (sentence: Sentence, entry: Mark, kind: Kind, tally: Tally): F
|
|
|
76
146
|
variant: entry.kind,
|
|
77
147
|
});
|
|
78
148
|
|
|
149
|
+
const exceptionsOf = (doc: ProseDocument): MarkExceptions => {
|
|
150
|
+
const patterns = (name: string): string[] => (doc.lexicons[name] ?? []).map((entry) => entry.pattern);
|
|
151
|
+
return {
|
|
152
|
+
kana: new Set(patterns("item-number").filter((pattern) => KATAKANA.test(pattern))),
|
|
153
|
+
companyForms: latinCompanyFormRegExp(patterns("company-form-latin")),
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
79
157
|
/**
|
|
80
158
|
* 読点(、と,)と句点(。と.)を、それぞれ文書の中でどちらかにそろえているか。混ざっていれば少ないほうを指摘する。
|
|
81
159
|
* latin-spacing と同じく、同数なら文書が先に使った書き方をその文書の書き方とする。
|
|
82
160
|
*/
|
|
83
161
|
export const kutotenConsistency: Detector = (doc, options): Finding[] => {
|
|
162
|
+
const exceptions = exceptionsOf(doc);
|
|
84
163
|
const located = doc.sentences
|
|
85
164
|
.filter((sentence) => !isCitation(sentence, doc.source))
|
|
86
|
-
.flatMap((sentence) => marksIn(sentence).map((entry) => ({ sentence, entry })));
|
|
165
|
+
.flatMap((sentence) => marksIn(sentence, doc.source, exceptions).map((entry) => ({ sentence, entry })));
|
|
87
166
|
return KINDS.flatMap((kind) => {
|
|
88
167
|
const ofKind = located.filter(({ entry }) => entry.kind === kind.id);
|
|
89
168
|
const minority = minorityOf(ofKind.map(({ entry }) => entry.western));
|
package/src/detectors/lexicon.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { joinWords } from "./word-list.ts";
|
|
2
|
+
import { pairMinority } from "./contraction-minority.ts";
|
|
2
3
|
import { straightApostrophes } from "../orthography.ts";
|
|
3
4
|
import { wordsOf } from "./structure.ts";
|
|
4
5
|
import type { Detector, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
@@ -15,10 +16,19 @@ const PER = 1000;
|
|
|
15
16
|
/** 密度を見る rule は短い文書を測らない。単位は言語で違うので床も分ける。 */
|
|
16
17
|
const FLOOR = { word: 200, char: 500 };
|
|
17
18
|
|
|
18
|
-
type Hit = { readonly sentence: Sentence; readonly matched: string };
|
|
19
|
+
type Hit = { readonly sentence: Sentence; readonly matched: string; readonly group?: string | undefined };
|
|
19
20
|
|
|
20
21
|
const hitsFor = (doc: ProseDocument, lexicon: Lexicon): Hit[] =>
|
|
21
|
-
doc.sentences.flatMap((sentence) =>
|
|
22
|
+
doc.sentences.flatMap((sentence) =>
|
|
23
|
+
lexicon.filter((entry) => entryIn(sentence, entry)).map((entry) => ({ sentence, matched: entry.pattern, group: entry.group })),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A lexicon word in group address says how the document speaks to its reader (あなたの). Alone it is the writer's chosen
|
|
28
|
+
* register, so it counts only beside a phrase from outside the group.
|
|
29
|
+
*/
|
|
30
|
+
const ADDRESS_GROUP = "address";
|
|
31
|
+
const onlyAddress = (hits: readonly Hit[]): boolean => hits.every((hit) => hit.group === ADDRESS_GROUP);
|
|
22
32
|
|
|
23
33
|
/**
|
|
24
34
|
* 床より短い文書の扱い。skip は測らない。at-floor は SHORT_LENGTH の長さの文書として測り、一つだけなら言わない(一つは礼儀)。
|
|
@@ -51,7 +61,7 @@ const densityRule =
|
|
|
51
61
|
const hits = hitsFor(doc, options.lexicon ?? []);
|
|
52
62
|
const length = wordsOf(doc);
|
|
53
63
|
const isShort = length < FLOOR[doc.lengthUnit];
|
|
54
|
-
if (hits
|
|
64
|
+
if (onlyAddress(hits) || (isShort && (short === "skip" || hits.length < SHORT_MINIMUM_HITS))) return [];
|
|
55
65
|
if (perThousand(hits.length, isShort ? SHORT_LENGTH[doc.lengthUnit] : length) <= options.limit) return [];
|
|
56
66
|
const density = perThousand(hits.length, length);
|
|
57
67
|
return hits.map((hit) => ({
|
|
@@ -68,7 +78,6 @@ const hedgingDensity = densityRule("excessive-hedging");
|
|
|
68
78
|
export const cushionDensity = densityRule("cushion-phrase-density", "at-floor");
|
|
69
79
|
/** 語彙表の語の密度だけを見る rule が共通で使う。rule の id は実行側が入れる。 */
|
|
70
80
|
export const phraseDensity = densityRule("");
|
|
71
|
-
export const vagueDensity = densityRule("vague-word-density");
|
|
72
81
|
|
|
73
82
|
/** 書いたとおりの字。行の折り返しをまたいでいたら空白 1 つに。 */
|
|
74
83
|
const writtenAt = (source: string, span: Span): string => source.slice(span.start, span.end).replace(/\s+/gu, " ").trim();
|
|
@@ -258,40 +267,51 @@ export const aiTell: Detector = (doc, options): Finding[] => {
|
|
|
258
267
|
* **どちらが正しいかは決めない。** 短縮形を使うかどうかは文体の選択で、
|
|
259
268
|
* 立場を取ると方針の違う書き手に rule ごと無視される。spec §12.3。
|
|
260
269
|
*
|
|
261
|
-
* 語彙表は対を持つ(`pattern` と `instead_of
|
|
262
|
-
*
|
|
270
|
+
* 語彙表は対を持つ(`pattern` と `instead_of`)。比べるのは対の中だけで、別の語どうしは比べない。
|
|
271
|
+
* GOV.UK の文体は「you're」を使い否定は「do not」と書く。語ごとに決めた書きかたで、混在ではない。
|
|
272
|
+
* 否定と代名詞+動詞の族にもまとめない。「don't」と「does not」を書き分ける文書もある。
|
|
263
273
|
*/
|
|
264
274
|
/**
|
|
265
275
|
* 語の境界で照合する。部分一致だと「it isn't」が「it is」を含んでしまい、
|
|
266
276
|
* 短縮形を使っている文が「使っていない」側に数えられる。
|
|
267
277
|
*/
|
|
268
|
-
const
|
|
278
|
+
const wordUses = (text: string, word: string): number => [...text.matchAll(new RegExp(`\\b${word.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}\\b`, "gu"))].length;
|
|
279
|
+
|
|
280
|
+
const containsWord = (text: string, word: string): boolean => wordUses(text, word) > 0;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* アポストロフィの形(don’t と don't)は短縮形かどうかを変えない。違うのは印刷の形で、文体ではない。
|
|
284
|
+
* 折り返した行(「do」で改行して「not」)も、空白 1 つと同じに読む。
|
|
285
|
+
*/
|
|
286
|
+
const comparableText = (sentence: Sentence): string => straightApostrophes(sentence.text).replace(/\s+/gu, " ").toLowerCase();
|
|
287
|
+
|
|
288
|
+
type MixedPair = { readonly minority: string; readonly majority: string; readonly count: number };
|
|
269
289
|
|
|
270
|
-
|
|
271
|
-
const
|
|
290
|
+
const mixedPair = (body: string, short: string, long: string): MixedPair | undefined => {
|
|
291
|
+
const uses = { short: wordUses(body, short), long: wordUses(body, long) };
|
|
292
|
+
const side = pairMinority(uses);
|
|
293
|
+
if (side === undefined) return undefined;
|
|
294
|
+
return side === "short" ? { minority: short, majority: long, count: uses.short } : { minority: long, majority: short, count: uses.long };
|
|
295
|
+
};
|
|
272
296
|
|
|
273
297
|
export const contractionMix: Detector = (doc, options): Finding[] => {
|
|
274
|
-
|
|
275
|
-
const body = doc.sentences.map(comparableText).join("
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const minorityIsShort = used.length <= spelled.length;
|
|
281
|
-
const few = minorityIsShort ? used : spelled;
|
|
282
|
-
if (few.length > options.limit) return [];
|
|
283
|
-
const wanted = few.map((pair) => (minorityIsShort ? pair.short : pair.long).toLowerCase());
|
|
298
|
+
// 文は改行でつなぐ。空白でつなぐと、箇条書きの「What we do」と次の項目「not every…」が「do not」と数えられる。
|
|
299
|
+
const body = doc.sentences.map(comparableText).join("\n");
|
|
300
|
+
const mixed = (options.lexicon ?? []).flatMap((entry) => {
|
|
301
|
+
const pair = entry.instead_of === undefined ? undefined : mixedPair(body, entry.pattern.toLowerCase(), entry.instead_of.toLowerCase());
|
|
302
|
+
return pair === undefined || pair.count > options.limit ? [] : [pair];
|
|
303
|
+
});
|
|
284
304
|
const hits = doc.sentences.flatMap((sentence) => {
|
|
285
305
|
const text = comparableText(sentence);
|
|
286
|
-
const
|
|
287
|
-
return
|
|
306
|
+
const pair = mixed.find((candidate) => containsWord(text, candidate.minority));
|
|
307
|
+
return pair === undefined ? [] : [{ sentence, pair }];
|
|
288
308
|
});
|
|
289
|
-
return hits.map((
|
|
309
|
+
return hits.map(({ sentence, pair }) => ({
|
|
290
310
|
rule: "contraction-consistency",
|
|
291
311
|
severity: "info",
|
|
292
312
|
line: 0,
|
|
293
313
|
column: 0,
|
|
294
|
-
quote:
|
|
295
|
-
values: { matched:
|
|
314
|
+
quote: sentence.text.trim(),
|
|
315
|
+
values: { matched: pair.minority, majority: pair.majority, count: pair.count, limit: options.limit, offset: sentence.span.start },
|
|
296
316
|
}));
|
|
297
317
|
};
|
|
@@ -2,7 +2,7 @@ import type { Detector, Finding, Markup, ProseDocument, Span } from "../plugin.t
|
|
|
2
2
|
import { findingAt, markupOf, quoteOf } from "./markup-finding.ts";
|
|
3
3
|
import { linkTextOf } from "../link-text.ts";
|
|
4
4
|
import { bareUrls } from "../bare-url.ts";
|
|
5
|
-
import { isFileNameAlt, isUrlText, mismatchedHost } from "../link-shape.ts";
|
|
5
|
+
import { isFieldValueUrl, isFileNameAlt, isUrlText, mismatchedHost } from "../link-shape.ts";
|
|
6
6
|
import { minorityWithin } from "../orthography.ts";
|
|
7
7
|
import { readMarkdown, spansOfType } from "../markdown-read.ts";
|
|
8
8
|
|
|
@@ -23,16 +23,23 @@ const FAILED_DESTINATION = "](";
|
|
|
23
23
|
|
|
24
24
|
const inside = (span: Span, regions: readonly Span[]): boolean => regions.some((region) => span.start >= region.start && span.start < region.end);
|
|
25
25
|
|
|
26
|
+
const isFieldValue = (source: string, url: Span): boolean => {
|
|
27
|
+
const lineStart = source.lastIndexOf("\n", url.start - 1) + 1;
|
|
28
|
+
const lineEnd = source.indexOf("\n", url.end);
|
|
29
|
+
return isFieldValueUrl(source.slice(lineStart, url.start), source.slice(url.end, lineEnd === -1 ? source.length : lineEnd));
|
|
30
|
+
};
|
|
31
|
+
|
|
26
32
|
/**
|
|
27
33
|
* The bare URLs the reader sees as text (outside links, code and quotations). A URL in a table cell is a value the table lists
|
|
28
|
-
* (an example request, a field's content), not a link the prose points to, so tables are left out
|
|
34
|
+
* (an example request, a field's content), not a link the prose points to, so tables are left out, and so is a field's value
|
|
35
|
+
* on its own line (`**Licence text** https://…`).
|
|
29
36
|
*/
|
|
30
37
|
const bareUrlSpans = (source: string, markup: Markup): Span[] => {
|
|
31
38
|
const tables = spansOfType(readMarkdown(source).root, "table");
|
|
32
39
|
return markup.texts.flatMap((text) =>
|
|
33
40
|
bareUrls(source.slice(text.start, text.end))
|
|
34
41
|
.map((url) => ({ start: text.start + url.start, end: text.start + url.end }))
|
|
35
|
-
.filter((url) => !source.startsWith(FAILED_DESTINATION, url.start - FAILED_DESTINATION.length) && !inside(url, tables)),
|
|
42
|
+
.filter((url) => !source.startsWith(FAILED_DESTINATION, url.start - FAILED_DESTINATION.length) && !inside(url, tables) && !isFieldValue(source, url)),
|
|
36
43
|
);
|
|
37
44
|
};
|
|
38
45
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// How a list item's last words are found: past the marks after them (!!, a footnote reference [^1]), which the tagger
|
|
2
|
+
// may call nouns. Pure; reads tokens only.
|
|
3
|
+
import type { Token } from "../plugin.ts";
|
|
4
|
+
|
|
5
|
+
/** Only marks (!!, ?!, …), whatever tag the tagger gave them. */
|
|
6
|
+
const MARKS_ONLY = /^[\p{P}\s]+$/u;
|
|
7
|
+
|
|
8
|
+
/** The caret that opens a footnote reference: alone after its masked bracket, or with the bracket when no definition masks it ([^). */
|
|
9
|
+
const CARET = /^\[?\^$/u;
|
|
10
|
+
|
|
11
|
+
/** The blank a masked bracket leaves before the caret. */
|
|
12
|
+
const BLANK = /^\s+$/u;
|
|
13
|
+
|
|
14
|
+
/** A footnote label after the caret: [^1], [^note-2]. */
|
|
15
|
+
const FOOTNOTE_LABEL = /^[\p{L}\p{N}_-]+$/u;
|
|
16
|
+
|
|
17
|
+
/** A token that ends an item's look but is not one of its words. */
|
|
18
|
+
export type IsMark = (token: Token) => boolean;
|
|
19
|
+
|
|
20
|
+
/** A tag-skipped token, or one made only of marks. */
|
|
21
|
+
export const markOrSkipped =
|
|
22
|
+
(skipped: ReadonlySet<string>): IsMark =>
|
|
23
|
+
(token) =>
|
|
24
|
+
skipped.has(token.pos) || MARKS_ONLY.test(token.surface);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The tokens before a footnote reference at the end (…まだ先 [^1]). The caret must carry its bracket or follow the blank
|
|
28
|
+
* its masked bracket leaves, so x^2 and "x: ^2" keep their exponent.
|
|
29
|
+
*/
|
|
30
|
+
export const withoutFootnoteReference = (tokens: readonly Token[], isMark: IsMark): readonly Token[] => {
|
|
31
|
+
const caret = tokens.findLastIndex((token) => CARET.test(token.surface));
|
|
32
|
+
const opener = tokens[caret];
|
|
33
|
+
const before = tokens[caret - 1];
|
|
34
|
+
if (opener === undefined || !(opener.surface.startsWith("[") || (before !== undefined && BLANK.test(before.surface)))) return tokens;
|
|
35
|
+
const label = tokens.slice(caret + 1);
|
|
36
|
+
return label.every((token) => isMark(token) || FOOTNOTE_LABEL.test(token.surface)) ? tokens.slice(0, caret) : tokens;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** The tokens up to the last word: the marks after it dropped. */
|
|
40
|
+
export const withoutTrailingMarks = (tokens: readonly Token[], isMark: IsMark): readonly Token[] =>
|
|
41
|
+
tokens.slice(0, tokens.findLastIndex((token) => !isMark(token)) + 1);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A noun with あり or なし right after it (翻訳あり, 駐車場なし): a headline's "with" or "without", not a predicate. A
|
|
45
|
+
* particle between them (翻訳があり) makes it a clause. `endings` holds the words, from the word list headline-ending.
|
|
46
|
+
*/
|
|
47
|
+
export const endsAsHeadline = (words: readonly Token[], endings: ReadonlySet<string>): boolean => {
|
|
48
|
+
const last = words.at(-1);
|
|
49
|
+
const before = words.at(-2);
|
|
50
|
+
return last !== undefined && endings.has(last.surface) && (before?.pos === "NOUN" || before?.pos === "PROPN");
|
|
51
|
+
};
|