chaffjs 0.36.0 → 0.38.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 +2 -0
- package/README.md +2 -0
- package/dist/acronym-expansions.d.ts.map +1 -1
- package/dist/acronym-expansions.js +8 -1
- package/dist/acronym-expansions.js.map +1 -1
- package/dist/ai-score/human-shares.d.ts.map +1 -1
- package/dist/ai-score/human-shares.js +36 -8
- package/dist/ai-score/human-shares.js.map +1 -1
- package/dist/alternative-words.d.ts +8 -0
- package/dist/alternative-words.d.ts.map +1 -0
- package/dist/alternative-words.js +15 -0
- package/dist/alternative-words.js.map +1 -0
- package/dist/article-h-style.d.ts +7 -0
- package/dist/article-h-style.d.ts.map +1 -0
- package/dist/article-h-style.js +12 -0
- package/dist/article-h-style.js.map +1 -0
- package/dist/bracket-annotation.d.ts +6 -0
- package/dist/bracket-annotation.d.ts.map +1 -0
- package/dist/bracket-annotation.js +46 -0
- package/dist/bracket-annotation.js.map +1 -0
- package/dist/compare/misopened-quotes.d.ts +7 -0
- package/dist/compare/misopened-quotes.d.ts.map +1 -0
- package/dist/compare/misopened-quotes.js +22 -0
- package/dist/compare/misopened-quotes.js.map +1 -0
- package/dist/compare/outcome.d.ts +2 -0
- package/dist/compare/outcome.d.ts.map +1 -1
- package/dist/compare/outcome.js +5 -2
- package/dist/compare/outcome.js.map +1 -1
- package/dist/compare/render.d.ts +1 -1
- package/dist/compare/render.d.ts.map +1 -1
- package/dist/compare/render.js +14 -4
- package/dist/compare/render.js.map +1 -1
- package/dist/compare/respelled.d.ts +19 -0
- package/dist/compare/respelled.d.ts.map +1 -0
- package/dist/compare/respelled.js +52 -0
- package/dist/compare/respelled.js.map +1 -0
- package/dist/compare/text-atoms.d.ts +1 -1
- package/dist/compare/text-atoms.d.ts.map +1 -1
- package/dist/compare/text-atoms.js +8 -2
- package/dist/compare/text-atoms.js.map +1 -1
- package/dist/compare/text.d.ts +2 -1
- package/dist/compare/text.d.ts.map +1 -1
- package/dist/compare/text.js +7 -2
- package/dist/compare/text.js.map +1 -1
- package/dist/contact-entry.d.ts +8 -0
- package/dist/contact-entry.d.ts.map +1 -0
- package/dist/contact-entry.js +16 -0
- package/dist/contact-entry.js.map +1 -0
- package/dist/contraction-words.d.ts +2 -0
- package/dist/contraction-words.d.ts.map +1 -0
- package/dist/contraction-words.js +11 -0
- package/dist/contraction-words.js.map +1 -0
- package/dist/derived/relative-dates.d.ts +4 -0
- package/dist/derived/relative-dates.d.ts.map +1 -1
- package/dist/derived/relative-dates.js +28 -1
- package/dist/derived/relative-dates.js.map +1 -1
- package/dist/detectors/abnf-grammar.d.ts +10 -0
- package/dist/detectors/abnf-grammar.d.ts.map +1 -0
- package/dist/detectors/abnf-grammar.js +65 -0
- package/dist/detectors/abnf-grammar.js.map +1 -0
- package/dist/detectors/acronym-context.d.ts +9 -0
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +29 -0
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +37 -6
- package/dist/detectors/acronym-expansion.js.map +1 -1
- package/dist/detectors/acronym-gloss.d.ts +4 -0
- package/dist/detectors/acronym-gloss.d.ts.map +1 -0
- package/dist/detectors/acronym-gloss.js +28 -0
- package/dist/detectors/acronym-gloss.js.map +1 -0
- package/dist/detectors/acronym-known.d.ts +1 -1
- package/dist/detectors/acronym-known.d.ts.map +1 -1
- package/dist/detectors/acronym-known.js +11 -3
- package/dist/detectors/acronym-known.js.map +1 -1
- package/dist/detectors/acronym-link.d.ts +5 -0
- package/dist/detectors/acronym-link.d.ts.map +1 -1
- package/dist/detectors/acronym-link.js +33 -0
- package/dist/detectors/acronym-link.js.map +1 -1
- package/dist/detectors/acronym-mention.d.ts +5 -0
- package/dist/detectors/acronym-mention.d.ts.map +1 -0
- package/dist/detectors/acronym-mention.js +34 -0
- package/dist/detectors/acronym-mention.js.map +1 -0
- package/dist/detectors/acronym-name.js +2 -2
- package/dist/detectors/acronym-name.js.map +1 -1
- package/dist/detectors/addressee-title-edge.d.ts +21 -0
- package/dist/detectors/addressee-title-edge.d.ts.map +1 -0
- package/dist/detectors/addressee-title-edge.js +22 -0
- package/dist/detectors/addressee-title-edge.js.map +1 -0
- package/dist/detectors/adversative-ga.d.ts +4 -0
- package/dist/detectors/adversative-ga.d.ts.map +1 -0
- package/dist/detectors/adversative-ga.js +19 -0
- package/dist/detectors/adversative-ga.js.map +1 -0
- package/dist/detectors/agreement-slip.d.ts +3 -1
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +31 -3
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/ai-phrasing.d.ts +2 -1
- package/dist/detectors/ai-phrasing.d.ts.map +1 -1
- package/dist/detectors/ai-phrasing.js +5 -2
- package/dist/detectors/ai-phrasing.js.map +1 -1
- package/dist/detectors/alnum-number.d.ts +4 -0
- package/dist/detectors/alnum-number.d.ts.map +1 -0
- package/dist/detectors/alnum-number.js +11 -0
- package/dist/detectors/alnum-number.js.map +1 -0
- package/dist/detectors/asker-voice.d.ts +6 -0
- package/dist/detectors/asker-voice.d.ts.map +1 -0
- package/dist/detectors/asker-voice.js +18 -0
- package/dist/detectors/asker-voice.js.map +1 -0
- package/dist/detectors/bare-comparative.d.ts +6 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +48 -2
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +4 -0
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bold-emphasis.d.ts +6 -0
- package/dist/detectors/bold-emphasis.d.ts.map +1 -0
- package/dist/detectors/bold-emphasis.js +38 -0
- package/dist/detectors/bold-emphasis.js.map +1 -0
- package/dist/detectors/bold-label.d.ts +2 -0
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +2 -0
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/broken-link.d.ts.map +1 -1
- package/dist/detectors/broken-link.js +13 -4
- package/dist/detectors/broken-link.js.map +1 -1
- package/dist/detectors/capitalised-term.d.ts +4 -0
- package/dist/detectors/capitalised-term.d.ts.map +1 -1
- package/dist/detectors/capitalised-term.js +18 -1
- package/dist/detectors/capitalised-term.js.map +1 -1
- package/dist/detectors/caps-caption.d.ts +14 -4
- package/dist/detectors/caps-caption.d.ts.map +1 -1
- package/dist/detectors/caps-caption.js +36 -9
- package/dist/detectors/caps-caption.js.map +1 -1
- package/dist/detectors/case-citation.d.ts +15 -0
- package/dist/detectors/case-citation.d.ts.map +1 -0
- package/dist/detectors/case-citation.js +50 -0
- package/dist/detectors/case-citation.js.map +1 -0
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +140 -25
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/citation-entry.d.ts +4 -0
- package/dist/detectors/citation-entry.d.ts.map +1 -1
- package/dist/detectors/citation-entry.js +17 -5
- package/dist/detectors/citation-entry.js.map +1 -1
- package/dist/detectors/citation-marks.d.ts +8 -0
- package/dist/detectors/citation-marks.d.ts.map +1 -1
- package/dist/detectors/citation-marks.js +74 -13
- package/dist/detectors/citation-marks.js.map +1 -1
- package/dist/detectors/citation-note.d.ts +18 -0
- package/dist/detectors/citation-note.d.ts.map +1 -0
- package/dist/detectors/citation-note.js +60 -0
- package/dist/detectors/citation-note.js.map +1 -0
- package/dist/detectors/citation-sentence.d.ts +8 -0
- package/dist/detectors/citation-sentence.d.ts.map +1 -0
- package/dist/detectors/citation-sentence.js +40 -0
- package/dist/detectors/citation-sentence.js.map +1 -0
- package/dist/detectors/citation-style.d.ts.map +1 -1
- package/dist/detectors/citation-style.js +3 -1
- package/dist/detectors/citation-style.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +24 -2
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/contraction-mention.d.ts +3 -0
- package/dist/detectors/contraction-mention.d.ts.map +1 -0
- package/dist/detectors/contraction-mention.js +22 -0
- package/dist/detectors/contraction-mention.js.map +1 -0
- package/dist/detectors/coordinate-adjective.d.ts +15 -0
- package/dist/detectors/coordinate-adjective.d.ts.map +1 -0
- package/dist/detectors/coordinate-adjective.js +34 -0
- package/dist/detectors/coordinate-adjective.js.map +1 -0
- package/dist/detectors/dash-break.d.ts +7 -0
- package/dist/detectors/dash-break.d.ts.map +1 -0
- package/dist/detectors/dash-break.js +30 -0
- package/dist/detectors/dash-break.js.map +1 -0
- package/dist/detectors/date-any-year.d.ts.map +1 -1
- package/dist/detectors/date-any-year.js +5 -3
- package/dist/detectors/date-any-year.js.map +1 -1
- package/dist/detectors/date-run.d.ts +15 -0
- package/dist/detectors/date-run.d.ts.map +1 -0
- package/dist/detectors/date-run.js +35 -0
- package/dist/detectors/date-run.js.map +1 -0
- package/dist/detectors/date-year.d.ts +5 -2
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +27 -11
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/dateline.d.ts +16 -0
- package/dist/detectors/dateline.d.ts.map +1 -0
- package/dist/detectors/dateline.js +34 -0
- package/dist/detectors/dateline.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts +5 -2
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +18 -7
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-scope-unit.d.ts +9 -0
- package/dist/detectors/definition-scope-unit.d.ts.map +1 -0
- package/dist/detectors/definition-scope-unit.js +67 -0
- package/dist/detectors/definition-scope-unit.js.map +1 -0
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +20 -7
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/division-label-separator.d.ts +8 -0
- package/dist/detectors/division-label-separator.d.ts.map +1 -0
- package/dist/detectors/division-label-separator.js +22 -0
- package/dist/detectors/division-label-separator.js.map +1 -0
- package/dist/detectors/document-shape.d.ts +11 -0
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +37 -2
- package/dist/detectors/document-shape.js.map +1 -1
- package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
- package/dist/detectors/doubled-punctuation.js +16 -1
- package/dist/detectors/doubled-punctuation.js.map +1 -1
- package/dist/detectors/doubled-word.d.ts.map +1 -1
- package/dist/detectors/doubled-word.js +15 -2
- package/dist/detectors/doubled-word.js.map +1 -1
- package/dist/detectors/duplicate-heading.d.ts +1 -0
- package/dist/detectors/duplicate-heading.d.ts.map +1 -1
- package/dist/detectors/duplicate-heading.js +25 -3
- package/dist/detectors/duplicate-heading.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +12 -2
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +48 -9
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/empty-intensifier.d.ts +11 -0
- package/dist/detectors/empty-intensifier.d.ts.map +1 -0
- package/dist/detectors/empty-intensifier.js +28 -0
- package/dist/detectors/empty-intensifier.js.map +1 -0
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +9 -5
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/example-baseline.d.ts +7 -0
- package/dist/detectors/example-baseline.d.ts.map +1 -0
- package/dist/detectors/example-baseline.js +21 -0
- package/dist/detectors/example-baseline.js.map +1 -0
- package/dist/detectors/figure-number-list.d.ts +24 -0
- package/dist/detectors/figure-number-list.d.ts.map +1 -0
- package/dist/detectors/figure-number-list.js +78 -0
- package/dist/detectors/figure-number-list.js.map +1 -0
- package/dist/detectors/figure-order.d.ts +10 -0
- package/dist/detectors/figure-order.d.ts.map +1 -1
- package/dist/detectors/figure-order.js +36 -2
- package/dist/detectors/figure-order.js.map +1 -1
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +33 -6
- package/dist/detectors/fullwidth-alnum.js.map +1 -1
- package/dist/detectors/grade-ladder.d.ts +3 -0
- package/dist/detectors/grade-ladder.d.ts.map +1 -0
- package/dist/detectors/grade-ladder.js +19 -0
- package/dist/detectors/grade-ladder.js.map +1 -0
- package/dist/detectors/gram-furniture.d.ts +5 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +8 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-openers.d.ts +4 -3
- package/dist/detectors/gram-openers.d.ts.map +1 -1
- package/dist/detectors/gram-openers.js +26 -2
- package/dist/detectors/gram-openers.js.map +1 -1
- package/dist/detectors/heading-case.d.ts +7 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +10 -2
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-end-mark.d.ts.map +1 -1
- package/dist/detectors/heading-end-mark.js +9 -3
- package/dist/detectors/heading-end-mark.js.map +1 -1
- package/dist/detectors/heading-numbering.d.ts.map +1 -1
- package/dist/detectors/heading-numbering.js +2 -1
- package/dist/detectors/heading-numbering.js.map +1 -1
- package/dist/detectors/heading-record-rhythm.d.ts +9 -0
- package/dist/detectors/heading-record-rhythm.d.ts.map +1 -0
- package/dist/detectors/heading-record-rhythm.js +57 -0
- package/dist/detectors/heading-record-rhythm.js.map +1 -0
- package/dist/detectors/humble-for-others.d.ts +4 -0
- package/dist/detectors/humble-for-others.d.ts.map +1 -0
- package/dist/detectors/humble-for-others.js +53 -0
- package/dist/detectors/humble-for-others.js.map +1 -0
- package/dist/detectors/kanji-name-edge.d.ts +31 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -0
- package/dist/detectors/kanji-name-edge.js +64 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -0
- package/dist/detectors/kanji-run-pieces.d.ts +23 -0
- package/dist/detectors/kanji-run-pieces.d.ts.map +1 -0
- package/dist/detectors/kanji-run-pieces.js +48 -0
- package/dist/detectors/kanji-run-pieces.js.map +1 -0
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +16 -2
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lead-in-dash.d.ts +7 -0
- package/dist/detectors/lead-in-dash.d.ts.map +1 -0
- package/dist/detectors/lead-in-dash.js +41 -0
- package/dist/detectors/lead-in-dash.js.map +1 -0
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +14 -6
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/licence-notice.d.ts +9 -0
- package/dist/detectors/licence-notice.d.ts.map +1 -0
- package/dist/detectors/licence-notice.js +23 -0
- package/dist/detectors/licence-notice.js.map +1 -0
- package/dist/detectors/link-label.d.ts +3 -0
- package/dist/detectors/link-label.d.ts.map +1 -0
- package/dist/detectors/link-label.js +15 -0
- package/dist/detectors/link-label.js.map +1 -0
- package/dist/detectors/link-shape.d.ts +4 -1
- package/dist/detectors/link-shape.d.ts.map +1 -1
- package/dist/detectors/link-shape.js +7 -3
- package/dist/detectors/link-shape.js.map +1 -1
- package/dist/detectors/list-comma-aside.d.ts +14 -0
- package/dist/detectors/list-comma-aside.d.ts.map +1 -0
- package/dist/detectors/list-comma-aside.js +49 -0
- package/dist/detectors/list-comma-aside.js.map +1 -0
- package/dist/detectors/list-lead-in.d.ts.map +1 -1
- package/dist/detectors/list-lead-in.js +29 -4
- package/dist/detectors/list-lead-in.js.map +1 -1
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +51 -10
- package/dist/detectors/list-parallel.js.map +1 -1
- package/dist/detectors/list-sentence.d.ts +2 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -1
- package/dist/detectors/list-sentence.js.map +1 -1
- package/dist/detectors/mark-shape.d.ts +5 -1
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +38 -6
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/markdown-slip.d.ts.map +1 -1
- package/dist/detectors/markdown-slip.js +24 -10
- package/dist/detectors/markdown-slip.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts +2 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +28 -3
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-list-sentence.d.ts +3 -0
- package/dist/detectors/name-list-sentence.d.ts.map +1 -0
- package/dist/detectors/name-list-sentence.js +26 -0
- package/dist/detectors/name-list-sentence.js.map +1 -0
- package/dist/detectors/name-variant-reference-list.d.ts +14 -0
- package/dist/detectors/name-variant-reference-list.d.ts.map +1 -0
- package/dist/detectors/name-variant-reference-list.js +21 -0
- package/dist/detectors/name-variant-reference-list.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +7 -0
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/next-word.d.ts +4 -1
- package/dist/detectors/next-word.d.ts.map +1 -1
- package/dist/detectors/next-word.js +26 -9
- package/dist/detectors/next-word.js.map +1 -1
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +16 -1
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/numbering-readings.d.ts +8 -0
- package/dist/detectors/numbering-readings.d.ts.map +1 -0
- package/dist/detectors/numbering-readings.js +17 -0
- package/dist/detectors/numbering-readings.js.map +1 -0
- package/dist/detectors/numeral-opener.d.ts +5 -2
- package/dist/detectors/numeral-opener.d.ts.map +1 -1
- package/dist/detectors/numeral-opener.js +30 -4
- package/dist/detectors/numeral-opener.js.map +1 -1
- package/dist/detectors/open-end-names.d.ts.map +1 -1
- package/dist/detectors/open-end-names.js +23 -2
- package/dist/detectors/open-end-names.js.map +1 -1
- package/dist/detectors/open-end-scope.d.ts +2 -0
- package/dist/detectors/open-end-scope.d.ts.map +1 -1
- package/dist/detectors/open-end-scope.js +22 -1
- package/dist/detectors/open-end-scope.js.map +1 -1
- package/dist/detectors/opener-phrase.d.ts +6 -0
- package/dist/detectors/opener-phrase.d.ts.map +1 -0
- package/dist/detectors/opener-phrase.js +15 -0
- package/dist/detectors/opener-phrase.js.map +1 -0
- package/dist/detectors/opener-tail.d.ts +7 -0
- package/dist/detectors/opener-tail.d.ts.map +1 -0
- package/dist/detectors/opener-tail.js +18 -0
- package/dist/detectors/opener-tail.js.map +1 -0
- package/dist/detectors/organisation-run.d.ts +2 -7
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +7 -3
- package/dist/detectors/organisation-run.js.map +1 -1
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +68 -68
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +9 -2
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/over-general-claim.d.ts +11 -0
- package/dist/detectors/over-general-claim.d.ts.map +1 -0
- package/dist/detectors/over-general-claim.js +37 -0
- package/dist/detectors/over-general-claim.js.map +1 -0
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +53 -4
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/paragraph-run.d.ts +2 -1
- package/dist/detectors/paragraph-run.d.ts.map +1 -1
- package/dist/detectors/paragraph-run.js +4 -2
- package/dist/detectors/paragraph-run.js.map +1 -1
- package/dist/detectors/phrase-match.d.ts +6 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +5 -0
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +57 -1
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/q-fragment-answer.d.ts +15 -0
- package/dist/detectors/q-fragment-answer.d.ts.map +1 -0
- package/dist/detectors/q-fragment-answer.js +51 -0
- package/dist/detectors/q-fragment-answer.js.map +1 -0
- package/dist/detectors/quotation-paragraph.d.ts +10 -0
- package/dist/detectors/quotation-paragraph.d.ts.map +1 -0
- package/dist/detectors/quotation-paragraph.js +22 -0
- package/dist/detectors/quotation-paragraph.js.map +1 -0
- package/dist/detectors/quoted-sentences.d.ts +6 -0
- package/dist/detectors/quoted-sentences.d.ts.map +1 -0
- package/dist/detectors/quoted-sentences.js +61 -0
- package/dist/detectors/quoted-sentences.js.map +1 -0
- package/dist/detectors/quoted-wording.d.ts +9 -0
- package/dist/detectors/quoted-wording.d.ts.map +1 -0
- package/dist/detectors/quoted-wording.js +18 -0
- package/dist/detectors/quoted-wording.js.map +1 -0
- package/dist/detectors/range-notation.d.ts +2 -2
- package/dist/detectors/range-notation.d.ts.map +1 -1
- package/dist/detectors/range-notation.js +18 -7
- package/dist/detectors/range-notation.js.map +1 -1
- package/dist/detectors/register-neutral-shape.d.ts +4 -0
- package/dist/detectors/register-neutral-shape.d.ts.map +1 -0
- package/dist/detectors/register-neutral-shape.js +37 -0
- package/dist/detectors/register-neutral-shape.js.map +1 -0
- package/dist/detectors/registry/bold-emphasis.d.ts +3 -0
- package/dist/detectors/registry/bold-emphasis.d.ts.map +1 -0
- package/dist/detectors/registry/bold-emphasis.js +3 -0
- package/dist/detectors/registry/bold-emphasis.js.map +1 -0
- package/dist/detectors/registry/empty-intensifier.d.ts +3 -0
- package/dist/detectors/registry/empty-intensifier.d.ts.map +1 -0
- package/dist/detectors/registry/empty-intensifier.js +3 -0
- package/dist/detectors/registry/empty-intensifier.js.map +1 -0
- package/dist/detectors/registry/humble-for-others.d.ts +3 -0
- package/dist/detectors/registry/humble-for-others.d.ts.map +1 -0
- package/dist/detectors/registry/humble-for-others.js +3 -0
- package/dist/detectors/registry/humble-for-others.js.map +1 -0
- package/dist/detectors/registry/over-general-claim.d.ts +3 -0
- package/dist/detectors/registry/over-general-claim.d.ts.map +1 -0
- package/dist/detectors/registry/over-general-claim.js +3 -0
- package/dist/detectors/registry/over-general-claim.js.map +1 -0
- package/dist/detectors/registry/q-fragment-answer.d.ts +3 -0
- package/dist/detectors/registry/q-fragment-answer.d.ts.map +1 -0
- package/dist/detectors/registry/q-fragment-answer.js +3 -0
- package/dist/detectors/registry/q-fragment-answer.js.map +1 -0
- package/dist/detectors/registry/unused-definition.d.ts.map +1 -1
- package/dist/detectors/registry/unused-definition.js +2 -2
- package/dist/detectors/registry/unused-definition.js.map +1 -1
- package/dist/detectors/registry/weasel-word.d.ts +3 -0
- package/dist/detectors/registry/weasel-word.d.ts.map +1 -0
- package/dist/detectors/registry/weasel-word.js +3 -0
- package/dist/detectors/registry/weasel-word.js.map +1 -0
- package/dist/detectors/relative-dates.d.ts.map +1 -1
- package/dist/detectors/relative-dates.js +1 -0
- package/dist/detectors/relative-dates.js.map +1 -1
- package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -1
- package/dist/detectors/relative-pronoun-mix.js +9 -2
- package/dist/detectors/relative-pronoun-mix.js.map +1 -1
- package/dist/detectors/reported-speech.d.ts +14 -0
- package/dist/detectors/reported-speech.d.ts.map +1 -0
- package/dist/detectors/reported-speech.js +36 -0
- package/dist/detectors/reported-speech.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +7 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +45 -2
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/requirement-smell.d.ts.map +1 -1
- package/dist/detectors/requirement-smell.js +10 -6
- package/dist/detectors/requirement-smell.js.map +1 -1
- package/dist/detectors/revision-date.d.ts +30 -0
- package/dist/detectors/revision-date.d.ts.map +1 -0
- package/dist/detectors/revision-date.js +55 -0
- package/dist/detectors/revision-date.js.map +1 -0
- package/dist/detectors/sentence-counts.d.ts +16 -3
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +60 -6
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +7 -0
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +19 -7
- 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 +35 -5
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-load.d.ts +3 -1
- package/dist/detectors/sentence-load.d.ts.map +1 -1
- package/dist/detectors/sentence-load.js +6 -2
- package/dist/detectors/sentence-load.js.map +1 -1
- package/dist/detectors/sentence-title.d.ts +16 -0
- package/dist/detectors/sentence-title.d.ts.map +1 -0
- package/dist/detectors/sentence-title.js +43 -0
- package/dist/detectors/sentence-title.js.map +1 -0
- package/dist/detectors/signals.d.ts +4 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +40 -22
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/spreadsheet-grid.d.ts +3 -0
- package/dist/detectors/spreadsheet-grid.d.ts.map +1 -0
- package/dist/detectors/spreadsheet-grid.js +16 -0
- package/dist/detectors/spreadsheet-grid.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +12 -17
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +8 -2
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/superlative-name.d.ts +5 -0
- package/dist/detectors/superlative-name.d.ts.map +1 -1
- package/dist/detectors/superlative-name.js +9 -0
- package/dist/detectors/superlative-name.js.map +1 -1
- package/dist/detectors/superlative-phrase.d.ts +14 -0
- package/dist/detectors/superlative-phrase.d.ts.map +1 -0
- package/dist/detectors/superlative-phrase.js +52 -0
- package/dist/detectors/superlative-phrase.js.map +1 -0
- package/dist/detectors/superlative-scope.d.ts +1 -0
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +15 -1
- package/dist/detectors/superlative-scope.js.map +1 -1
- package/dist/detectors/titled-run.d.ts +2 -0
- package/dist/detectors/titled-run.d.ts.map +1 -1
- package/dist/detectors/titled-run.js +7 -0
- package/dist/detectors/titled-run.js.map +1 -1
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +17 -2
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/typewritten.d.ts +3 -0
- package/dist/detectors/typewritten.d.ts.map +1 -0
- package/dist/detectors/typewritten.js +6 -0
- package/dist/detectors/typewritten.js.map +1 -0
- package/dist/detectors/undefined-term.d.ts +7 -1
- package/dist/detectors/undefined-term.d.ts.map +1 -1
- package/dist/detectors/undefined-term.js +39 -11
- package/dist/detectors/undefined-term.js.map +1 -1
- package/dist/detectors/unfilled-placeholder.d.ts +4 -1
- package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
- package/dist/detectors/unfilled-placeholder.js +8 -3
- package/dist/detectors/unfilled-placeholder.js.map +1 -1
- package/dist/detectors/unknown-word.d.ts +9 -1
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +10 -2
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/unused-definition-kept.d.ts +12 -0
- package/dist/detectors/unused-definition-kept.d.ts.map +1 -0
- package/dist/detectors/unused-definition-kept.js +61 -0
- package/dist/detectors/unused-definition-kept.js.map +1 -0
- package/dist/detectors/weasel-word.d.ts +3 -0
- package/dist/detectors/weasel-word.d.ts.map +1 -0
- package/dist/detectors/weasel-word.js +22 -0
- package/dist/detectors/weasel-word.js.map +1 -0
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +10 -5
- package/dist/document.js.map +1 -1
- package/dist/field-label-heading.d.ts +8 -0
- package/dist/field-label-heading.d.ts.map +1 -0
- package/dist/field-label-heading.js +32 -0
- package/dist/field-label-heading.js.map +1 -0
- package/dist/furigana.d.ts +2 -2
- package/dist/furigana.d.ts.map +1 -1
- package/dist/furigana.js +9 -5
- package/dist/furigana.js.map +1 -1
- package/dist/genre-load.d.ts.map +1 -1
- package/dist/genre-load.js +3 -2
- package/dist/genre-load.js.map +1 -1
- package/dist/heading-numbering.d.ts +7 -1
- package/dist/heading-numbering.d.ts.map +1 -1
- package/dist/heading-numbering.js +15 -1
- package/dist/heading-numbering.js.map +1 -1
- package/dist/honorific-group.d.ts +8 -0
- package/dist/honorific-group.d.ts.map +1 -0
- package/dist/honorific-group.js +15 -0
- package/dist/honorific-group.js.map +1 -0
- package/dist/html/html-elements.d.ts +1 -0
- package/dist/html/html-elements.d.ts.map +1 -1
- package/dist/html/html-elements.js +1 -1
- package/dist/html/html-elements.js.map +1 -1
- package/dist/html/html-footnote-marks.d.ts.map +1 -1
- package/dist/html/html-footnote-marks.js +10 -4
- package/dist/html/html-footnote-marks.js.map +1 -1
- package/dist/html/html-heading-links.d.ts +2 -5
- package/dist/html/html-heading-links.d.ts.map +1 -1
- package/dist/html/html-heading-links.js +19 -2
- package/dist/html/html-heading-links.js.map +1 -1
- package/dist/html/html-links.d.ts +5 -0
- package/dist/html/html-links.d.ts.map +1 -0
- package/dist/html/html-links.js +59 -0
- package/dist/html/html-links.js.map +1 -0
- package/dist/html/html-markdown.d.ts.map +1 -1
- package/dist/html/html-markdown.js +30 -35
- package/dist/html/html-markdown.js.map +1 -1
- package/dist/html/html-section-number.d.ts +5 -0
- package/dist/html/html-section-number.d.ts.map +1 -0
- package/dist/html/html-section-number.js +19 -0
- package/dist/html/html-section-number.js.map +1 -0
- package/dist/html/html-site-chrome.d.ts.map +1 -1
- package/dist/html/html-site-chrome.js +35 -12
- package/dist/html/html-site-chrome.js.map +1 -1
- package/dist/html/html-tables.d.ts +1 -1
- package/dist/html/html-tables.d.ts.map +1 -1
- package/dist/html/html-tables.js +24 -7
- package/dist/html/html-tables.js.map +1 -1
- package/dist/html/html-widgets.d.ts +7 -0
- package/dist/html/html-widgets.d.ts.map +1 -1
- package/dist/html/html-widgets.js +33 -2
- package/dist/html/html-widgets.js.map +1 -1
- package/dist/latin-word-boundary.d.ts +5 -0
- package/dist/latin-word-boundary.d.ts.map +1 -1
- package/dist/latin-word-boundary.js +17 -0
- package/dist/latin-word-boundary.js.map +1 -1
- package/dist/leading-label.d.ts +4 -0
- package/dist/leading-label.d.ts.map +1 -0
- package/dist/leading-label.js +14 -0
- package/dist/leading-label.js.map +1 -0
- package/dist/legal-address.d.ts +2 -0
- package/dist/legal-address.d.ts.map +1 -0
- package/dist/legal-address.js +16 -0
- package/dist/legal-address.js.map +1 -0
- package/dist/link-path.d.ts +10 -0
- package/dist/link-path.d.ts.map +1 -0
- package/dist/link-path.js +66 -0
- package/dist/link-path.js.map +1 -0
- package/dist/link-shape.d.ts +3 -2
- package/dist/link-shape.d.ts.map +1 -1
- package/dist/link-shape.js +12 -3
- package/dist/link-shape.js.map +1 -1
- package/dist/name-misspelt-usual.d.ts +5 -0
- package/dist/name-misspelt-usual.d.ts.map +1 -0
- package/dist/name-misspelt-usual.js +19 -0
- package/dist/name-misspelt-usual.js.map +1 -0
- package/dist/name-word-form.d.ts +14 -0
- package/dist/name-word-form.d.ts.map +1 -0
- package/dist/name-word-form.js +34 -0
- package/dist/name-word-form.js.map +1 -0
- package/dist/newsletter-issue.d.ts +12 -0
- package/dist/newsletter-issue.d.ts.map +1 -0
- package/dist/newsletter-issue.js +24 -0
- package/dist/newsletter-issue.js.map +1 -0
- package/dist/note-paragraphs.d.ts +8 -0
- package/dist/note-paragraphs.d.ts.map +1 -0
- package/dist/note-paragraphs.js +37 -0
- package/dist/note-paragraphs.js.map +1 -0
- package/dist/notice-header.d.ts +19 -0
- package/dist/notice-header.d.ts.map +1 -0
- package/dist/notice-header.js +31 -0
- package/dist/notice-header.js.map +1 -0
- package/dist/paragraph-runs.d.ts +8 -3
- package/dist/paragraph-runs.d.ts.map +1 -1
- package/dist/paragraph-runs.js +29 -3
- package/dist/paragraph-runs.js.map +1 -1
- package/dist/plugin.d.ts +7 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/profile/parse.d.ts.map +1 -1
- package/dist/profile/parse.js +9 -0
- package/dist/profile/parse.js.map +1 -1
- package/dist/return-type.d.ts +2 -0
- package/dist/return-type.d.ts.map +1 -1
- package/dist/return-type.js +34 -15
- package/dist/return-type.js.map +1 -1
- package/dist/rule-offs.d.ts +6 -0
- package/dist/rule-offs.d.ts.map +1 -1
- package/dist/rule-offs.js +6 -0
- package/dist/rule-offs.js.map +1 -1
- package/dist/sentence-load.d.ts +2 -1
- package/dist/sentence-load.d.ts.map +1 -1
- package/dist/sentence-load.js +38 -4
- package/dist/sentence-load.js.map +1 -1
- package/dist/single-quoted-span.d.ts +8 -0
- package/dist/single-quoted-span.d.ts.map +1 -0
- package/dist/single-quoted-span.js +30 -0
- package/dist/single-quoted-span.js.map +1 -0
- package/dist/spelling-mention.d.ts +7 -0
- package/dist/spelling-mention.d.ts.map +1 -0
- package/dist/spelling-mention.js +24 -0
- package/dist/spelling-mention.js.map +1 -0
- package/dist/stage-directions.d.ts +12 -0
- package/dist/stage-directions.d.ts.map +1 -0
- package/dist/stage-directions.js +29 -0
- package/dist/stage-directions.js.map +1 -0
- package/dist/stray-space.d.ts.map +1 -1
- package/dist/stray-space.js +19 -4
- package/dist/stray-space.js.map +1 -1
- package/dist/structure/alternative-clause.d.ts +9 -0
- package/dist/structure/alternative-clause.d.ts.map +1 -0
- package/dist/structure/alternative-clause.js +43 -0
- package/dist/structure/alternative-clause.js.map +1 -0
- package/dist/structure/attached-parts.d.ts +2 -1
- package/dist/structure/attached-parts.d.ts.map +1 -1
- package/dist/structure/attached-parts.js +22 -9
- package/dist/structure/attached-parts.js.map +1 -1
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +7 -2
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/change-rate.d.ts.map +1 -1
- package/dist/structure/change-rate.js +20 -1
- package/dist/structure/change-rate.js.map +1 -1
- package/dist/structure/cited-elsewhere.d.ts +4 -0
- package/dist/structure/cited-elsewhere.d.ts.map +1 -0
- package/dist/structure/cited-elsewhere.js +15 -0
- package/dist/structure/cited-elsewhere.js.map +1 -0
- package/dist/structure/definition-use.d.ts +12 -6
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +54 -11
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/gerund-phrase.d.ts +8 -0
- package/dist/structure/gerund-phrase.d.ts.map +1 -0
- package/dist/structure/gerund-phrase.js +30 -0
- package/dist/structure/gerund-phrase.js.map +1 -0
- package/dist/structure/issues.d.ts +3 -1
- package/dist/structure/issues.d.ts.map +1 -1
- package/dist/structure/issues.js +31 -6
- package/dist/structure/issues.js.map +1 -1
- package/dist/structure/joined-labels.d.ts +8 -0
- package/dist/structure/joined-labels.d.ts.map +1 -0
- package/dist/structure/joined-labels.js +19 -0
- package/dist/structure/joined-labels.js.map +1 -0
- package/dist/structure/numbering.d.ts +10 -1
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +13 -5
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/restated-name.d.ts +7 -0
- package/dist/structure/restated-name.d.ts.map +1 -0
- package/dist/structure/restated-name.js +25 -0
- package/dist/structure/restated-name.js.map +1 -0
- package/dist/structure/summary-lines.d.ts +15 -0
- package/dist/structure/summary-lines.d.ts.map +1 -0
- package/dist/structure/summary-lines.js +19 -0
- package/dist/structure/summary-lines.js.map +1 -0
- package/dist/structure/title-lines.d.ts.map +1 -1
- package/dist/structure/title-lines.js +41 -8
- package/dist/structure/title-lines.js.map +1 -1
- package/dist/structure/unit-word.d.ts +6 -0
- package/dist/structure/unit-word.d.ts.map +1 -1
- package/dist/structure/unit-word.js +10 -0
- package/dist/structure/unit-word.js.map +1 -1
- package/dist/structure/universal.d.ts +7 -3
- package/dist/structure/universal.d.ts.map +1 -1
- package/dist/structure/universal.js +17 -5
- package/dist/structure/universal.js.map +1 -1
- package/dist/structure/wrapped-reference.d.ts +10 -0
- package/dist/structure/wrapped-reference.d.ts.map +1 -0
- package/dist/structure/wrapped-reference.js +17 -0
- package/dist/structure/wrapped-reference.js.map +1 -0
- package/dist/subheading-line.d.ts +4 -1
- package/dist/subheading-line.d.ts.map +1 -1
- package/dist/subheading-line.js +14 -2
- package/dist/subheading-line.js.map +1 -1
- package/dist/title-line.d.ts +2 -0
- package/dist/title-line.d.ts.map +1 -1
- package/dist/title-line.js +2 -1
- package/dist/title-line.js.map +1 -1
- package/dist/topic-clause.d.ts +7 -0
- package/dist/topic-clause.d.ts.map +1 -0
- package/dist/topic-clause.js +101 -0
- package/dist/topic-clause.js.map +1 -0
- package/dist/uncounted-particles.d.ts +18 -0
- package/dist/uncounted-particles.d.ts.map +1 -0
- package/dist/uncounted-particles.js +47 -0
- package/dist/uncounted-particles.js.map +1 -0
- package/dist/voice-parts.d.ts +12 -0
- package/dist/voice-parts.d.ts.map +1 -0
- package/dist/voice-parts.js +8 -0
- package/dist/voice-parts.js.map +1 -0
- package/dist/word-use.d.ts +43 -0
- package/dist/word-use.d.ts.map +1 -0
- package/dist/word-use.js +109 -0
- package/dist/word-use.js.map +1 -0
- package/genres.yaml +4 -0
- package/package.json +3 -3
- package/profiles/play.yaml +14 -0
- package/profiles/verse.yaml +14 -0
- package/rules/acronym-expansion-conflict.yaml +2 -2
- package/rules/adversative-ga-repeat.yaml +3 -2
- package/rules/agreement-slip.yaml +20 -7
- package/rules/all-caps-shouting.yaml +2 -2
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/article-sound.yaml +2 -2
- package/rules/bare-url-mix.yaml +2 -2
- package/rules/bold-emphasis.yaml +113 -0
- package/rules/bold-label-list.yaml +38 -5
- package/rules/bracket-nesting.yaml +2 -2
- package/rules/bracket-width-consistency.yaml +11 -11
- package/rules/citation-reference-mismatch.yaml +2 -2
- package/rules/clause-chain.yaml +2 -0
- package/rules/colloquial-opener.yaml +2 -2
- package/rules/colon-lead-in.yaml +2 -2
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +2 -0
- package/rules/contraction-consistency.yaml +2 -2
- package/rules/dangling-reference.yaml +2 -2
- package/rules/date-weekday-mismatch.yaml +2 -2
- package/rules/date-without-year.yaml +5 -5
- package/rules/defined-name-repeated.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/demonstrative-opener-run.yaml +4 -2
- package/rules/doubled-punctuation.yaml +2 -2
- package/rules/doubled-word.yaml +2 -2
- package/rules/duplicate-definition.yaml +2 -2
- package/rules/duplicate-heading.yaml +2 -2
- package/rules/email-greeting-closing.yaml +2 -2
- package/rules/empty-intensifier.yaml +3 -3
- package/rules/figure-reference-order.yaml +2 -2
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/heading-end-punctuation-mix.yaml +2 -2
- package/rules/heading-numbering-mix.yaml +2 -2
- package/rules/humble-for-others.yaml +4 -3
- package/rules/hyphen-as-dash.yaml +2 -2
- package/rules/kutoten-consistency.yaml +2 -2
- package/rules/latin-spacing.yaml +3 -2
- package/rules/link-text-url-mismatch.yaml +4 -4
- package/rules/list-item-form-mix.yaml +21 -6
- package/rules/max-kanji-continuous.yaml +31 -4
- package/rules/max-paragraph-length.yaml +2 -0
- package/rules/max-sentence-length.yaml +2 -2
- package/rules/max-ten.yaml +1 -0
- package/rules/missing-final-period.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-em-dash.yaml +2 -2
- package/rules/no-mixed-desumasu.yaml +3 -3
- package/rules/nominalization.yaml +8 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/numbering-gap.yaml +2 -2
- package/rules/numeral-sentence-start.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +3 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +73 -0
- package/rules/oxford-comma-consistency.yaml +3 -3
- package/rules/preamble-length.yaml +3 -2
- package/rules/q-fragment-answer.yaml +69 -0
- package/rules/range-notation-consistency.yaml +2 -2
- package/rules/relative-date-mismatch.yaml +2 -2
- package/rules/repeated-sentence-ending.yaml +2 -0
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/requirement-smell.yaml +2 -2
- package/rules/return-type-mismatch.yaml +2 -2
- package/rules/sentence-initial-conjunction-run.yaml +2 -2
- package/rules/sentence-rhythm.yaml +7 -4
- package/rules/stray-space.yaml +2 -2
- package/rules/taigen-dome-in-prose.yaml +2 -2
- package/rules/tari-unpaired.yaml +2 -2
- package/rules/teki-overuse.yaml +2 -2
- package/rules/title-case-consistency.yaml +4 -4
- package/rules/title-length.yaml +11 -4
- package/rules/topic-predicate-distance.yaml +4 -2
- package/rules/undefined-acronym.yaml +5 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/unknown-word.yaml +2 -2
- package/rules/unqualified-superlative.yaml +2 -2
- package/rules/unused-definition.yaml +2 -2
- package/rules/use-before-definition.yaml +2 -2
- package/rules/weasel-word.yaml +4 -3
- package/rules/which-that-consistency.yaml +2 -2
- package/rules/wordy-phrase.yaml +2 -2
- package/skills/chaff/SKILL.md +11 -6
- package/src/acronym-expansions.ts +11 -1
- package/src/ai-score/human-shares.ts +36 -8
- package/src/alternative-words.ts +20 -0
- package/src/article-h-style.ts +16 -0
- package/src/bracket-annotation.ts +57 -0
- package/src/compare/misopened-quotes.ts +26 -0
- package/src/compare/outcome.ts +11 -2
- package/src/compare/render.ts +20 -7
- package/src/compare/respelled.ts +68 -0
- package/src/compare/text-atoms.ts +9 -2
- package/src/compare/text.ts +12 -3
- package/src/contact-entry.ts +19 -0
- package/src/contraction-words.ts +11 -0
- package/src/derived/relative-dates.ts +32 -1
- package/src/detectors/abnf-grammar.ts +79 -0
- package/src/detectors/acronym-context.ts +42 -0
- package/src/detectors/acronym-expansion.ts +41 -7
- package/src/detectors/acronym-gloss.ts +34 -0
- package/src/detectors/acronym-known.ts +11 -3
- package/src/detectors/acronym-link.ts +38 -0
- package/src/detectors/acronym-mention.ts +44 -0
- package/src/detectors/acronym-name.ts +2 -2
- package/src/detectors/addressee-title-edge.ts +39 -0
- package/src/detectors/adversative-ga.ts +26 -0
- package/src/detectors/agreement-slip.ts +33 -4
- package/src/detectors/ai-phrasing.ts +7 -3
- package/src/detectors/alnum-number.ts +11 -0
- package/src/detectors/asker-voice.ts +24 -0
- package/src/detectors/bare-comparative.ts +64 -2
- package/src/detectors/blank-structure.ts +9 -0
- package/src/detectors/bold-emphasis.ts +45 -0
- package/src/detectors/bold-label.ts +3 -0
- package/src/detectors/broken-link.ts +13 -4
- package/src/detectors/capitalised-term.ts +26 -2
- package/src/detectors/caps-caption.ts +43 -9
- package/src/detectors/case-citation.ts +70 -0
- package/src/detectors/char-shape.ts +189 -33
- package/src/detectors/citation-entry.ts +22 -7
- package/src/detectors/citation-marks.ts +97 -15
- package/src/detectors/citation-note.ts +78 -0
- package/src/detectors/citation-sentence.ts +44 -0
- package/src/detectors/citation-style.ts +6 -1
- package/src/detectors/clause-shape.ts +27 -2
- package/src/detectors/contraction-mention.ts +24 -0
- package/src/detectors/coordinate-adjective.ts +41 -0
- package/src/detectors/dash-break.ts +45 -0
- package/src/detectors/date-any-year.ts +7 -3
- package/src/detectors/date-run.ts +39 -0
- package/src/detectors/date-year.ts +44 -10
- package/src/detectors/dateline.ts +48 -0
- package/src/detectors/defined-term-form.ts +24 -7
- package/src/detectors/definition-scope-unit.ts +90 -0
- package/src/detectors/definition-use.ts +30 -13
- package/src/detectors/division-label-separator.ts +25 -0
- package/src/detectors/document-shape.ts +44 -2
- package/src/detectors/doubled-punctuation.ts +19 -1
- package/src/detectors/doubled-word.ts +21 -2
- package/src/detectors/duplicate-heading.ts +26 -3
- package/src/detectors/email-letter.ts +59 -8
- package/src/detectors/empty-intensifier.ts +36 -0
- package/src/detectors/en-shape.ts +11 -5
- package/src/detectors/example-baseline.ts +31 -0
- package/src/detectors/figure-number-list.ts +101 -0
- package/src/detectors/figure-order.ts +43 -2
- package/src/detectors/fullwidth-alnum.ts +45 -7
- package/src/detectors/grade-ladder.ts +23 -0
- package/src/detectors/gram-furniture.ts +9 -0
- package/src/detectors/gram-openers.ts +36 -7
- package/src/detectors/heading-case.ts +11 -2
- package/src/detectors/heading-end-mark.ts +12 -4
- package/src/detectors/heading-numbering.ts +10 -1
- package/src/detectors/heading-record-rhythm.ts +57 -0
- package/src/detectors/humble-for-others.ts +63 -0
- package/src/detectors/kanji-name-edge.ts +79 -0
- package/src/detectors/kanji-run-pieces.ts +60 -0
- package/src/detectors/kutoten-consistency.ts +21 -2
- package/src/detectors/lead-in-dash.ts +43 -0
- package/src/detectors/lexicon.ts +19 -6
- package/src/detectors/licence-notice.ts +30 -0
- package/src/detectors/link-label.ts +17 -0
- package/src/detectors/link-shape.ts +7 -3
- package/src/detectors/list-comma-aside.ts +58 -0
- package/src/detectors/list-lead-in.ts +30 -2
- package/src/detectors/list-parallel.ts +58 -9
- package/src/detectors/list-sentence.ts +2 -0
- package/src/detectors/mark-shape.ts +53 -6
- package/src/detectors/markdown-slip.ts +20 -3
- package/src/detectors/missing-final-period.ts +42 -5
- package/src/detectors/name-list-sentence.ts +28 -0
- package/src/detectors/name-variant-reference-list.ts +34 -0
- package/src/detectors/name-variant.ts +7 -0
- package/src/detectors/next-word.ts +38 -9
- package/src/detectors/number-style.ts +17 -1
- package/src/detectors/numbering-readings.ts +22 -0
- package/src/detectors/numeral-opener.ts +37 -5
- package/src/detectors/open-end-names.ts +23 -2
- package/src/detectors/open-end-scope.ts +32 -2
- package/src/detectors/opener-phrase.ts +15 -0
- package/src/detectors/opener-tail.ts +19 -0
- package/src/detectors/organisation-run.ts +9 -3
- package/src/detectors/orthographic-variant.ts +87 -107
- package/src/detectors/orthography.ts +10 -2
- package/src/detectors/over-general-claim.ts +44 -0
- package/src/detectors/oxford-comma.ts +53 -4
- package/src/detectors/paragraph-run.ts +11 -2
- package/src/detectors/phrase-match.ts +6 -0
- package/src/detectors/placeholder-text.ts +62 -1
- package/src/detectors/q-fragment-answer.ts +64 -0
- package/src/detectors/quotation-paragraph.ts +28 -0
- package/src/detectors/quoted-sentences.ts +62 -0
- package/src/detectors/quoted-wording.ts +28 -0
- package/src/detectors/range-notation.ts +26 -6
- package/src/detectors/register-neutral-shape.ts +46 -0
- package/src/detectors/registry/bold-emphasis.ts +4 -0
- package/src/detectors/registry/empty-intensifier.ts +4 -0
- package/src/detectors/registry/humble-for-others.ts +4 -0
- package/src/detectors/registry/over-general-claim.ts +4 -0
- package/src/detectors/registry/q-fragment-answer.ts +4 -0
- package/src/detectors/registry/unused-definition.ts +2 -2
- package/src/detectors/registry/weasel-word.ts +4 -0
- package/src/detectors/relative-dates.ts +1 -0
- package/src/detectors/relative-pronoun-mix.ts +12 -2
- package/src/detectors/reported-speech.ts +37 -0
- package/src/detectors/request-owner.ts +62 -2
- package/src/detectors/requirement-smell.ts +12 -8
- package/src/detectors/revision-date.ts +80 -0
- package/src/detectors/sentence-counts.ts +70 -7
- package/src/detectors/sentence-ending.ts +35 -9
- package/src/detectors/sentence-length.ts +45 -5
- package/src/detectors/sentence-load.ts +6 -2
- package/src/detectors/sentence-title.ts +56 -0
- package/src/detectors/signals.ts +51 -24
- package/src/detectors/spreadsheet-grid.ts +20 -0
- package/src/detectors/structure-tree.ts +13 -17
- package/src/detectors/structure.ts +11 -3
- package/src/detectors/superlative-name.ts +10 -0
- package/src/detectors/superlative-phrase.ts +57 -0
- package/src/detectors/superlative-scope.ts +16 -1
- package/src/detectors/titled-run.ts +9 -0
- package/src/detectors/token-shape.ts +19 -2
- package/src/detectors/typewritten.ts +7 -0
- package/src/detectors/undefined-term.ts +53 -9
- package/src/detectors/unfilled-placeholder.ts +8 -3
- package/src/detectors/unknown-word.ts +11 -2
- package/src/detectors/unused-definition-kept.ts +80 -0
- package/src/detectors/weasel-word.ts +24 -0
- package/src/document.ts +17 -6
- package/src/field-label-heading.ts +41 -0
- package/src/furigana.ts +9 -5
- package/src/genre-load.ts +3 -2
- package/src/heading-numbering.ts +23 -3
- package/src/honorific-group.ts +22 -0
- package/src/html/html-elements.ts +1 -1
- package/src/html/html-footnote-marks.ts +12 -4
- package/src/html/html-heading-links.ts +25 -2
- package/src/html/html-links.ts +70 -0
- package/src/html/html-markdown.ts +42 -36
- package/src/html/html-section-number.ts +20 -0
- package/src/html/html-site-chrome.ts +70 -13
- package/src/html/html-tables.ts +29 -7
- package/src/html/html-widgets.ts +48 -1
- package/src/latin-word-boundary.ts +18 -0
- package/src/leading-label.ts +15 -0
- package/src/link-path.ts +70 -0
- package/src/link-shape.ts +15 -3
- package/src/name-misspelt-usual.ts +25 -0
- package/src/name-word-form.ts +42 -0
- package/src/newsletter-issue.ts +38 -0
- package/src/note-paragraphs.ts +48 -0
- package/src/notice-header.ts +57 -0
- package/src/paragraph-runs.ts +38 -4
- package/src/plugin.ts +4 -0
- package/src/profile/parse.ts +11 -0
- package/src/return-type.ts +38 -16
- package/src/rule-offs.ts +10 -0
- package/src/sentence-load.ts +47 -4
- package/src/single-quoted-span.ts +40 -0
- package/src/spelling-mention.ts +30 -0
- package/src/stage-directions.ts +39 -0
- package/src/stray-space.ts +24 -5
- package/src/structure/alternative-clause.ts +46 -0
- package/src/structure/attached-parts.ts +24 -9
- package/src/structure/build.ts +13 -2
- package/src/structure/change-rate.ts +21 -1
- package/src/structure/cited-elsewhere.ts +23 -0
- package/src/structure/definition-use.ts +73 -12
- package/src/structure/gerund-phrase.ts +31 -0
- package/src/structure/issues.ts +32 -6
- package/src/structure/joined-labels.ts +24 -0
- package/src/structure/numbering.ts +23 -4
- package/src/structure/restated-name.ts +28 -0
- package/src/structure/summary-lines.ts +26 -0
- package/src/structure/title-lines.ts +40 -2
- package/src/structure/unit-word.ts +12 -0
- package/src/structure/universal.ts +22 -7
- package/src/structure/wrapped-reference.ts +25 -0
- package/src/subheading-line.ts +17 -2
- package/src/title-line.ts +2 -1
- package/src/topic-clause.ts +128 -0
- package/src/uncounted-particles.ts +72 -0
- package/src/voice-parts.ts +11 -0
- package/src/word-use.ts +162 -0
|
@@ -89,15 +89,49 @@ const spanOf = (paragraph: readonly Line[]): Span[] => {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* The paragraphs
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* The paragraphs whose every line is in capitals and none ends a sentence: a letterhead or an address block at the head
|
|
93
|
+
* (BOARD OF GOVERNORS / WASHINGTON, D.C. 20551), and a heading a transcript sets in capitals on lines of its own
|
|
94
|
+
* (OPENING STATEMENT OF HON. JANE DOE, / U.S. SENATOR FROM OHIO). A warning in capitals is sentences, so it is not one. A
|
|
95
|
+
* document with no sentence has no prose to tell such a paragraph apart from.
|
|
95
96
|
*/
|
|
96
|
-
export const
|
|
97
|
+
export const capitalParagraphSpans = (source: string): Span[] => {
|
|
97
98
|
const paragraphs = paragraphsOf(linesOf(source));
|
|
98
|
-
const
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
.filter((paragraph) => paragraph.every(isCapitalLine))
|
|
102
|
-
.flatMap(spanOf);
|
|
99
|
+
const endsSentence = (paragraph: readonly Line[]): boolean => paragraph.some((line) => SENTENCE_END.test(line.text));
|
|
100
|
+
if (!paragraphs.some(endsSentence)) return [];
|
|
101
|
+
return paragraphs.filter((paragraph) => paragraph.every(isCapitalLine) && !endsSentence(paragraph)).flatMap(spanOf);
|
|
103
102
|
};
|
|
103
|
+
|
|
104
|
+
/** The capital paragraphs and the roster names of a source, in order of where they start. */
|
|
105
|
+
export const capitalLineSpans = (source: string): Span[] =>
|
|
106
|
+
[...capitalParagraphSpans(source), ...rosterNameSpans(source)].sort((left, right) => left.start - right.start);
|
|
107
|
+
|
|
108
|
+
/** The index of the last span that starts at or before at, by halving: -1 when none does. */
|
|
109
|
+
const lastStartingBy = (spans: readonly Span[], at: number, low = 0, high = spans.length): number => {
|
|
110
|
+
if (low >= high) return low - 1;
|
|
111
|
+
const middle = Math.floor((low + high) / 2);
|
|
112
|
+
return (spans[middle]?.start ?? 0) <= at ? lastStartingBy(spans, at, middle + 1, high) : lastStartingBy(spans, at, low, middle);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** Whether inner lies wholly in one of the spans, which do not overlap and are sorted by start (capitalLineSpans). */
|
|
116
|
+
export const isWithinSorted = (spans: readonly Span[], inner: Span): boolean => {
|
|
117
|
+
const span = spans[lastStartingBy(spans, inner.start)];
|
|
118
|
+
return span !== undefined && inner.end <= span.end;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/** Columns on a line: two spaces or more, or a tab, stand between them. */
|
|
122
|
+
const COLUMN_CELL = /[^\t ]+(?: [^\t ]+)*/gu;
|
|
123
|
+
/** A name in capitals, a comma, and a place or office in ordinary case: JANE Q. DOE, Ohio / JOHN DOE, JR., New Mexico. */
|
|
124
|
+
const ROSTER_CELL = /^([A-Z][A-Z.'’-]*(?: [A-Z][A-Z.'’-]*)*(?:, [JS]R\.)?), \p{Lu}\p{Ll}+(?: \p{Lu}\p{Ll}+)*$/u;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The names of a roster: a column that holds a name in capitals and the member's place in ordinary case (a committee's
|
|
128
|
+
* members, as a hearing sets them). A run in capitals followed by a comma and prose is no roster.
|
|
129
|
+
*/
|
|
130
|
+
export const rosterNameSpans = (source: string): Span[] =>
|
|
131
|
+
linesOf(source).flatMap((line) =>
|
|
132
|
+
[...line.text.matchAll(COLUMN_CELL)].flatMap((cell) => {
|
|
133
|
+
const name = ROSTER_CELL.exec(cell[0])?.[1];
|
|
134
|
+
const start = line.start + cell.index;
|
|
135
|
+
return name === undefined ? [] : [{ start, end: start + name.length }];
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// A case citation in a court opinion: the parties' names around the joiner ("ICC v. Jersey City", "Ashwander v. TVA, 297
|
|
2
|
+
// U.S. 288") and the court and year after a pin cite ("13 F.R.D. 335, 338 (SDNY 1952)"). Capitals there are a party's or a
|
|
3
|
+
// court's name as the reporter writes it, not an acronym the writer could expand. The joiner (v.) comes from the
|
|
4
|
+
// language's word list; only the shape is here. Pure.
|
|
5
|
+
import { oneOf } from "./acronym-name.ts";
|
|
6
|
+
|
|
7
|
+
type Span = { readonly start: number; readonly end: number };
|
|
8
|
+
|
|
9
|
+
const EDGE_BEFORE = String.raw`(?<![\p{L}\p{N}_&.])`;
|
|
10
|
+
const EDGE_AFTER = String.raw`(?![\p{L}\p{N}_&])`;
|
|
11
|
+
/** A party's capitals, joined by & or / as reporters print them (AT&T, MGM/UA). */
|
|
12
|
+
const CAPITALS = String.raw`\p{Lu}[\p{Lu}&/]*\p{Lu}`;
|
|
13
|
+
/** A capitalised word of the second party's name before its capitals (United States ex rel. Chapman v. FPC). */
|
|
14
|
+
const NAME_WORD = String.raw`\p{Lu}[\p{L}.'’&-]*`;
|
|
15
|
+
/** ", 337 U.S. 426" or ", 337 U.S. at 430": the volume, the reporter and a page after a case name. */
|
|
16
|
+
const REPORTER = String.raw`,[ \t]+\d+[ \t]+\p{Lu}[\p{L}\p{N}. ]*?[ \t]+(?:at[ \t]+)?\d`;
|
|
17
|
+
|
|
18
|
+
const spansOf = (text: string, pattern: RegExp): Span[] =>
|
|
19
|
+
[...text.matchAll(pattern)].map((match) => ({ start: match.index, end: match.index + match[0].length }));
|
|
20
|
+
|
|
21
|
+
/** The capitalised words that may close a party's name after its capitals (MCI Telecomms. Corp., MGM/UA Entertainment Co.). */
|
|
22
|
+
const NAME_TAIL = String.raw`(?:[ \t]+${NAME_WORD}){0,3}`;
|
|
23
|
+
|
|
24
|
+
/** The first party in capitals, before the joiner and a second party that the reporter follows (ICC v. Jersey City, 322 U.S. 503). */
|
|
25
|
+
const firstParty = (joiner: string): RegExp =>
|
|
26
|
+
new RegExp(String.raw`${EDGE_BEFORE}${CAPITALS}(?=${NAME_TAIL}[ \t]+${joiner}[ \t]+(?:${NAME_WORD}[ \t]+){0,4}${NAME_WORD}${REPORTER})`, "gu");
|
|
27
|
+
|
|
28
|
+
/** The second party in capitals, after the joiner and before the reporter (v. ICC, 337 U.S. 426; v. MGM/UA Entertainment Co., 772 F.2d 740). */
|
|
29
|
+
const secondParty = (joiner: string): RegExp =>
|
|
30
|
+
new RegExp(String.raw`(?<=(?<![\p{L}\p{N}_])${joiner}[ \t]+(?:${NAME_WORD}[ \t]+){0,3})${CAPITALS}${EDGE_AFTER}(?=${NAME_TAIL}${REPORTER})`, "gu");
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* An agency's docket number in a citation: capitals and a hyphenated number, then a pin cite and the deciding body with a year
|
|
34
|
+
* in parentheses ("NOV/CFA 01-01, 5-6 (Nat'l Indian Gaming Comm'n May 30, 2001)").
|
|
35
|
+
*/
|
|
36
|
+
const DOCKET = new RegExp(String.raw`${EDGE_BEFORE}${CAPITALS}[ \t]+\d+-\d+(?=,[ \t]+[\d-]+[ \t]+\([^()]*\b(?:1[6-9]|20)\d{2}\))`, "gu");
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The court and year in parentheses right after a pin cite: a page after a comma or a reporter ("F.R.D. 335, 338 (SDNY 1952)")
|
|
40
|
+
* or a docket number in parentheses ("(No. 14,692d) (CC Va. 1807)"). A number after a word ("Version 2 (RFC 8305)") is not a page.
|
|
41
|
+
*/
|
|
42
|
+
const COURT_YEAR = /\((?:\p{Lu}[\p{L}.]*[ \t]){1,3}(?:1[6-9]|20)\d{2}\)/gu;
|
|
43
|
+
/** How far before the court a pin cite is read: a page number and the mark before it. */
|
|
44
|
+
const PIN_CITE_REACH = 12;
|
|
45
|
+
const PIN_CITE_BEFORE = /(?:[.,\]] \d+|\)) $/u;
|
|
46
|
+
|
|
47
|
+
const courtSpans = (text: string): Span[] =>
|
|
48
|
+
spansOf(text, COURT_YEAR).filter((span) => PIN_CITE_BEFORE.test(text.slice(Math.max(0, span.start - PIN_CITE_REACH), span.start)));
|
|
49
|
+
|
|
50
|
+
export const caseCitationSpans = (text: string, joiners: readonly string[]): Span[] => {
|
|
51
|
+
const courts = [...courtSpans(text), ...spansOf(text, DOCKET)];
|
|
52
|
+
if (joiners.length === 0) return courts;
|
|
53
|
+
const joiner = oneOf(joiners);
|
|
54
|
+
return [...spansOf(text, firstParty(joiner)), ...spansOf(text, secondParty(joiner)), ...courts];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The citations of a document, on the source. Each sentence is read (its emphasis marks are blanked, so an italic name still
|
|
59
|
+
* meets its reporter) and so is the whole source (a sentence also breaks at the dot of an abbreviated name, MCI Telecomms. Corp.).
|
|
60
|
+
*/
|
|
61
|
+
export const documentCitationSpans = (
|
|
62
|
+
sentences: readonly { readonly text: string; readonly span: Span }[],
|
|
63
|
+
source: string,
|
|
64
|
+
joiners: readonly string[],
|
|
65
|
+
): Span[] => [
|
|
66
|
+
...sentences.flatMap((sentence) =>
|
|
67
|
+
caseCitationSpans(sentence.text, joiners).map((span) => ({ start: sentence.span.start + span.start, end: sentence.span.start + span.end })),
|
|
68
|
+
),
|
|
69
|
+
...caseCitationSpans(source, joiners),
|
|
70
|
+
];
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import type { Detector, DocumentProfile, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
1
|
+
import type { Detector, DetectorOptions, DocumentProfile, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
2
2
|
import { compacted } from "./gram-place.ts";
|
|
3
3
|
import { leadingCounter, trailingPrefix } from "./counter-edge.ts";
|
|
4
|
-
import { trailingAddressee } from "./addressee-edge.ts";
|
|
4
|
+
import { trailingAddressee, type AddresseeSuffix } from "./addressee-edge.ts";
|
|
5
|
+
import { leadingPrefix, trailingTitle, type AddresseeWords } from "./addressee-title-edge.ts";
|
|
6
|
+
import { followsForm, followsUnit, holdsName, isListItem, leadingOrdinal, leadingReference, type Edge } from "./kanji-name-edge.ts";
|
|
7
|
+
import { isNameList } from "./name-list-sentence.ts";
|
|
5
8
|
import { maskAddresses } from "../address-chain.ts";
|
|
6
9
|
import { isAddressRun } from "./place-run.ts";
|
|
7
10
|
import { isOneName } from "./name-run.ts";
|
|
8
11
|
import { isOrganisationRun, type OrganisationWords } from "./organisation-run.ts";
|
|
9
|
-
import { endsInTitle, isTitlePosition, isTitledName, type TitleWords } from "./titled-run.ts";
|
|
12
|
+
import { endsInTitle, isTitlePosition, isTitledName, repeatedRuns, type TitleWords } from "./titled-run.ts";
|
|
10
13
|
import { proseText } from "../measure.ts";
|
|
11
14
|
import { parallelDotCount } from "./middle-dot.ts";
|
|
12
15
|
import { maskSpans } from "../mask.ts";
|
|
13
16
|
import { quotedSpans } from "../quoted-span.ts";
|
|
14
17
|
import { nameSpans } from "../team-names.ts";
|
|
18
|
+
import { isIn } from "../lexicon-genres.ts";
|
|
19
|
+
import { standaloneNames, unknownPieces } from "./kanji-run-pieces.ts";
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
* 文字の並びを見る検出。漢字の連なりが住所か名前かだけは、形態素解析の固有名詞と数で決める。
|
|
@@ -22,8 +27,21 @@ const KANJI_RUN = /[一-鿿]+/gu;
|
|
|
22
27
|
/**
|
|
23
28
|
* 漢字の連なりと、その文書全体の座標での範囲。quoted は括弧の中身がまるごとこの連なりであること。
|
|
24
29
|
* placed は、題の名前の置き方(括弧を閉じる、補いの括弧が続く、文がこれだけ)をしていること。
|
|
30
|
+
* after は、連なりが文の頭にあるときの、その後ろの文字(宛名の行の、空白と「殿」)。頭になければ undefined。
|
|
31
|
+
* before は、文の頭から連なりの前までの文字(空白を挟んだ法人格)。
|
|
25
32
|
*/
|
|
26
|
-
type KanjiRun = {
|
|
33
|
+
type KanjiRun = {
|
|
34
|
+
readonly text: string;
|
|
35
|
+
readonly span: Span | undefined;
|
|
36
|
+
readonly quoted: boolean;
|
|
37
|
+
readonly placed: boolean;
|
|
38
|
+
readonly after: string | undefined;
|
|
39
|
+
readonly before: string;
|
|
40
|
+
/** 文がこの連なりだけ(用語集の見出し語の行)。 */
|
|
41
|
+
readonly alone: boolean;
|
|
42
|
+
/** 名前の並び(区長、副区長、…選挙管理委員会事務局長)の、「、」で区切った 1 項目がこの連なりだけ。 */
|
|
43
|
+
readonly listItem: boolean;
|
|
44
|
+
};
|
|
27
45
|
|
|
28
46
|
const SPACE = /\s/gu;
|
|
29
47
|
|
|
@@ -38,19 +56,37 @@ const NAME_MARKS = { "「": "」", "『": "』", "【": "】" };
|
|
|
38
56
|
const maskedProse = (prose: string, profile: DocumentProfile | undefined, names: readonly string[]): string =>
|
|
39
57
|
maskSpans(maskAddresses(prose, profile), nameSpans(prose, names));
|
|
40
58
|
|
|
41
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* 鉤括弧と隅付き括弧の中身が、この範囲(文の先頭からの位置)と、漢字も平仮名も無い語(ページ、センター)だけか。
|
|
61
|
+
* 括弧でくくった名前は、書き手が 1 つの名前として示したもの(「登録業者情報検索入力ページ」)。
|
|
62
|
+
*/
|
|
42
63
|
const fillsQuote = (sentence: Sentence, start: number, end: number): boolean =>
|
|
43
|
-
quotedSpans(sentence.text, NAME_MARKS).some((span) =>
|
|
64
|
+
quotedSpans(sentence.text, NAME_MARKS).some((span) => holdsName(sentence.text, span, start, end));
|
|
44
65
|
|
|
45
66
|
const runsOf = (sentence: Sentence, profile: DocumentProfile | undefined, names: readonly string[]): KanjiRun[] => {
|
|
46
67
|
const prose = proseText(sentence);
|
|
47
68
|
const printed = compacted(sentence.text, "char").offsets;
|
|
69
|
+
const nameList = isNameList(prose);
|
|
48
70
|
return [...maskedProse(prose, profile, names).matchAll(KANJI_RUN)].map((match) => {
|
|
49
71
|
const before = prose.slice(0, match.index).replace(SPACE, "").length;
|
|
50
72
|
const [start, last] = [printed[before], printed[before + match[0].length - 1]];
|
|
51
|
-
if (start === undefined || last === undefined)
|
|
73
|
+
if (start === undefined || last === undefined)
|
|
74
|
+
return { text: match[0], span: undefined, quoted: false, placed: false, after: undefined, before: "", alone: false, listItem: false };
|
|
52
75
|
const span = { start: sentence.span.start + start, end: sentence.span.start + last + 1 };
|
|
53
|
-
|
|
76
|
+
const after = sentence.text.slice(0, start).trim() === "" ? sentence.text.slice(last + 1) : undefined;
|
|
77
|
+
const quoted = fillsQuote(sentence, start, last + 1);
|
|
78
|
+
const alone = sentence.text.slice(0, start).trim() === "" && sentence.text.slice(last + 1).trim() === "";
|
|
79
|
+
const listItem = nameList && isListItem(sentence.text, start, last + 1);
|
|
80
|
+
return {
|
|
81
|
+
text: match[0],
|
|
82
|
+
span,
|
|
83
|
+
quoted,
|
|
84
|
+
placed: isTitlePosition(sentence.text, start, last + 1),
|
|
85
|
+
after,
|
|
86
|
+
before: sentence.text.slice(0, start),
|
|
87
|
+
alone,
|
|
88
|
+
listItem,
|
|
89
|
+
};
|
|
54
90
|
});
|
|
55
91
|
};
|
|
56
92
|
|
|
@@ -59,18 +95,38 @@ type NameWords = {
|
|
|
59
95
|
readonly topUnits: ReadonlySet<string>;
|
|
60
96
|
readonly organisation: OrganisationWords;
|
|
61
97
|
readonly title: TitleWords;
|
|
98
|
+
/** 法令・制度・給付の名前を閉じる語(施行令、制度、交付金)。置き方を問わず名前を閉じる。 */
|
|
99
|
+
readonly fixedName: TitleWords;
|
|
62
100
|
/** 数の後ろで日付・時刻の位置を言う単位(月)。連なりの頭にあれば、数に付いた助数詞。 */
|
|
63
101
|
readonly positional: readonly string[];
|
|
64
102
|
/** 宛先の名前に付く語(宛、御中)。連なりの尻にあれば、名前の後ろに付いた語。 */
|
|
65
103
|
readonly addressee: readonly string[];
|
|
104
|
+
/** 宛名の並びの、組織の名前の前の「各」と後ろの役職(各…学校長、…協会会長)。 */
|
|
105
|
+
readonly addressees: AddresseeWords;
|
|
106
|
+
/** 前に書いたものを指す語(上記、当該)。連なりの頭にあれば、後ろの語に付いた指示の語。 */
|
|
107
|
+
readonly references: readonly string[];
|
|
108
|
+
/** 並べた物の後ろに付く語(等)。連なりの尻にあれば、名前の後ろに付いた語。 */
|
|
109
|
+
readonly listSuffixes: readonly string[];
|
|
110
|
+
/** 連なりを閉じる、読み手が一つの語と知っている長い語(内閣総理大臣、許可事業者)。その前で連なりを割る。 */
|
|
111
|
+
readonly knownWords: ReadonlySet<string>;
|
|
66
112
|
};
|
|
67
113
|
|
|
114
|
+
type Tail = AddresseeSuffix;
|
|
115
|
+
|
|
68
116
|
/** 1 つの文書で連なりを読むのに要るもの。titled は、文書の中で題として置かれた名前(titledNames)。 */
|
|
69
117
|
type RunContext = {
|
|
70
118
|
readonly profile: DocumentProfile | undefined;
|
|
71
119
|
readonly names: readonly string[];
|
|
72
120
|
readonly words: NameWords;
|
|
73
121
|
readonly titled: readonly string[];
|
|
122
|
+
/** 文書の文の中に二度以上出る連なり(repeatedRuns)。題を閉じる語で終われば、書き手が名前として使い回している。 */
|
|
123
|
+
readonly repeated: ReadonlySet<string>;
|
|
124
|
+
/** 文書がほかで単独の連なりとして使う組織の名前(standaloneNames: 安全保障理事会)。 */
|
|
125
|
+
readonly terms: ReadonlySet<string>;
|
|
126
|
+
/** 見出し語の行(文がその連なりだけ)を数えない文書か(用語集)。 */
|
|
127
|
+
readonly headwords: boolean;
|
|
128
|
+
/** 知っている語の語数の上限: 知っている語の字数の上限(一字一語のときの語数)。 */
|
|
129
|
+
readonly maxKnownWords: number;
|
|
74
130
|
};
|
|
75
131
|
|
|
76
132
|
const coveringOf = (tokens: readonly Token[], span: Span): number[] =>
|
|
@@ -80,34 +136,100 @@ const coveringOf = (tokens: readonly Token[], span: Span): number[] =>
|
|
|
80
136
|
* 漢字の連なりが住所(東京都港区新橋二丁目)か 1 つの名前(日本銀行)か 1 つの組織の名前(国立研究開発法人産業技術総合研究所)か。
|
|
81
137
|
* 形態素解析の地名・人名・組織名と数、組織の語彙で決める。
|
|
82
138
|
*/
|
|
83
|
-
const isPlaceName = (tokens: readonly Token[], span: Span, words: NameWords): boolean => {
|
|
139
|
+
const isPlaceName = (tokens: readonly Token[], span: Span, words: NameWords, formBefore: boolean): boolean => {
|
|
84
140
|
const covering = coveringOf(tokens, span);
|
|
85
|
-
return isAddressRun(tokens, covering, words.topUnits) || isOneName(tokens, covering) || isOrganisationRun(tokens, covering, words.organisation);
|
|
141
|
+
return isAddressRun(tokens, covering, words.topUnits) || isOneName(tokens, covering) || isOrganisationRun(tokens, covering, words.organisation, formBefore);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 題の名前か。法令・制度・給付の名前(住民基本台帳法施行令)はそれを閉じる語で終わるだけで名前。題を閉じる語
|
|
146
|
+
* (大阪市鶴見区役所公募型比較見積実施要綱、自衛隊高級幹部会同)は、ここか文書のほかの所で題として置かれているか、文書が同じ連なりを繰り返している。
|
|
147
|
+
*/
|
|
148
|
+
const isTitle = (tokens: readonly Token[], span: Span, text: string, placed: boolean, context: RunContext): boolean => {
|
|
149
|
+
const run = coveringOf(tokens, span).flatMap((index) => tokens.slice(index, index + 1));
|
|
150
|
+
if (endsInTitle(run, context.words.fixedName)) return true;
|
|
151
|
+
return endsInTitle(run, context.words.title) && (placed || isTitledName(text, context.titled) || context.repeated.has(text));
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/** 宛名の行(各国公私立高等専門学校長、…協会会長 殿): 連なりが行の頭にあり、後ろは空白と宛先に付く語だけ。 */
|
|
155
|
+
const isAddresseeLine = (run: KanjiRun, words: NameWords): boolean => {
|
|
156
|
+
const after = run.after?.trim();
|
|
157
|
+
return after !== undefined && (after === "" || words.addressee.includes(after));
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** 宛名の行か、名前の並びの 1 項目。どちらも役職を付けた名前を 1 つずつ並べたもので、尻の役職は名前の外。 */
|
|
161
|
+
const isNamedEntry = (run: KanjiRun, words: NameWords): boolean => run.listItem || isAddresseeLine(run, words);
|
|
162
|
+
|
|
163
|
+
/** 尻の外す語: 数に付く接頭の語か宛先に付く語と、宛名の行ならその前の役職(日本博物館協会会長殿の「会長殿」)。 */
|
|
164
|
+
const tailOf = (tokens: readonly Token[], run: KanjiRun, span: Span, words: NameWords): Tail | undefined => {
|
|
165
|
+
const prefix = trailingPrefix(tokens, span.end, run.text);
|
|
166
|
+
const suffix =
|
|
167
|
+
prefix === undefined
|
|
168
|
+
? (trailingAddressee(tokens, span.end, run.text, words.addressee) ?? trailingAddressee(tokens, span.end, run.text, words.listSuffixes))
|
|
169
|
+
: { surface: prefix.surface, start: prefix.span.start };
|
|
170
|
+
const title = isNamedEntry(run, words) ? trailingTitle(run.text.slice(0, run.text.length - (suffix?.surface.length ?? 0)), words.addressees) : undefined;
|
|
171
|
+
if (title === undefined) return suffix;
|
|
172
|
+
return { surface: title + (suffix?.surface ?? ""), start: (suffix?.start ?? span.end) - title.length };
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** 外す語を外した残り。頭の「各」は、宛名の行でなければ、残りが名前と決まったときだけ外す(呼び出し側が戻す)。 */
|
|
176
|
+
type Measured = { readonly rest: Span; readonly text: string; readonly keptHead: string };
|
|
177
|
+
|
|
178
|
+
/** 頭の外す語: 数に付いた助数詞、宛名の「各」、前に書いたものを指す語(上記)の順に、最初に当たったもの。prefix は「各」のとき。 */
|
|
179
|
+
const headOf = (tokens: readonly Token[], run: KanjiRun, span: Span, name: string, words: NameWords): { head?: Edge; prefix?: Token } => {
|
|
180
|
+
const counter = leadingCounter(tokens, span.start, run.text, words.positional);
|
|
181
|
+
if (counter !== undefined) return { head: counter };
|
|
182
|
+
const prefix = leadingPrefix(tokens, span.start, name, words.addressees);
|
|
183
|
+
if (prefix !== undefined) return { head: prefix, prefix };
|
|
184
|
+
const reference = leadingReference(tokens, span.start, name, words.references) ?? leadingOrdinal(tokens, span.start, name);
|
|
185
|
+
return reference === undefined ? {} : { head: reference };
|
|
86
186
|
};
|
|
87
187
|
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
)
|
|
94
|
-
|
|
188
|
+
const measuredOf = (tokens: readonly Token[], run: KanjiRun, span: Span, words: NameWords): Measured => {
|
|
189
|
+
const tail = tailOf(tokens, run, span, words);
|
|
190
|
+
const name = run.text.slice(0, run.text.length - (tail?.surface.length ?? 0));
|
|
191
|
+
const { head, prefix } = headOf(tokens, run, span, name, words);
|
|
192
|
+
const keptHead = prefix !== undefined && !isNamedEntry(run, words) ? prefix.surface : "";
|
|
193
|
+
return { rest: { start: head?.span.end ?? span.start, end: tail?.start ?? span.end }, text: name.slice(head?.surface.length ?? 0), keptHead };
|
|
194
|
+
};
|
|
95
195
|
|
|
96
196
|
/**
|
|
97
197
|
* 数えない連なりは空。頭の、数に付いた助数詞(2日日本弁護士連合会の「日」)と、尻の、数に付く接頭の語(施行令第172条の「第」)と
|
|
98
|
-
*
|
|
198
|
+
* 宛先に付く語(市政情報課宛ての「宛」)は数えない。宛名の「各」と、宛名の行の役職(各国公私立高等専門学校長の「各」と「長」)も数えない。
|
|
99
199
|
* 住所か名前かは、それを外した残りで決める(1日日本銀行の「日本銀行」)。品詞が無ければ判定しない。
|
|
100
200
|
*/
|
|
101
201
|
const measuredRun = (tokens: readonly Token[] | undefined, run: KanjiRun, context: RunContext): string => {
|
|
102
|
-
if (run.quoted) return "";
|
|
202
|
+
if (run.quoted || (context.headwords && run.alone)) return "";
|
|
103
203
|
if (tokens === undefined || run.span === undefined) return run.text;
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
204
|
+
const { rest, text, keptHead } = measuredOf(tokens, run, run.span, context.words);
|
|
205
|
+
const organisation = context.words.organisation;
|
|
206
|
+
const formBefore = rest.start === run.span.start && (followsForm(run.before, organisation.forms) || followsUnit(run.before, organisation.units));
|
|
207
|
+
if (isPlaceName(tokens, rest, context.words, formBefore) || isTitle(tokens, rest, text, run.placed, context)) return "";
|
|
208
|
+
return longestUnknown(tokens, rest, keptHead, context);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/** 語の、範囲(span)の中の字。連なりの頭や尻で外した語にまたがる語は、範囲の中だけ。 */
|
|
212
|
+
const surfaceWithin = (token: Token, span: Span): string =>
|
|
213
|
+
token.surface.slice(Math.max(0, span.start - token.span.start), Math.max(0, span.end - token.span.start));
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* 連なりの、知っている語(文書がほかで単独で使う組織の名前、連なりを閉じる決まった語)を外した残りのうち、最も長いもの。
|
|
217
|
+
* 安全保障理事会常任理事国は(安全保障理事会を単独で使う文書なら)「常任理事国」、日本国内閣総理大臣は「日本国」を数える。
|
|
218
|
+
* 名前に普通の語が続く連なり(日本弁護士連合会臨時総会決議)は、名前がその文書で単独で使われていなければ、まるごと数える。
|
|
219
|
+
*/
|
|
220
|
+
const longestUnknown = (tokens: readonly Token[], rest: Span, keptHead: string, context: RunContext): string => {
|
|
221
|
+
const covering = coveringOf(tokens, rest);
|
|
222
|
+
const words = covering.flatMap((index) => tokens.slice(index, index + 1).map((token) => surfaceWithin(token, rest)));
|
|
223
|
+
const whole = words.join("");
|
|
224
|
+
// A run as long as the text holds no known word; reading it word by word would take a pass per word.
|
|
225
|
+
if (![...context.terms, ...context.words.knownWords].some((known) => whole.includes(known))) return keptHead + whole;
|
|
226
|
+
const isKnown = (start: number, end: number): boolean => {
|
|
227
|
+
const piece = words.slice(start, end).join("");
|
|
228
|
+
return context.terms.has(piece) || (end === words.length && context.words.knownWords.has(piece));
|
|
229
|
+
};
|
|
230
|
+
return unknownPieces(words, context.maxKnownWords, isKnown)
|
|
231
|
+
.map((piece) => (piece.first ? keptHead + piece.text : piece.text))
|
|
232
|
+
.reduce((longest, piece) => (piece.length > longest.length ? piece : longest), "");
|
|
111
233
|
};
|
|
112
234
|
|
|
113
235
|
const longestKanji = (sentence: Sentence, context: RunContext): string =>
|
|
@@ -115,34 +237,68 @@ const longestKanji = (sentence: Sentence, context: RunContext): string =>
|
|
|
115
237
|
.map((run) => measuredRun(sentence.tokens, run, context))
|
|
116
238
|
.reduce((longest, run) => (run.length > longest.length ? run : longest), "");
|
|
117
239
|
|
|
240
|
+
/** 見出しの中の漢字の連なり。 */
|
|
241
|
+
const headingRuns = (doc: ProseDocument): string[] =>
|
|
242
|
+
(doc.markup?.headings ?? []).flatMap((heading) => [...heading.text.matchAll(KANJI_RUN)].map((match) => match[0]));
|
|
243
|
+
|
|
118
244
|
/**
|
|
119
245
|
* 文書の中で題として置かれた漢字の連なり: 題の置き方をした文の中の連なりと、見出しの中の連なり。
|
|
120
246
|
* 同じ名前を文の中で使えば(認定職業訓練実施奨励金の支給額)、それも題の名前と読む。
|
|
121
247
|
*/
|
|
122
248
|
const titledNames = (doc: ProseDocument, profile: DocumentProfile | undefined, names: readonly string[]): string[] => [
|
|
123
249
|
...doc.sentences.flatMap((sentence) => runsOf(sentence, profile, names).flatMap((run) => (run.placed ? [run.text] : []))),
|
|
124
|
-
...(doc
|
|
250
|
+
...headingRuns(doc),
|
|
125
251
|
];
|
|
126
252
|
|
|
253
|
+
/** 割る手がかりにする、文書が単独で使う名前の最短の字数。短い名前(事務局、理事会)は普通の語の一部にもなる。 */
|
|
254
|
+
const MIN_TERM_LENGTH = 6;
|
|
255
|
+
|
|
256
|
+
/** 文の中の漢字の連なり。 */
|
|
257
|
+
const sentenceRuns = (doc: ProseDocument, profile: DocumentProfile | undefined, names: readonly string[]): string[] =>
|
|
258
|
+
doc.sentences.flatMap((sentence) => runsOf(sentence, profile, names).map((run) => run.text));
|
|
259
|
+
|
|
260
|
+
/** 文書の genre が、rule の headword_genres(見出し語の行を数えない genre: 用語集)にあるか。 */
|
|
261
|
+
const isHeadwordGenre = (options: DetectorOptions): boolean => {
|
|
262
|
+
const genres = options.settings?.["headword_genres"];
|
|
263
|
+
const genre = options.genre;
|
|
264
|
+
return genre !== undefined && Array.isArray(genres) && genres.some((target: string) => isIn(genre, target));
|
|
265
|
+
};
|
|
266
|
+
|
|
127
267
|
/**
|
|
128
268
|
* 漢字が続くと、どこで語が切れるのか読み手が探すことになる。
|
|
129
269
|
* 「情報処理推進機構認定試験」は 12 字。ひらがなを 1 つ挟むだけで読める。
|
|
130
270
|
*/
|
|
131
271
|
export const kanjiRun: Detector = (doc, options): Finding[] => {
|
|
132
272
|
const patterns = (id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
273
|
+
const organisation: OrganisationWords = {
|
|
274
|
+
forms: patterns("organisation-form"),
|
|
275
|
+
closingForms: (doc.lexicons["organisation-form"] ?? []).filter((entry) => entry.position !== "before").map((entry) => entry.pattern),
|
|
276
|
+
units: patterns("organisation-unit"),
|
|
277
|
+
};
|
|
133
278
|
const words: NameWords = {
|
|
134
279
|
topUnits: new Set(patterns("prefecture-unit")),
|
|
135
|
-
organisation
|
|
136
|
-
forms: patterns("organisation-form"),
|
|
137
|
-
closingForms: (doc.lexicons["organisation-form"] ?? []).filter((entry) => entry.position !== "before").map((entry) => entry.pattern),
|
|
138
|
-
units: patterns("organisation-unit"),
|
|
139
|
-
},
|
|
280
|
+
organisation,
|
|
140
281
|
title: { endings: patterns("title-ending") },
|
|
282
|
+
fixedName: { endings: patterns("fixed-name-ending") },
|
|
141
283
|
positional: patterns("calendar-unit"),
|
|
142
284
|
addressee: patterns("addressee-suffix"),
|
|
285
|
+
addressees: { prefixes: patterns("addressee-prefix"), titles: patterns("addressee-title"), endings: organisation.units, forms: organisation.closingForms },
|
|
286
|
+
references: patterns("reference-prefix"),
|
|
287
|
+
listSuffixes: patterns("list-suffix"),
|
|
288
|
+
knownWords: new Set(patterns("kanji-known-word")),
|
|
143
289
|
};
|
|
144
290
|
const names = doc.names ?? [];
|
|
145
|
-
const
|
|
291
|
+
const inSentences = sentenceRuns(doc, doc.profile, names);
|
|
292
|
+
const context: RunContext = {
|
|
293
|
+
profile: doc.profile,
|
|
294
|
+
names,
|
|
295
|
+
words,
|
|
296
|
+
titled: titledNames(doc, doc.profile, names),
|
|
297
|
+
repeated: repeatedRuns(inSentences),
|
|
298
|
+
terms: standaloneNames([...inSentences, ...headingRuns(doc)], MIN_TERM_LENGTH, options.limit, organisation.units),
|
|
299
|
+
headwords: isHeadwordGenre(options),
|
|
300
|
+
maxKnownWords: Math.max(options.limit, ...[...words.knownWords].map((word) => [...word].length)),
|
|
301
|
+
};
|
|
146
302
|
return doc.sentences
|
|
147
303
|
.map((sentence) => ({ sentence, run: longestKanji(sentence, context) }))
|
|
148
304
|
.filter(({ run }) => run.length > options.limit)
|
|
@@ -21,12 +21,14 @@ export type CitationSlip =
|
|
|
21
21
|
| { readonly variant: "missing"; readonly offset: number; readonly citation: string; readonly key: string }
|
|
22
22
|
| { readonly variant: "uncited"; readonly offset: number; readonly key: string };
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/** An entry's key, and the other keys a citation may name it by (a two-word surname cited by its second word). */
|
|
25
|
+
type Keyed = { readonly key: string; readonly start: number; readonly aliases?: readonly string[] };
|
|
25
26
|
|
|
26
27
|
/** One kind of citation and its entries, and whether an entry's key is what a citation's key names. */
|
|
27
28
|
type Side = {
|
|
28
29
|
readonly entries: readonly Keyed[];
|
|
29
|
-
|
|
30
|
+
/** unsure: keys that may be no author at all, reported only when they name an entry, never as missing. */
|
|
31
|
+
readonly citations: readonly { readonly mark: CitationMark; readonly keys: readonly string[]; readonly unsure?: readonly string[] }[];
|
|
30
32
|
readonly names: (entryKey: string, citedKey: string) => boolean;
|
|
31
33
|
};
|
|
32
34
|
|
|
@@ -35,6 +37,16 @@ const LATIN = /[a-z]/u;
|
|
|
35
37
|
|
|
36
38
|
const keyOf = (cited: AuthorYear): string => `${cited.year} ${cited.author}`;
|
|
37
39
|
|
|
40
|
+
/** An author-year entry keyed by its first author, and also by each later word of a name of several (Mostafazadeh Davani). */
|
|
41
|
+
const authorYearKeyed = (entry: ReferenceEntry): Keyed[] => {
|
|
42
|
+
if (entry.authorYear === undefined) return [];
|
|
43
|
+
const { year } = entry.authorYear;
|
|
44
|
+
const aliases = (entry.otherNames ?? []).map((name) => keyOf({ year, author: name }));
|
|
45
|
+
return [{ key: keyOf(entry.authorYear), start: entry.start, ...(aliases.length === 0 ? {} : { aliases }) }];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const keysOf = (entry: Keyed): readonly string[] => [entry.key, ...(entry.aliases ?? [])];
|
|
49
|
+
|
|
38
50
|
/** A cited Japanese surname this long or longer may be the head of an entry's full name; a shorter one (林) must match whole. */
|
|
39
51
|
const MIN_PREFIX_SURNAME = 2;
|
|
40
52
|
|
|
@@ -64,21 +76,24 @@ const numberedSide = (entries: readonly ReferenceEntry[], marks: readonly Citati
|
|
|
64
76
|
});
|
|
65
77
|
|
|
66
78
|
const authorYearSide = (entries: readonly ReferenceEntry[], marks: readonly CitationMark[]): Side => {
|
|
67
|
-
const keyed = entries.flatMap(
|
|
79
|
+
const keyed = entries.flatMap(authorYearKeyed);
|
|
68
80
|
return {
|
|
69
81
|
entries: keyed,
|
|
70
|
-
citations: marks
|
|
71
|
-
|
|
82
|
+
citations: marks
|
|
83
|
+
.filter((mark) => mark.style === "author-year")
|
|
84
|
+
.map((mark) => ({ mark, keys: mark.authorYears.map(keyOf), unsure: mark.authorYears.filter((cited) => cited.severalWords === true).map(keyOf) })),
|
|
85
|
+
names: namesEntryAmong(keyed.flatMap(keysOf)),
|
|
72
86
|
};
|
|
73
87
|
};
|
|
74
88
|
|
|
75
89
|
export const sideSlips = (side: Side): CitationSlip[] => {
|
|
76
90
|
if (side.entries.length < MIN_ENTRIES || side.citations.length === 0) return [];
|
|
77
91
|
const citedKeys = [...new Set(side.citations.flatMap((citation) => citation.keys))];
|
|
78
|
-
const
|
|
92
|
+
const namesOne = (entry: Keyed, citedKey: string): boolean => keysOf(entry).some((entryKey) => side.names(entryKey, citedKey));
|
|
93
|
+
const isCited = (entry: Keyed): boolean => citedKeys.some((key) => namesOne(entry, key));
|
|
79
94
|
const missing = side.citations.flatMap((citation) =>
|
|
80
95
|
citation.keys
|
|
81
|
-
.filter((key) => !side.entries.some((entry) =>
|
|
96
|
+
.filter((key) => !(citation.unsure ?? []).includes(key) && !side.entries.some((entry) => namesOne(entry, key)))
|
|
82
97
|
.map((key): CitationSlip => ({ variant: "missing", offset: citation.mark.start, citation: citation.mark.written, key })),
|
|
83
98
|
);
|
|
84
99
|
const uncitedEntries = side.entries.filter((entry) => !isCited(entry));
|