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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Detector, Finding, Lexicon, ProseDocument, Sentence } from "../plugin.ts";
|
|
2
|
+
import { entryEnds, entryIn } from "./lexicon-match.ts";
|
|
3
|
+
import { wordsOf } from "./structure.ts";
|
|
4
|
+
import { MIN_DOCUMENT_LENGTH } from "./signals.ts";
|
|
5
|
+
|
|
6
|
+
const PER = 1000;
|
|
7
|
+
const TENTHS = 10;
|
|
8
|
+
/** 一つ二つは普通の言い方。三つ目から数える。 */
|
|
9
|
+
const MIN_USES = 3;
|
|
10
|
+
/** 「everyone」だけを繰り返す文書(チームの全員)は、決まった言い方が一つあるだけで、一般化を重ねてはいない。 */
|
|
11
|
+
const MIN_PHRASES = 2;
|
|
12
|
+
|
|
13
|
+
/** 一つの文の、大きく括る言い方。使った回数だけ並ぶ。 */
|
|
14
|
+
export type SweepingSentence = { readonly sentence: Sentence; readonly phrases: readonly string[] };
|
|
15
|
+
|
|
16
|
+
const usesIn = (sentence: Sentence, lexicon: Lexicon): string[] => lexicon.flatMap((entry) => entryEnds(sentence, entry).map(() => entry.pattern));
|
|
17
|
+
|
|
18
|
+
/** 大きく括る言い方を使った文。weasel-word が言う文(most people agree)は、同じ文を二度言わないので数えない。 */
|
|
19
|
+
export const sweepingSentences = (doc: ProseDocument, lexicon: Lexicon): SweepingSentence[] => {
|
|
20
|
+
const weasel = doc.lexicons["weasel-word"] ?? [];
|
|
21
|
+
return doc.sentences
|
|
22
|
+
.filter((sentence) => sentence.embeddedLanguage === undefined && !weasel.some((entry) => entryIn(sentence, entry)))
|
|
23
|
+
.map((sentence) => ({ sentence, phrases: usesIn(sentence, lexicon) }))
|
|
24
|
+
.filter((found) => found.phrases.length > 0);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const findingOf = (found: SweepingSentence, values: Readonly<Record<string, number>>): Finding => ({
|
|
28
|
+
rule: "",
|
|
29
|
+
severity: "info",
|
|
30
|
+
line: 0,
|
|
31
|
+
column: 0,
|
|
32
|
+
quote: found.sentence.text.trim(),
|
|
33
|
+
values: { matched: found.phrases[0] ?? "", ...values, offset: found.sentence.span.start },
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** 大きく括る言い方(most people、nobody)の 1000 語あたりの数。二種類以上を三つ以上使い、上限を超えたら、使った文をすべて言う。 */
|
|
37
|
+
export const overGeneralClaim: Detector = (doc, options): Finding[] => {
|
|
38
|
+
const found = sweepingSentences(doc, options.lexicon ?? []);
|
|
39
|
+
const uses = found.flatMap((entry) => entry.phrases);
|
|
40
|
+
const length = wordsOf(doc);
|
|
41
|
+
if (uses.length < MIN_USES || new Set(uses).size < MIN_PHRASES || length < MIN_DOCUMENT_LENGTH[doc.lengthUnit]) return [];
|
|
42
|
+
const density = Math.round((uses.length / length) * PER * TENTHS) / TENTHS;
|
|
43
|
+
return density <= options.limit ? [] : found.map((entry) => findingOf(entry, { count: uses.length, density, limit: options.limit }));
|
|
44
|
+
};
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
shapeOf,
|
|
27
27
|
} from "./list-item.ts";
|
|
28
28
|
import { listReader, type ItemList } from "./list-items.ts";
|
|
29
|
-
import { APPOSITIVE_ANCHOR, isListConjunction, listSentenceOf, VERBAL, type ItemScope, type ListWords } from "./list-sentence.ts";
|
|
29
|
+
import { APPOSITIVE_ANCHOR, isListConjunction, listSentenceOf, NOMINAL, VERBAL, type ItemScope, type ListWords } from "./list-sentence.ts";
|
|
30
30
|
import {
|
|
31
31
|
after,
|
|
32
32
|
contentOnlyWith,
|
|
@@ -42,10 +42,14 @@ import {
|
|
|
42
42
|
some,
|
|
43
43
|
wholeList,
|
|
44
44
|
withoutFirst,
|
|
45
|
+
type Member,
|
|
45
46
|
type View,
|
|
46
47
|
} from "./list-view.ts";
|
|
47
48
|
import { lowerBound, type TokenRange } from "./token-column.ts";
|
|
48
49
|
import { followsPostcode } from "./postcode-end.ts";
|
|
50
|
+
import { withoutCoordinateAdjective } from "./coordinate-adjective.ts";
|
|
51
|
+
import { dashBreaks } from "./dash-break.ts";
|
|
52
|
+
import { namesDivision, qualifiesPrevious } from "./list-comma-aside.ts";
|
|
49
53
|
|
|
50
54
|
const EMPTY: TokenRange = { start: 0, end: 0 };
|
|
51
55
|
|
|
@@ -109,6 +113,31 @@ const afterClosedList = (view: View): View => {
|
|
|
109
113
|
return hasContent(scope, rest) ? { ...after(view, closing), pre: rest } : withoutLead(after(view, closing));
|
|
110
114
|
};
|
|
111
115
|
|
|
116
|
+
const opensAsNoun = (scope: ItemScope, item: TokenRange): boolean => {
|
|
117
|
+
const opening = openingOf(scope, item);
|
|
118
|
+
return opening !== undefined && (opening.pos === "DET" || NOMINAL.has(opening.pos));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const opensAsPredicate = (scope: ItemScope, item: TokenRange): boolean => {
|
|
122
|
+
const opening = openingOf(scope, item);
|
|
123
|
+
return opening !== undefined && VERBAL.has(opening.pos) && !isParticiple(opening);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 読点で挟んだ例の句が主語と述語のあいだにある形(Any services not listed above, such as connected services, are excluded and
|
|
128
|
+
* are not authorized)。句は読点の直後から始まり、例は名詞の句で、句の後ろの項目は動詞で始まる。主語も句も並びの項目ではなく、
|
|
129
|
+
* 並びがあるなら句の後ろから(are excluded and are not authorized は 2 つ)。例の中の分詞(connected)は名詞にかかる語で、
|
|
130
|
+
* 述語と同じ形と読まない。句の前は並びの最初の項目で、名詞の句(主語)。動詞で始まれば述語の並びの項目
|
|
131
|
+
* (Review backups, such as daily snapshots, update indexes and archive logs は 3 つ)。
|
|
132
|
+
*/
|
|
133
|
+
const isAsideBeforePredicate = (view: View, phrase: Member, examples: TokenRange): boolean => {
|
|
134
|
+
const { scope } = view.list;
|
|
135
|
+
const [subject, next] = [firstOf(view), firstOf(after(view, phrase))];
|
|
136
|
+
if (subject === undefined || next === undefined || subject.j !== phrase.j - 1) return false;
|
|
137
|
+
const opensPhrase = (scope.sentence.exampleEnds[phrase.item.start]?.length ?? 0) > 0;
|
|
138
|
+
return opensPhrase && opensAsNoun(scope, subject.item) && opensAsNoun(scope, examples) && opensAsPredicate(scope, next.item);
|
|
139
|
+
};
|
|
140
|
+
|
|
112
141
|
/**
|
|
113
142
|
* 例の句(such as / including / e.g.)のあとが並び。句の前の項目は並びではない(the screen lock on your phone, such as a PIN or
|
|
114
143
|
* phone-based fingerprint は 2 つ)。句の中の項目の形が揃わなければ句で切らない(materials such as green steel, utilizing ..., and
|
|
@@ -121,10 +150,24 @@ const fromExample = (view: View): View => {
|
|
|
121
150
|
const { scope } = view.list;
|
|
122
151
|
const examples = { start: exampleEnd(scope, phrase.item), end: phrase.item.end };
|
|
123
152
|
if (hasListConjunction(scope, examples)) return view;
|
|
124
|
-
const
|
|
153
|
+
const rest = after(view, phrase);
|
|
154
|
+
if (isAsideBeforePredicate(view, phrase, examples)) return rest;
|
|
155
|
+
const inPhrase = contentOnlyWith(rest, examples);
|
|
125
156
|
return sameShapes(inPhrase) ? inPhrase : view;
|
|
126
157
|
};
|
|
127
158
|
|
|
159
|
+
/**
|
|
160
|
+
* 読点で始まる例の句が and / or の直前の項目で、句の中に and / or があれば、and の前の読点は句を閉じる読点(gases in the
|
|
161
|
+
* atmosphere, such as ozone and carbon dioxide, and the amount of energy)。Oxford comma を打つかどうかの選択を見せない。
|
|
162
|
+
*/
|
|
163
|
+
const closesExampleAside = (view: View, at: number): boolean => {
|
|
164
|
+
const { scope } = view.list;
|
|
165
|
+
const [phrase, last] = [findLast(view, "example"), lastOf(view)];
|
|
166
|
+
if (phrase === undefined || last === undefined || phrase.j !== last.j || !commaBefore(scope, at)) return false;
|
|
167
|
+
const opensItem = (scope.sentence.exampleEnds[phrase.item.start]?.length ?? 0) > 0;
|
|
168
|
+
return opensItem && hasListConjunction(scope, { start: exampleEnd(scope, phrase.item), end: phrase.item.end });
|
|
169
|
+
};
|
|
170
|
+
|
|
128
171
|
/** 解析器は過去形と過去分詞(fixed)を見分けられない。動詞のある項目のあとの「過去分詞」の並びは、述語の並びと読む。 */
|
|
129
172
|
const pastPredicates = (scope: ItemScope, first: TokenRange, form: string, afterItem: TokenRange): boolean =>
|
|
130
173
|
form === "Part" && participleOpening(scope, afterItem)?.form === "Part" && hasVerb(scope, first);
|
|
@@ -268,9 +311,11 @@ const opensContrast = (scope: ItemScope, item: TokenRange): boolean => CONTRAST.
|
|
|
268
311
|
*/
|
|
269
312
|
const listAt = (list: ItemList, at: number): boolean | undefined => {
|
|
270
313
|
const { scope } = list;
|
|
314
|
+
if (closesExampleAside(wholeList(list), at)) return undefined;
|
|
271
315
|
const afterItem = itemAfter(scope, at);
|
|
272
|
-
const items = fromParticiplePhrase(fromExample(afterClosedList(withoutLead(wholeList(list)))), afterItem);
|
|
316
|
+
const items = fromParticiplePhrase(fromExample(afterClosedList(withoutLead(withoutCoordinateAdjective(wholeList(list))))), afterItem);
|
|
273
317
|
if (listContinues(scope, afterItem) || isAppositive(scope, at, items, afterItem) || insideLastItem(scope, at, items, afterItem)) return undefined;
|
|
318
|
+
if (namesDivision(items) || qualifiesPrevious(items)) return undefined;
|
|
274
319
|
const last = lastOf(items);
|
|
275
320
|
if (last !== undefined && opensContrast(scope, last.item)) return undefined;
|
|
276
321
|
const shape = last === undefined ? undefined : shapeOf(scope, last.item);
|
|
@@ -288,10 +333,13 @@ export const listVerdicts = (tokens: readonly Token[], words: ListWords, source:
|
|
|
288
333
|
if (!tokens.some(isJudgedConjunction)) return [];
|
|
289
334
|
const sentence = listSentenceOf(tokens, words, source);
|
|
290
335
|
const readItems = listReader(sentence);
|
|
336
|
+
const breaks = dashBreaks(tokens, source);
|
|
291
337
|
return tokens.flatMap((token, at) => {
|
|
292
338
|
if (!isJudgedConjunction(token, at)) return [];
|
|
293
339
|
// 郵便番号で終わる住所のあとの and / or は、住所の行を区切る読点のあと。並びの読点ではない。
|
|
294
|
-
|
|
340
|
+
// 最後の読点のあとに前後を空けたダッシュがあれば(Washington, DC – The …)、読点はダッシュの前で閉じた日付行や見出しのもの。
|
|
341
|
+
const notList = sentence.inCitedTitle(at) || followsPostcode(source, token.span.start) || breaks[at] === true;
|
|
342
|
+
return [notList ? undefined : listAt(readItems(at), at)];
|
|
295
343
|
});
|
|
296
344
|
};
|
|
297
345
|
|
|
@@ -314,6 +362,7 @@ export const oxfordComma: Detector = (doc, options): Finding[] => {
|
|
|
314
362
|
region: doc.lexicons["place-region"] ?? [],
|
|
315
363
|
titleCue: (doc.lexicons["title-cue"] ?? []).map((entry) => entry.pattern),
|
|
316
364
|
sequence: patternsOf(doc.lexicons["sequence-opener"]),
|
|
365
|
+
unit: patternsOf(doc.lexicons["enclosing-unit"]),
|
|
317
366
|
};
|
|
318
367
|
const judged = doc.sentences.flatMap((sentence) => {
|
|
319
368
|
const oxford = oxfordIn(sentence.tokens ?? [], words, doc.source);
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import type { Detector, Finding } from "../plugin.ts";
|
|
2
2
|
import { oneSentenceRuns } from "../paragraph-runs.ts";
|
|
3
|
+
import { referenceListSpans } from "../reference-lists.ts";
|
|
3
4
|
|
|
4
5
|
/** How much of the run's first paragraph the finding quotes. */
|
|
5
6
|
const QUOTE_LENGTH = 80;
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Runs of one-sentence paragraphs longer than the limit: every sentence set apart as its own paragraph, so nothing is grouped
|
|
9
|
-
* and the reader cannot see which points belong together. One finding per run, at its first paragraph.
|
|
10
|
+
* and the reader cannot see which points belong together. One finding per run, at its first paragraph. A reference list's
|
|
11
|
+
* entries are a list, and are not counted.
|
|
10
12
|
*/
|
|
11
13
|
export const oneSentenceParagraphRun: Detector = (doc, options): Finding[] =>
|
|
12
|
-
oneSentenceRuns(
|
|
14
|
+
oneSentenceRuns(
|
|
15
|
+
doc.source,
|
|
16
|
+
doc.paragraphs,
|
|
17
|
+
referenceListSpans(
|
|
18
|
+
doc.source,
|
|
19
|
+
(doc.lexicons["reference-list-heading"] ?? []).map((entry) => entry.pattern),
|
|
20
|
+
),
|
|
21
|
+
)
|
|
13
22
|
.filter((run) => run.length > options.limit)
|
|
14
23
|
.flatMap((run) => {
|
|
15
24
|
const first = run[0];
|
|
@@ -51,6 +51,12 @@ export const phraseMatch: Detector = (doc, options): Finding[] => {
|
|
|
51
51
|
return hits.length < options.limit ? [] : findingsOf(hits, options.limit);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
/** phrase-match の、isUsed が使ったと読む出現だけを数える版。言い回しごとの例外を持つ rule が使う。 */
|
|
55
|
+
export const phraseMatchWhere = (doc: ProseDocument, options: DetectorOptions, isUsed: IsUsed): Finding[] => {
|
|
56
|
+
const hits = phraseHits(doc, options, isUsed);
|
|
57
|
+
return hits.length < options.limit ? [] : findingsOf(hits, options.limit);
|
|
58
|
+
};
|
|
59
|
+
|
|
54
60
|
/** phrase-match の、言葉として名指しただけの言い回し(the phrase "…", 「…」という言い方)を数えない版(mentioned-phrase.ts)。 */
|
|
55
61
|
export const phraseInUse: Detector = (doc, options): Finding[] => {
|
|
56
62
|
const cues = mentionCuesOf(doc.lexicons["mention-cue"] ?? []);
|
|
@@ -85,15 +85,76 @@ const lineMarkerSpans = (text: string, markers: Lexicon, labels: Lexicon): Span[
|
|
|
85
85
|
return [...markerSpans(line, markers), ...labelSpans(line, labels)].map((span) => ({ start: span.start + offset, end: span.end + offset }));
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
/**
|
|
88
|
+
/** Lexicon groups of placeholder-word for a run of blank marks (〇〇): the word after it, the word before it, and a unit after it. */
|
|
89
|
+
const BLANK_SUFFIX = "blank-suffix";
|
|
90
|
+
const BLANK_PREFIX = "blank-prefix";
|
|
91
|
+
const BLANK_UNIT = "blank-unit";
|
|
92
|
+
|
|
93
|
+
/** 伏せ字の記号の並び(〇〇、○○、△△)。例として置いた「○○」と形は同じなので、置かれた位置で空欄かを決める。 */
|
|
94
|
+
const BLANK_MARKS = /[○〇◯△]+/gu;
|
|
95
|
+
/** A name blank is at least two marks: one ○ is a bullet. */
|
|
96
|
+
const NAME_BLANK_LENGTH = 2;
|
|
97
|
+
/** 記号の前の数字(二〇二六年、一〇月)。〇 はその数の 0 で、空欄ではない。 */
|
|
98
|
+
const NUMERAL_BEFORE = /[\p{N}一二三四五六七八九十百千万]$/u;
|
|
99
|
+
/** 行頭から記号までが空白だけか。行頭の「○」は箇条書きの印(○日本に支店等を…)。 */
|
|
100
|
+
const atLineHead = (before: string): boolean => (before.split("\n").at(-1) ?? "").trim() === "";
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 行頭の伏せ字に単位が続くとき、空欄か箇条書きの印か。一字の単位は印の後の語の頭(○日本、○月曜)と同じ形なので、
|
|
104
|
+
* 次にまた伏せ字が来る(〇月〇日)ときだけ空欄。二字以上の単位(〇万円、〇か月)は空欄。
|
|
105
|
+
*/
|
|
106
|
+
const unitAtLineHead = (unit: string, afterUnit: string): boolean => [...unit].length > 1 || /^[○〇◯△]/u.test(afterUnit);
|
|
107
|
+
|
|
108
|
+
const startsWithAny = (text: string, words: Lexicon): Lexicon[number] | undefined => words.find((word) => text.startsWith(word.pattern));
|
|
109
|
+
const endsWithAny = (text: string, words: Lexicon): boolean => words.some((word) => text.endsWith(word.pattern));
|
|
110
|
+
|
|
111
|
+
type BlankWords = { readonly suffixes: Lexicon; readonly prefixes: Lexicon; readonly units: Lexicon };
|
|
112
|
+
|
|
113
|
+
/** 記号の並びが空欄の位置にあるか。あれば、空欄として言う範囲(後ろに付いた語まで)。 */
|
|
114
|
+
const blankSpanAt = (text: string, match: RegExpExecArray, words: BlankWords): Span | undefined => {
|
|
115
|
+
const start = match.index;
|
|
116
|
+
const end = start + match[0].length;
|
|
117
|
+
const before = text.slice(0, start);
|
|
118
|
+
const after = text.slice(end);
|
|
119
|
+
const lineAfter = after.split("\n")[0] ?? "";
|
|
120
|
+
if (match[0].length >= NAME_BLANK_LENGTH) {
|
|
121
|
+
const suffix = startsWithAny(after, words.suffixes);
|
|
122
|
+
if (suffix !== undefined) return { start, end: end + suffix.pattern.length };
|
|
123
|
+
if (endsWithAny(before.trimEnd(), words.prefixes)) return { start, end };
|
|
124
|
+
if (atLineHead(before) && lineAfter.trim() === "") return { start, end };
|
|
125
|
+
}
|
|
126
|
+
const unit = startsWithAny(after, words.units);
|
|
127
|
+
if (unit === undefined || NUMERAL_BEFORE.test(before)) return undefined;
|
|
128
|
+
return atLineHead(before) && !unitAtLineHead(unit.pattern, after.slice(unit.pattern.length)) ? undefined : { start, end: end + unit.pattern.length };
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 宛名・署名・金額・日付の位置に残った伏せ字(〇〇様、株式会社〇〇、署名の行の〇〇、〇万円、〇月〇日)。
|
|
133
|
+
* 文の中で例として置いた「○○」(○○株式会社作成など)は数えない。位置の語は語彙表の blank-* の組で、使う文書の種類も語彙表が決める。
|
|
134
|
+
*/
|
|
135
|
+
const blankMarkSpans = (text: string, words: BlankWords): Span[] =>
|
|
136
|
+
words.suffixes.length + words.prefixes.length + words.units.length === 0
|
|
137
|
+
? []
|
|
138
|
+
: [...text.matchAll(BLANK_MARKS)].flatMap((match) => {
|
|
139
|
+
const span = blankSpanAt(text, match, words);
|
|
140
|
+
return span === undefined ? [] : [span];
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
/** 文の中の、埋め忘れた雛形の空欄([Your Name]、【会社名】、(ここに会社名を書く)、TBD: …、〇〇様)の範囲。words は placeholder-word の語彙表。 */
|
|
89
144
|
export const placeholderSpans = (text: string, words: Lexicon): Span[] => {
|
|
90
145
|
const bracketWords = words.filter((word) => word.group === undefined);
|
|
91
146
|
const instructions = words.filter((word) => word.group === INSTRUCTION);
|
|
92
147
|
const markers = words.filter((word) => word.group === MARKER);
|
|
93
148
|
const labels = words.filter((word) => word.group === LABEL);
|
|
149
|
+
const blankWords = {
|
|
150
|
+
suffixes: words.filter((word) => word.group === BLANK_SUFFIX),
|
|
151
|
+
prefixes: words.filter((word) => word.group === BLANK_PREFIX),
|
|
152
|
+
units: words.filter((word) => word.group === BLANK_UNIT),
|
|
153
|
+
};
|
|
94
154
|
return [
|
|
95
155
|
...bracketedSpans(text, BRACKETED, (inner) => holdsWord(inner, bracketWords)),
|
|
96
156
|
...(instructions.length === 0 ? [] : bracketedSpans(text, PARENTHESIZED, (inner) => opensWith(inner, instructions))),
|
|
97
157
|
...lineMarkerSpans(text, markers, labels),
|
|
158
|
+
...blankMarkSpans(text, blankWords),
|
|
98
159
|
].toSorted((left, right) => left.start - right.start);
|
|
99
160
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Detector, Finding, Paragraph, ProseDocument, Sentence, Token } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** 答えが断片と言える語の数の上限(No. / Not accounts. / Not really.)。 */
|
|
4
|
+
const MAX_FRAGMENT_WORDS = 4;
|
|
5
|
+
/** 名詞だけの問い(The result? / The catch?)の語の数の上限。 */
|
|
6
|
+
const MAX_NOUN_QUESTION_WORDS = 3;
|
|
7
|
+
|
|
8
|
+
/** 語のすぐ後ろの疑問符。コードを覆った空白や記号の後ろの「?」は問いではない。 */
|
|
9
|
+
const QUESTION_END = /[\p{L}\p{N}"”'’)]\s*[??]\s*$/u;
|
|
10
|
+
const WORD = /^\p{L}/u;
|
|
11
|
+
/** 括弧や引用符で始まる答え((Grades K-4))は、問いへの答えではなく注記か引用。 */
|
|
12
|
+
const ASIDE_OPEN = /^\s*[([{"“'‘]/u;
|
|
13
|
+
/** 品詞の読みが短縮形を一語にしたとき(You're / That's)にも、動詞を持つ文と見る。 */
|
|
14
|
+
const CONTRACTED_VERB = /['’](re|s|m|ve|ll|d)$/iu;
|
|
15
|
+
|
|
16
|
+
/** 記号でない語。括弧と引用符は解析器が X(その他)に読むので、それも外す。 */
|
|
17
|
+
const NOT_WORDS = new Set(["PUNCT", "SYM", "X"]);
|
|
18
|
+
const wordsOf = (sentence: Sentence): readonly Token[] => (sentence.tokens ?? []).filter((token) => !NOT_WORDS.has(token.pos));
|
|
19
|
+
|
|
20
|
+
const hasVerb = (words: readonly Token[]): boolean => words.some((token) => token.pos === "VERB" || token.pos === "AUX" || CONTRACTED_VERB.test(token.surface));
|
|
21
|
+
|
|
22
|
+
const isQuestion = (sentence: Sentence): boolean => QUESTION_END.test(sentence.text);
|
|
23
|
+
|
|
24
|
+
/** 動詞の無い、数語の答え(No. / Fair. / Not accounts.)。 */
|
|
25
|
+
export const isFragment = (sentence: Sentence): boolean => {
|
|
26
|
+
const words = wordsOf(sentence);
|
|
27
|
+
const fragmentSized = words.length > 0 && words.length <= MAX_FRAGMENT_WORDS && words.every((token) => WORD.test(token.surface));
|
|
28
|
+
return fragmentSized && !hasVerb(words) && !isQuestion(sentence) && !ASIDE_OPEN.test(sentence.text);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** 限定詞で始まる、動詞の無い短い問い(The result? / Our fix?)。 */
|
|
32
|
+
export const isNounQuestion = (sentence: Sentence): boolean => {
|
|
33
|
+
const words = wordsOf(sentence);
|
|
34
|
+
return isQuestion(sentence) && words.length <= MAX_NOUN_QUESTION_WORDS && words[0]?.pos === "DET" && !hasVerb(words);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** 問いと、すぐ後ろでそれに答える断片。 */
|
|
38
|
+
export type AnsweredQuestion = { readonly question: Sentence; readonly answer: Sentence };
|
|
39
|
+
|
|
40
|
+
const answeredIn = (paragraph: Paragraph): AnsweredQuestion[] =>
|
|
41
|
+
paragraph.sentences.flatMap((question, index) => {
|
|
42
|
+
const answer = paragraph.sentences[index + 1];
|
|
43
|
+
if (answer === undefined || !isQuestion(question)) return [];
|
|
44
|
+
if (question.embeddedLanguage !== undefined || answer.embeddedLanguage !== undefined) return [];
|
|
45
|
+
return isFragment(answer) || (isNounQuestion(question) && !isQuestion(answer)) ? [{ question, answer }] : [];
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/** 書き手が自分で問い、同じ段落のすぐ後ろで断片で答えた所(Is it perfect? No.)。 */
|
|
49
|
+
export const answeredQuestions = (doc: ProseDocument): AnsweredQuestion[] => doc.paragraphs.flatMap(answeredIn);
|
|
50
|
+
|
|
51
|
+
const findingOf = (found: AnsweredQuestion, count: number, limit: number): Finding => ({
|
|
52
|
+
rule: "",
|
|
53
|
+
severity: "info",
|
|
54
|
+
line: 0,
|
|
55
|
+
column: 0,
|
|
56
|
+
quote: `${found.question.text.trim()} ${found.answer.text.trim()}`,
|
|
57
|
+
values: { matched: found.answer.text.trim(), count, limit, offset: found.question.span.start },
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/** 自問して断片で答える所の数。一つは語り口で、limit 個から言う。 */
|
|
61
|
+
export const qFragmentAnswer: Detector = (doc, options): Finding[] => {
|
|
62
|
+
const found = answeredQuestions(doc);
|
|
63
|
+
return found.length < options.limit ? [] : found.map((entry) => findingOf(entry, found.length, options.limit));
|
|
64
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** Markdown の > か、引用の字を書き替えた角括弧の大文字([T]he guard, …)で始まる段落。 */
|
|
4
|
+
const MARKED_QUOTATION = /^(?:>|\[\p{Lu}\]\p{Ll})/u;
|
|
5
|
+
/** 小文字だけの語で始まる段落(that concrete adverseness which …)。大文字を含む語(iOS、macOS)は名前。 */
|
|
6
|
+
const LOWERCASE_OPENING = /^\p{Ll}+[\s,;:]/u;
|
|
7
|
+
/** 文の終わりの印を持たずに終わる段落(This setting assures there is)。 */
|
|
8
|
+
const OPEN_ENDING = /\p{L}$/u;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 段落が、引用を地の文から切り出して置いた段落(ブロック引用)と読めるか。字下げを失ったテキストでも形で分かる: > の段落、
|
|
12
|
+
* 角括弧の書き替えで始まる段落と、前の段落の文が終わらないまま小文字の語で続く段落(…assures there is / that concrete
|
|
13
|
+
* adverseness which …)。前の段落が文を閉じていれば、小文字の段落は書き手の文(see the file which …)として読む。
|
|
14
|
+
*/
|
|
15
|
+
export const isQuotationParagraph = (paragraph: string, previous: string): boolean => {
|
|
16
|
+
const text = paragraph.trimStart();
|
|
17
|
+
return MARKED_QUOTATION.test(text) || (LOWERCASE_OPENING.test(text) && OPEN_ENDING.test(previous.trimEnd()));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** ブロック引用と読める段落の番号(paragraphs の中の位置)。 */
|
|
21
|
+
export const quotationParagraphIndexes = (source: string, paragraphs: readonly Span[]): ReadonlySet<number> =>
|
|
22
|
+
new Set(
|
|
23
|
+
paragraphs.flatMap((paragraph, index) => {
|
|
24
|
+
const before = paragraphs[index - 1];
|
|
25
|
+
const previous = before === undefined ? "" : source.slice(before.start, before.end);
|
|
26
|
+
return isQuotationParagraph(source.slice(paragraph.start, paragraph.end), previous) ? [index] : [];
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// A 「」 quotation that holds sentences of its own (「…転落。…入院。」(0歳1か月)): each quoted sentence is read as one, and
|
|
2
|
+
// the words around the quotation as another. Pure.
|
|
3
|
+
|
|
4
|
+
const OPEN = "「";
|
|
5
|
+
const CLOSE = "」";
|
|
6
|
+
const STOP = /[。!?]/u;
|
|
7
|
+
const OPENER = /\p{Ps}/u;
|
|
8
|
+
const CLOSER = /\p{Pe}/u;
|
|
9
|
+
|
|
10
|
+
type Quote = { readonly start: number; readonly end: number };
|
|
11
|
+
|
|
12
|
+
/** The outermost 「」 pairs, as the offsets of their brackets. An unclosed 「 pairs with nothing. */
|
|
13
|
+
const outerQuotes = (chars: readonly string[]): Quote[] => {
|
|
14
|
+
const quotes: Quote[] = [];
|
|
15
|
+
const opens: number[] = [];
|
|
16
|
+
chars.forEach((char, at) => {
|
|
17
|
+
if (char === OPEN) opens.push(at);
|
|
18
|
+
if (char !== CLOSE) return;
|
|
19
|
+
const start = opens.pop();
|
|
20
|
+
if (start !== undefined && opens.length === 0) quotes.push({ start, end: at });
|
|
21
|
+
});
|
|
22
|
+
return quotes;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const depthAfter = (depth: number, char: string): number => {
|
|
26
|
+
if (OPENER.test(char)) return depth + 1;
|
|
27
|
+
return CLOSER.test(char) ? Math.max(0, depth - 1) : depth;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** A quotation's sentences, cut after each stop outside any inner bracket (『…。』 stays whole). */
|
|
31
|
+
const sentencesIn = (chars: readonly string[]): string[] => {
|
|
32
|
+
const pieces: string[][] = [[]];
|
|
33
|
+
chars.reduce((depth, char) => {
|
|
34
|
+
pieces.at(-1)?.push(char);
|
|
35
|
+
const next = depthAfter(depth, char);
|
|
36
|
+
if (next === 0 && STOP.test(char)) pieces.push([]);
|
|
37
|
+
return next;
|
|
38
|
+
}, 0);
|
|
39
|
+
return pieces.map((piece) => piece.join("")).filter((piece) => piece.trim() !== "");
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Two sentences or more, each closed by its stop: the quotation is made of sentences, not one clause that ends in one. */
|
|
43
|
+
const ownSentences = (inner: readonly string[]): readonly string[] | undefined => {
|
|
44
|
+
const sentences = sentencesIn(inner);
|
|
45
|
+
return sentences.length > 1 && sentences.every((sentence) => STOP.test(sentence.trimEnd().slice(-1))) ? sentences : undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The parts of a sentence to measure one by one: each sentence inside a 「」 that holds two or more whole sentences, and the
|
|
50
|
+
* words outside such quotations. A sentence without one is a single part, itself.
|
|
51
|
+
*/
|
|
52
|
+
export const quotedSentenceParts = (text: string): readonly string[] => {
|
|
53
|
+
const chars = Array.from(text);
|
|
54
|
+
const split = outerQuotes(chars).flatMap((quote) => {
|
|
55
|
+
const sentences = ownSentences(chars.slice(quote.start + 1, quote.end));
|
|
56
|
+
return sentences === undefined ? [] : [{ quote, sentences }];
|
|
57
|
+
});
|
|
58
|
+
if (split.length === 0) return [text];
|
|
59
|
+
const inside = new Set(split.flatMap(({ quote }) => Array.from({ length: quote.end - quote.start - 1 }, (_unused, index) => quote.start + 1 + index)));
|
|
60
|
+
const outside = chars.filter((_char, at) => !inside.has(at)).join("");
|
|
61
|
+
return [outside, ...split.flatMap(({ sentences }) => sentences)];
|
|
62
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// A quoted term that quotes someone's wording rather than using the defined term again: the wording of a provision
|
|
2
|
+
// (憲法一九条にいう「良心の自由」, 第1項1号の「特定居住用宅地等」) or of a document (「謝罪」の文言, 「謝罪」、「陳謝」という文言).
|
|
3
|
+
// The cue words come from the language's word list quoted-wording-cue: group before ends right before the opening quote,
|
|
4
|
+
// group after starts right after the closing quote, past any further quotes listed with it. Pure.
|
|
5
|
+
import type { LexiconEntry } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
const BEFORE = "before";
|
|
8
|
+
const AFTER = "after";
|
|
9
|
+
|
|
10
|
+
/** How far before the opening quote a cue is looked for. */
|
|
11
|
+
const LOOK_BACK = 12;
|
|
12
|
+
/** Further quotes listed after the first (「謝罪」、「陳謝の意を表します」という文言). */
|
|
13
|
+
const LISTED_QUOTES = /^(?:[、,・]?[「『][^」』\n]*[」』])*/u;
|
|
14
|
+
|
|
15
|
+
export type WordingCues = { readonly before: readonly string[]; readonly after: readonly string[] };
|
|
16
|
+
|
|
17
|
+
export const wordingCuesOf = (entries: readonly LexiconEntry[]): WordingCues => ({
|
|
18
|
+
before: entries.filter((entry) => entry.group === BEFORE).map((entry) => entry.pattern),
|
|
19
|
+
after: entries.filter((entry) => entry.group === AFTER).map((entry) => entry.pattern),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** Whether the quote from opening (the opening mark) to closing (the closing mark) quotes wording, by the cues around it. */
|
|
23
|
+
export const quotesWording = (source: string, opening: number, closing: number, cues: WordingCues): boolean => {
|
|
24
|
+
const before = source.slice(Math.max(0, opening - LOOK_BACK), opening);
|
|
25
|
+
const rest = source.slice(closing + 1);
|
|
26
|
+
const after = rest.slice(LISTED_QUOTES.exec(rest)?.[0].length ?? 0);
|
|
27
|
+
return cues.before.some((cue) => cue !== "" && before.endsWith(cue)) || cues.after.some((cue) => cue !== "" && after.startsWith(cue));
|
|
28
|
+
};
|
|
@@ -12,8 +12,20 @@ export type WrittenRange = { readonly offset: number; readonly written: string;
|
|
|
12
12
|
const FULLWIDTH_OFFSET = 0xfee0;
|
|
13
13
|
const NUMBER = "[0-90-9]+(?:[..][0-90-9]+)?";
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
const UNIT_AFTER =
|
|
15
|
+
/** 範囲のすぐ後ろ(同じ行の空白一つまで)の単位や語。番号にも使う記号(ハイフン)は、これが続くときだけ範囲と読む。 */
|
|
16
|
+
const UNIT_AFTER = /^[^\S\n]?[\p{L}%%]/u;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 漢字の語に詰めて書いた番号の後ろに仮名が続けば、文書の番号(直資4-5ほか、課資3-1の)。範囲なら後ろは単位(約3-5日)で、
|
|
20
|
+
* 仮名で始まる単位(約3-5か月、3-5つ)は語彙表 range-kana-unit が言う。
|
|
21
|
+
*/
|
|
22
|
+
const CODE_BEFORE = /\p{Script=Han}$/u;
|
|
23
|
+
const KANA_AFTER = /^[^\S\n]?(\p{Script=Hiragana}.*)/u;
|
|
24
|
+
|
|
25
|
+
const isDocumentNumber = (lineBefore: string, after: string, kanaUnits: readonly string[]): boolean => {
|
|
26
|
+
const kana = KANA_AFTER.exec(after)?.[1];
|
|
27
|
+
return CODE_BEFORE.test(lineBefore) && kana !== undefined && !kanaUnits.some((unit) => kana.startsWith(unit));
|
|
28
|
+
};
|
|
17
29
|
|
|
18
30
|
/** 行の頭(見出しや箇条書きの印の後ろ)の「1-2」は節の番号、閉じ括弧のすぐ後ろの「(703) 292-7827」は電話番号。 */
|
|
19
31
|
const LABEL_BEFORE = /(?:^\s*[#>*+|-][\s#>*+|-]*|\)\s?)$/u;
|
|
@@ -30,9 +42,15 @@ const halfWidth = (text: string): string => text.replace(/[0-9.]/gu, (char
|
|
|
30
42
|
/**
|
|
31
43
|
* 文字列の中の数の範囲。前後にさらに数が続く並び(日付 2026-10-02、電話番号、時刻 10:00、版 1.2-3)は範囲ではない。
|
|
32
44
|
* 終わりが始まりより小さいもの(郵便番号 100-0001、試合の 3-2)も範囲ではない。ambiguous の記号は、後ろに単位や語が続き、
|
|
33
|
-
* 前が番号の札(図 2-1、Section 1-2、NSF 13-542
|
|
45
|
+
* 前が番号の札(図 2-1、Section 1-2、NSF 13-542)でも文書の番号(直資4-5ほか)でもないときだけ。
|
|
34
46
|
*/
|
|
35
|
-
export const rangesIn = (
|
|
47
|
+
export const rangesIn = (
|
|
48
|
+
text: string,
|
|
49
|
+
marks: readonly string[],
|
|
50
|
+
ambiguous: readonly string[] = [],
|
|
51
|
+
labels: readonly string[] = [],
|
|
52
|
+
kanaUnits: readonly string[] = [],
|
|
53
|
+
): WrittenRange[] => {
|
|
36
54
|
if (marks.length === 0) return [];
|
|
37
55
|
const joiner = marks
|
|
38
56
|
.toSorted((left, right) => right.length - left.length)
|
|
@@ -46,9 +64,10 @@ export const rangesIn = (text: string, marks: readonly string[], ambiguous: read
|
|
|
46
64
|
const from = Number(halfWidth(match.groups?.["from"] ?? ""));
|
|
47
65
|
const to = Number(halfWidth(match.groups?.["to"] ?? ""));
|
|
48
66
|
const mark = match.groups?.["mark"] ?? "";
|
|
49
|
-
const
|
|
67
|
+
const after = text.slice(match.index + match[0].length);
|
|
50
68
|
const lineBefore = text.slice(text.lastIndexOf("\n", match.index - 1) + 1, match.index);
|
|
51
|
-
|
|
69
|
+
const readsAsRange = UNIT_AFTER.test(after) && !isNumberLabel(lineBefore, labels) && !isDocumentNumber(lineBefore, after, kanaUnits);
|
|
70
|
+
return to > from && !LABEL_BEFORE.test(lineBefore) && (!ambiguous.includes(mark) || readsAsRange)
|
|
52
71
|
? [{ offset: match.index, written: match[0], form: mark }]
|
|
53
72
|
: [];
|
|
54
73
|
});
|
|
@@ -62,6 +81,7 @@ export const rangeNotation: Detector = (doc, options): Finding[] => {
|
|
|
62
81
|
entries.map((entry) => entry.pattern),
|
|
63
82
|
entries.filter((entry) => entry.group === "ambiguous").map((entry) => entry.pattern),
|
|
64
83
|
["figure-label", "numbered-division", "numbered-label"].flatMap((id) => (doc.lexicons[id] ?? []).map((entry) => entry.pattern)),
|
|
84
|
+
(doc.lexicons["range-kana-unit"] ?? []).map((entry) => entry.pattern),
|
|
65
85
|
);
|
|
66
86
|
const minority = formMinority(ranges, options.limit);
|
|
67
87
|
if (minority === undefined) return [];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { LexiconEntry, Sentence, Token } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ですます調にもである調にも数えない文の形。どちらの調子の文書にも同じ形で現れる。
|
|
5
|
+
* - へりくだる動詞の願い(受け継いでいただきたい。ご協力願いたい。): 丁寧さは動詞が持ち、訓示でも論文でもこの形で頼む。
|
|
6
|
+
* - 句点で閉じた常体の問い(対処できているか。どうすればよいのだろうか。): 自分や聞き手に投げる問いで、ですます調の演説や記事にも混ざる。
|
|
7
|
+
* - 言いさし(いつもと違っていたら・・・。): 条件だけ言って文末を言わない文には、文末の調子が無い。
|
|
8
|
+
* Pure。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const WISH = "たい";
|
|
12
|
+
const QUESTION = "か";
|
|
13
|
+
const CONDITIONAL = new Set(["たら", "だら"]);
|
|
14
|
+
/** 三点リーダー・二点リーダーと、二つ以上の中黒、三つ以上のピリオドで書いた「…」。後ろの句点は除いてから見る。 */
|
|
15
|
+
const ELLIPSIS_ENDINGS = ["…", "‥", "・・", "..."];
|
|
16
|
+
const FULL_STOP = /[。.]$/u;
|
|
17
|
+
|
|
18
|
+
const endsWithEllipsis = (text: string): boolean => {
|
|
19
|
+
const body = text.replace(FULL_STOP, "");
|
|
20
|
+
return ELLIPSIS_ENDINGS.some((ellipsis) => body.endsWith(ellipsis));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** 語彙表 neutral-request の動詞(いただく、願う)に「たい」だけが付いて終わる文末。「いただきたかった」「いただきたいです」は入らない。 */
|
|
24
|
+
const isHumbleWish = (ending: readonly Token[], verbs: readonly LexiconEntry[]): boolean => {
|
|
25
|
+
const [verb, wish, ...rest] = ending;
|
|
26
|
+
return rest.length === 0 && wish?.surface === WISH && verbs.some((entry) => entry.pattern === verb?.lemma || entry.pattern === verb?.surface);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** 問いの「か」の後ろに来て、問いを書き言葉で閉じる印。「〜のかな?」「〜か?」は読み手に話しかける常体で、数える。 */
|
|
30
|
+
const CLOSES_QUESTION = new Set(["。", ".", "、", ","]);
|
|
31
|
+
|
|
32
|
+
/** 文末の語のすぐ後ろが問いの「か」で、その後ろが句点か読点。 */
|
|
33
|
+
const endsAsQuestion = (sentence: Sentence, ending: readonly Token[]): boolean => {
|
|
34
|
+
const tokens = sentence.tokens ?? [];
|
|
35
|
+
const last = ending.at(-1);
|
|
36
|
+
if (last === undefined) return false;
|
|
37
|
+
const at = tokens.indexOf(last);
|
|
38
|
+
return tokens[at + 1]?.surface === QUESTION && CLOSES_QUESTION.has(tokens[at + 2]?.surface ?? "");
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const trailsOff = (sentence: Sentence, ending: readonly Token[]): boolean =>
|
|
42
|
+
CONDITIONAL.has(ending.at(-1)?.surface ?? "") && endsWithEllipsis(sentence.text.trim());
|
|
43
|
+
|
|
44
|
+
/** 常体と読める文末でも調子に数えない文か。ending は sentence-shape の endingTokens、verbs は語彙表 neutral-request。 */
|
|
45
|
+
export const isNeutralPlainShape = (sentence: Sentence, ending: readonly Token[], verbs: readonly LexiconEntry[]): boolean =>
|
|
46
|
+
isHumbleWish(ending, verbs) || endsAsQuestion(sentence, ending) || trailsOff(sentence, ending);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Detector } from "../../plugin.ts";
|
|
2
|
-
import {
|
|
2
|
+
import { unusedDefinitionKept } from "../unused-definition-kept.ts";
|
|
3
3
|
|
|
4
|
-
export const detector: Detector =
|
|
4
|
+
export const detector: Detector = unusedDefinitionKept;
|
|
@@ -97,6 +97,7 @@ export const relativeDateMismatch: Detector = (doc): Finding[] => {
|
|
|
97
97
|
dates,
|
|
98
98
|
relatives: relativesOf(doc, amounts),
|
|
99
99
|
links: patternsOf(doc, "relative-link"),
|
|
100
|
+
starts: patternsOf(doc, "relative-start"),
|
|
100
101
|
};
|
|
101
102
|
const counted = relativeMismatches(input).map((mismatch): Finding => ({
|
|
102
103
|
rule: "relative-date-mismatch",
|