chaffjs 0.48.0 → 0.50.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 +1 -0
- package/README.md +1 -0
- package/dist/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +18 -1
- package/dist/announced-count.js.map +1 -1
- package/dist/announced-list.d.ts.map +1 -1
- package/dist/announced-list.js +6 -1
- package/dist/announced-list.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/composite-signals.d.ts +3 -1
- package/dist/composite-signals.d.ts.map +1 -1
- package/dist/composite-signals.js +7 -0
- package/dist/composite-signals.js.map +1 -1
- package/dist/detectors/acronym-name.d.ts +2 -2
- package/dist/detectors/acronym-name.d.ts.map +1 -1
- package/dist/detectors/acronym-name.js +3 -3
- package/dist/detectors/acronym-name.js.map +1 -1
- package/dist/detectors/agentless-passive.d.ts.map +1 -1
- package/dist/detectors/agentless-passive.js +39 -4
- package/dist/detectors/agentless-passive.js.map +1 -1
- package/dist/detectors/agreement-slip.d.ts +2 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +10 -3
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/amount-scale.js +2 -2
- package/dist/detectors/amount-scale.js.map +1 -1
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +11 -4
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/chat-citation.d.ts +2 -6
- package/dist/detectors/chat-citation.d.ts.map +1 -1
- package/dist/detectors/chat-citation.js +4 -2
- package/dist/detectors/chat-citation.js.map +1 -1
- package/dist/detectors/chat-mark-extent.d.ts +11 -0
- package/dist/detectors/chat-mark-extent.d.ts.map +1 -0
- package/dist/detectors/chat-mark-extent.js +53 -0
- package/dist/detectors/chat-mark-extent.js.map +1 -0
- package/dist/detectors/concrete-evidence-density.js +2 -2
- package/dist/detectors/concrete-evidence.d.ts +7 -0
- package/dist/detectors/concrete-evidence.d.ts.map +1 -1
- package/dist/detectors/concrete-evidence.js +20 -0
- package/dist/detectors/concrete-evidence.js.map +1 -1
- package/dist/detectors/conjugated-entry.d.ts +2 -2
- package/dist/detectors/conjugated-entry.d.ts.map +1 -1
- package/dist/detectors/conjugated-entry.js +3 -5
- package/dist/detectors/conjugated-entry.js.map +1 -1
- package/dist/detectors/contrast-frame.d.ts.map +1 -1
- package/dist/detectors/contrast-frame.js +34 -1
- package/dist/detectors/contrast-frame.js.map +1 -1
- package/dist/detectors/currency-notation.js +2 -2
- package/dist/detectors/currency-notation.js.map +1 -1
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +15 -3
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +5 -1
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/ellipsis.js +2 -2
- package/dist/detectors/ellipsis.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +2 -0
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +1 -1
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/en-shape.d.ts +1 -0
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +41 -9
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/gram-furniture.d.ts +1 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +6 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-repetition.d.ts.map +1 -1
- package/dist/detectors/gram-repetition.js +8 -2
- package/dist/detectors/gram-repetition.js.map +1 -1
- package/dist/detectors/heading-case.d.ts +1 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +10 -3
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/kanji-name-edge.d.ts +10 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
- package/dist/detectors/kanji-name-edge.js +23 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -1
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +27 -6
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lexicon-match.d.ts +2 -0
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +14 -3
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +8 -1
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/list-item-clause.d.ts +4 -0
- package/dist/detectors/list-item-clause.d.ts.map +1 -0
- package/dist/detectors/list-item-clause.js +8 -0
- package/dist/detectors/list-item-clause.js.map +1 -0
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +6 -2
- 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.map +1 -1
- package/dist/detectors/mark-shape.js +28 -8
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +10 -1
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-variant-two-things.d.ts +1 -1
- package/dist/detectors/name-variant-two-things.d.ts.map +1 -1
- package/dist/detectors/name-variant-two-things.js +16 -4
- package/dist/detectors/name-variant-two-things.js.map +1 -1
- package/dist/detectors/nominalization.d.ts.map +1 -1
- package/dist/detectors/nominalization.js +11 -4
- package/dist/detectors/nominalization.js.map +1 -1
- package/dist/detectors/ordinal-suffix.js +2 -2
- package/dist/detectors/ordinal-suffix.js.map +1 -1
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +30 -6
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +13 -7
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +15 -1
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/paragraph-run.js +2 -2
- package/dist/detectors/paragraph-run.js.map +1 -1
- package/dist/detectors/phone-number-variant.d.ts.map +1 -1
- package/dist/detectors/phone-number-variant.js +2 -1
- package/dist/detectors/phone-number-variant.js.map +1 -1
- package/dist/detectors/phrase-context.d.ts +6 -0
- package/dist/detectors/phrase-context.d.ts.map +1 -0
- package/dist/detectors/phrase-context.js +12 -0
- package/dist/detectors/phrase-context.js.map +1 -0
- package/dist/detectors/phrase-match-all.d.ts +3 -0
- package/dist/detectors/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/phrase-match-all.js +47 -0
- package/dist/detectors/phrase-match-all.js.map +1 -0
- package/dist/detectors/phrase-match.d.ts +2 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +25 -6
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +14 -2
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/proper-noun-density.d.ts.map +1 -1
- package/dist/detectors/proper-noun-density.js +10 -6
- package/dist/detectors/proper-noun-density.js.map +1 -1
- package/dist/detectors/quote-around.d.ts +3 -0
- package/dist/detectors/quote-around.d.ts.map +1 -1
- package/dist/detectors/quote-around.js +2 -0
- package/dist/detectors/quote-around.js.map +1 -1
- package/dist/detectors/range-notation.js +2 -2
- package/dist/detectors/range-notation.js.map +1 -1
- package/dist/detectors/reference-entry.d.ts.map +1 -1
- package/dist/detectors/reference-entry.js +35 -5
- package/dist/detectors/reference-entry.js.map +1 -1
- package/dist/detectors/register-set-apart.d.ts +1 -1
- package/dist/detectors/register-set-apart.js +4 -4
- package/dist/detectors/register-set-apart.js.map +1 -1
- package/dist/detectors/register-voice.d.ts +5 -0
- package/dist/detectors/register-voice.d.ts.map +1 -1
- package/dist/detectors/register-voice.js +17 -0
- package/dist/detectors/register-voice.js.map +1 -1
- package/dist/detectors/registry/phrase-match-all.d.ts +3 -0
- package/dist/detectors/registry/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/registry/phrase-match-all.js +3 -0
- package/dist/detectors/registry/phrase-match-all.js.map +1 -0
- package/dist/detectors/requirement-lists.d.ts.map +1 -1
- package/dist/detectors/requirement-lists.js +2 -0
- package/dist/detectors/requirement-lists.js.map +1 -1
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +7 -4
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +2 -2
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +3 -1
- 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 +12 -4
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-parts.d.ts +6 -3
- package/dist/detectors/sentence-parts.d.ts.map +1 -1
- package/dist/detectors/sentence-parts.js +15 -7
- package/dist/detectors/sentence-parts.js.map +1 -1
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +6 -1
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/speaker-turns.d.ts +4 -0
- package/dist/detectors/speaker-turns.d.ts.map +1 -0
- package/dist/detectors/speaker-turns.js +28 -0
- package/dist/detectors/speaker-turns.js.map +1 -0
- package/dist/detectors/team.d.ts.map +1 -1
- package/dist/detectors/team.js +42 -9
- package/dist/detectors/team.js.map +1 -1
- package/dist/detectors/unit-spacing.js +2 -2
- package/dist/detectors/unit-spacing.js.map +1 -1
- package/dist/detectors/vague-deadline.d.ts.map +1 -1
- package/dist/detectors/vague-deadline.js +2 -1
- package/dist/detectors/vague-deadline.js.map +1 -1
- package/dist/levels.d.ts +14 -0
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +8 -3
- package/dist/levels.js.map +1 -1
- package/dist/name-variant-shapes.d.ts +10 -0
- package/dist/name-variant-shapes.d.ts.map +1 -1
- package/dist/name-variant-shapes.js +24 -0
- package/dist/name-variant-shapes.js.map +1 -1
- package/dist/phone-numbers.d.ts +5 -2
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +17 -3
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/render/explain.d.ts +2 -0
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +38 -14
- package/dist/render/explain.js.map +1 -1
- package/dist/render/options.d.ts.map +1 -1
- package/dist/render/options.js +11 -6
- package/dist/render/options.js.map +1 -1
- package/dist/render/text.d.ts.map +1 -1
- package/dist/render/text.js +14 -4
- package/dist/render/text.js.map +1 -1
- package/dist/run.d.ts +3 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +20 -13
- package/dist/run.js.map +1 -1
- package/dist/set-phrase-particles.js +2 -2
- package/dist/set-phrase-particles.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +1 -1
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +36 -9
- package/dist/structure/deadline-after-event.js.map +1 -1
- package/dist/structure/definition-use.d.ts +10 -1
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +4 -4
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/leg-times.d.ts.map +1 -1
- package/dist/structure/leg-times.js +10 -2
- package/dist/structure/leg-times.js.map +1 -1
- package/dist/structure/requirement-lists.d.ts +3 -0
- package/dist/structure/requirement-lists.d.ts.map +1 -1
- package/dist/structure/requirement-lists.js +8 -2
- package/dist/structure/requirement-lists.js.map +1 -1
- package/dist/structure/time-marks.d.ts +10 -0
- package/dist/structure/time-marks.d.ts.map +1 -1
- package/dist/structure/time-marks.js +21 -0
- package/dist/structure/time-marks.js.map +1 -1
- package/dist/topic-clause.d.ts.map +1 -1
- package/dist/topic-clause.js +12 -5
- package/dist/topic-clause.js.map +1 -1
- package/package.json +3 -3
- package/rules/abstract-length.yaml +1 -1
- package/rules/adverb-overuse.yaml +1 -1
- package/rules/agentless-passive.yaml +3 -3
- package/rules/agreement-slip.yaml +5 -4
- package/rules/ai-generated-composite.yaml +3 -3
- package/rules/ai-structure.yaml +1 -1
- package/rules/all-caps-shouting.yaml +1 -1
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/announcing-opener.yaml +1 -1
- package/rules/arrival-before-departure.yaml +1 -1
- package/rules/article-sound.yaml +1 -1
- package/rules/baito-keigo.yaml +1 -1
- package/rules/bold-density.yaml +1 -1
- package/rules/bold-emphasis.yaml +1 -1
- package/rules/bold-label-list.yaml +1 -1
- package/rules/bracket-width-consistency.yaml +1 -1
- package/rules/chat-citation-residue.yaml +1 -1
- package/rules/citation-style-mix.yaml +1 -1
- package/rules/clause-chain.yaml +1 -1
- package/rules/cliche.yaml +4 -4
- package/rules/closing-cliche.yaml +1 -1
- package/rules/closing-exhortation.yaml +1 -1
- package/rules/cold-open.yaml +1 -1
- package/rules/colloquial-opener.yaml +1 -1
- package/rules/concrete-evidence-density.yaml +3 -3
- package/rules/contraction-consistency.yaml +1 -1
- package/rules/cross-doc-term-variant.yaml +2 -2
- package/rules/cushion-phrase-density.yaml +1 -1
- package/rules/deadline-after-event.yaml +2 -2
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/double-keigo.yaml +1 -1
- package/rules/double-negative.yaml +11 -2
- package/rules/doubled-nado.yaml +1 -1
- package/rules/email-stock-courtesy.yaml +1 -1
- package/rules/email-subject-length.yaml +1 -1
- package/rules/emoji-heading.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- package/rules/excessive-hedging.yaml +1 -1
- package/rules/exclamation-width-consistency.yaml +1 -1
- package/rules/expletive-construction.yaml +5 -5
- package/rules/figurative-density.yaml +3 -3
- package/rules/hiragana-fukushi.yaml +1 -1
- package/rules/homophone-slip.yaml +3 -3
- package/rules/honesty-marker.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/hyphen-as-dash.yaml +1 -1
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/internal-jargon.yaml +1 -1
- package/rules/kana-function-word.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +1 -1
- package/rules/kutoten-consistency.yaml +7 -3
- package/rules/latin-abbreviation-form.yaml +1 -1
- package/rules/latin-spacing.yaml +1 -1
- package/rules/max-kanji-continuous.yaml +5 -3
- package/rules/max-paragraph-length.yaml +1 -1
- package/rules/max-sentence-length.yaml +1 -1
- package/rules/max-ten.yaml +1 -1
- package/rules/misconversion.yaml +2 -2
- package/rules/name-variant.yaml +2 -2
- package/rules/ngram-repetition.yaml +3 -3
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-em-dash.yaml +3 -3
- package/rules/no-mixed-desumasu.yaml +4 -3
- package/rules/no-nakaguro-parallel.yaml +1 -1
- package/rules/nominalization.yaml +1 -1
- package/rules/nonstandard-word.yaml +2 -2
- package/rules/numbered-generic-heading.yaml +1 -1
- package/rules/numbering-gap.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +1 -1
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +1 -1
- package/rules/oxford-comma-consistency.yaml +4 -3
- package/rules/padded-intro.yaml +1 -1
- package/rules/phone-number-variant.yaml +1 -1
- package/rules/preamble-length.yaml +1 -1
- package/rules/preferred-term.yaml +1 -1
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/q-fragment-answer.yaml +1 -1
- package/rules/quote-style-consistency.yaml +1 -1
- package/rules/quote-without-source.yaml +1 -1
- package/rules/redundant-expression.yaml +1 -1
- package/rules/repeated-conjunction.yaml +1 -1
- package/rules/repeated-sentence-ending.yaml +1 -1
- package/rules/repeated-sentence-head.yaml +5 -5
- package/rules/required-listed-as-preferred.yaml +2 -2
- package/rules/required-sections.yaml +1 -1
- package/rules/sasete-itadaku.yaml +1 -1
- package/rules/sentence-initial-conjunction-run.yaml +1 -1
- package/rules/sentence-initial-so.yaml +1 -1
- package/rules/sentence-spacing-consistency.yaml +1 -1
- package/rules/shell-prompt-mix.yaml +1 -1
- package/rules/stock-transition.yaml +1 -1
- package/rules/stray-space.yaml +1 -1
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/teki-overuse.yaml +1 -1
- package/rules/title-case-consistency.yaml +1 -1
- package/rules/title-length.yaml +1 -1
- package/rules/topic-predicate-distance.yaml +3 -3
- package/rules/translationese-density.yaml +1 -1
- package/rules/uncomparable-graded.yaml +1 -1
- package/rules/undefined-acronym.yaml +3 -3
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/unqualified-superlative.yaml +1 -1
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-word-density.yaml +3 -3
- package/rules/weasel-word.yaml +1 -1
- package/rules/which-that-consistency.yaml +1 -1
- package/rules/wordy-phrase.yaml +1 -1
- package/skills/chaff/SKILL.md +3 -1
- package/src/announced-count.ts +22 -1
- package/src/announced-list.ts +7 -1
- package/src/cli.ts +4 -2
- package/src/composite-signals.ts +10 -1
- package/src/detectors/acronym-name.ts +6 -3
- package/src/detectors/agentless-passive.ts +49 -5
- package/src/detectors/agreement-slip.ts +11 -3
- package/src/detectors/amount-scale.ts +2 -2
- package/src/detectors/char-shape.ts +18 -3
- package/src/detectors/chat-citation.ts +4 -5
- package/src/detectors/chat-mark-extent.ts +63 -0
- package/src/detectors/concrete-evidence-density.ts +2 -2
- package/src/detectors/concrete-evidence.ts +27 -0
- package/src/detectors/conjugated-entry.ts +3 -5
- package/src/detectors/contrast-frame.ts +37 -2
- package/src/detectors/currency-notation.ts +2 -2
- package/src/detectors/defined-term-form.ts +15 -4
- package/src/detectors/definition-use.ts +5 -8
- package/src/detectors/ellipsis.ts +2 -2
- package/src/detectors/email-letter.ts +1 -1
- package/src/detectors/en-shape.ts +50 -9
- package/src/detectors/gram-furniture.ts +8 -0
- package/src/detectors/gram-repetition.ts +8 -1
- package/src/detectors/heading-case.ts +11 -3
- package/src/detectors/kanji-name-edge.ts +27 -0
- package/src/detectors/kutoten-consistency.ts +37 -6
- package/src/detectors/lexicon-match.ts +17 -3
- package/src/detectors/lexicon.ts +10 -4
- package/src/detectors/list-item-clause.ts +9 -0
- package/src/detectors/list-parallel.ts +5 -2
- package/src/detectors/list-sentence.ts +2 -0
- package/src/detectors/mark-shape.ts +36 -8
- package/src/detectors/missing-final-period.ts +11 -1
- package/src/detectors/name-variant-two-things.ts +28 -3
- package/src/detectors/nominalization.ts +14 -4
- package/src/detectors/ordinal-suffix.ts +2 -2
- package/src/detectors/orthographic-variant.ts +44 -8
- package/src/detectors/orthography.ts +19 -9
- package/src/detectors/oxford-comma.ts +15 -1
- package/src/detectors/paragraph-run.ts +2 -2
- package/src/detectors/phone-number-variant.ts +2 -1
- package/src/detectors/phrase-context.ts +19 -0
- package/src/detectors/phrase-match-all.ts +57 -0
- package/src/detectors/phrase-match.ts +31 -6
- package/src/detectors/placeholder-text.ts +19 -3
- package/src/detectors/proper-noun-density.ts +14 -6
- package/src/detectors/quote-around.ts +6 -0
- package/src/detectors/range-notation.ts +2 -2
- package/src/detectors/reference-entry.ts +36 -6
- package/src/detectors/register-set-apart.ts +4 -4
- package/src/detectors/register-voice.ts +19 -0
- package/src/detectors/registry/phrase-match-all.ts +4 -0
- package/src/detectors/requirement-lists.ts +2 -0
- package/src/detectors/sentence-counts.ts +9 -5
- package/src/detectors/sentence-ending.ts +8 -4
- package/src/detectors/sentence-length.ts +18 -6
- package/src/detectors/sentence-parts.ts +21 -9
- package/src/detectors/signals.ts +10 -1
- package/src/detectors/speaker-turns.ts +37 -0
- package/src/detectors/team.ts +50 -12
- package/src/detectors/unit-spacing.ts +2 -2
- package/src/detectors/vague-deadline.ts +2 -1
- package/src/levels.ts +9 -3
- package/src/name-variant-shapes.ts +29 -0
- package/src/phone-numbers.ts +19 -3
- package/src/plugin.ts +2 -0
- package/src/render/explain.ts +46 -16
- package/src/render/options.ts +12 -6
- package/src/render/text.ts +20 -7
- package/src/run.ts +32 -8
- package/src/set-phrase-particles.ts +2 -2
- package/src/structure/deadline-after-event.ts +49 -10
- package/src/structure/definition-use.ts +15 -5
- package/src/structure/leg-times.ts +16 -1
- package/src/structure/requirement-lists.ts +14 -2
- package/src/structure/time-marks.ts +25 -0
- package/src/topic-clause.ts +17 -5
- package/dist/honorific-group.d.ts +0 -8
- package/dist/honorific-group.d.ts.map +0 -1
- package/dist/honorific-group.js +0 -15
- package/dist/honorific-group.js.map +0 -1
|
@@ -45,11 +45,11 @@ example:
|
|
|
45
45
|
来週は、新しい担当者の紹介、先月から続く予算の見直し、春の本社移転の準備、秋の採用計画の確認、年末の懇親会の段取りを話し合います。そのため定例会議は二時間に延長します。
|
|
46
46
|
|
|
47
47
|
not_flagged:
|
|
48
|
-
ja:
|
|
49
|
-
en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic, or straight away by a name as a new topic that runs to the end (〜ましたが、赤澤大臣は…); 〜ことから, 〜つつ, 〜としても or 〜こととし with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
|
|
48
|
+
ja: 主題(名詞+は)の無い文、鉤括弧で引いたものの中、上限までの距離は見ません。主題の述語が先の節で閉じる文(「この計画は簡単ではありませんが、…」「〜であって、…」、後ろの節に別の主語がある「〜ではなく、」「〜であるため、」、読点を挟まない「〜は〜で、」「〜であるならば、」「〜にあるところ、」「〜ており、」、受け身で伝える引用「〜だと言われているが」、主題と「〜ますが、」「〜ましたが、」(打ち消しの「〜ませんが、」「〜ませんでしたが、」も)の間に別の主語が無く、その後ろが別の主語(〜が)の節を経て新しい主題に移る文か、直後に名前の新しい主題(〜ましたが、赤澤大臣は…)が立って文末まで続く文、主題が行いを名詞にしたもの(〜することは差し控えますが、…)、主題からそこまでに別の主語が無い「〜ことから、」「〜つつ、」「〜としても、」「〜こととし、」(語は語彙表 topic-clause-close)、述語の後ろに丸数字の番号(③)が来て一行に詰まった箇条の次の項目が始まるところ、「〜のは」の主題が「という」で名詞に掛かる節の中で繋辞の述語を得て、その名詞句が読点で終わるところ(〜来てほしいのは日本であったという調査の結果、…))は、その節の終わりまでを数えます。後ろの節の主語には「〜のほとんどは」も数えます。副詞になる「は」(最後は=結局のところ。語は語彙表 topic-adverb)は主題と読みません。前に名詞や「の」が付けば(交渉の最後は)主題です。時や場面を言う「は」(今夜は、当日は、〜ときは)の後ろに別の主題があれば、その主題から数えます。法令でも契約でもない文書が条文をそのまま載せた文(「第7条 …」、形は語彙表 statute-article-opener)は、書き手が直せる文ではないので数えません。英語の文書には使いません。
|
|
49
|
+
en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが (or the negative 〜ませんが, 〜ませんでしたが) with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic, or straight away by a name as a new topic that runs to the end (〜ましたが、赤澤大臣は…), or always when the topic is an act made a noun (〜することは差し控えますが、…); 〜ことから, 〜つつ, 〜としても or 〜こととし with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
|
|
50
50
|
level_meaning:
|
|
51
51
|
ja: 主題から述語まで {limit} 字まで
|
|
52
|
-
en: up to {limit} characters between the topic and the predicate
|
|
52
|
+
en: up to {limit} {limit|character|characters} between the topic and the predicate
|
|
53
53
|
rewrite:
|
|
54
54
|
depth: light
|
|
55
55
|
ja:
|
|
@@ -47,7 +47,7 @@ not_flagged:
|
|
|
47
47
|
en: None of these is wrong alone, so documents shorter than 500 characters are not measured. Phrasings common in human technical writing (を提供する, に焦点を当てる, することができる) are not counted. A document whose only such phrases address the reader (あなたの, あなたは) has chosen to speak to its reader and is not reported; beside other phrases they count. The literature preset turns it off, since a novel calls its characters 彼女.
|
|
48
48
|
level_meaning:
|
|
49
49
|
ja: 1000 字あたり翻訳調の言い回し {limit} 個まで
|
|
50
|
-
en: up to {limit} translated phrasings per 1000 characters
|
|
50
|
+
en: up to {limit} {limit|translated phrasing|translated phrasings} per 1000 characters
|
|
51
51
|
rewrite:
|
|
52
52
|
depth: light
|
|
53
53
|
ja:
|
|
@@ -50,7 +50,7 @@ not_flagged:
|
|
|
50
50
|
en: Only the pairs on chaff's list are checked. Words that say how close ("almost unique", "nearly impossible", ほぼ完璧) are not reported. A superlative stacked on a superlative (最も最適) is redundant-expression's, and より最適化する (optimise further) is not reported. Literature is not checked.
|
|
51
51
|
level_meaning:
|
|
52
52
|
ja: 当てはまる言い回しが {limit} 箇所あれば指摘
|
|
53
|
-
en: reported once there are {limit}
|
|
53
|
+
en: reported once there {limit|is|are} {limit}
|
|
54
54
|
sources: [proselint]
|
|
55
55
|
rewrite:
|
|
56
56
|
depth: light
|
|
@@ -93,8 +93,8 @@ example:
|
|
|
93
93
|
after: Our key goal indicator (KGI) this term is to reach product-market fit (PMF).
|
|
94
94
|
|
|
95
95
|
not_flagged:
|
|
96
|
-
ja: 誰でも知っている略語(URL、PDF など)と、前後の括弧で説明した略語、会社の名前の中の英字(㈱ADEKA、CO.,LTD.)は指しません。ひな形の名前の置き場所(OOOO、XX 月)と、外のページへのリンクを並べた一覧の題名の中の略語も指しません(題名の略語は数には入れます)。大文字の違うだけの書き方で説明した略語(TCoP と TCOP)、略語を話題にする文で語に書き出した略語(略語の DOB … date of birth)、一覧で語のすぐ下にその語を名指すリンクを入れ子にした語(- GPL の下の GNU General Public License)も指しません。判例の引用の中の当事者と裁判所の名前(Ashwander v. TVA, 297 U.S. 288、MCI Telecomms. Corp. v. AT&T、(SDNY 1952))、引用の中の行政機関の事件番号(NOV/CFA 01-01)も指しません(引用の略語は数には入れます)。判決の頭の MR. JUSTICE も指しません。括弧の中で略語に「or」で別の呼び名を添えたもの(Department of Health and Human Services (HHS or the Department))、ハイフンで繋いだ字まで名前と揃うもの(Agency for Health (ARPA-H))は説明したと読み、メールアドレスの中の英字(OASH-RFI@hhs.gov)は略語と読みません。文書の中に書いた ABNF の文法の規則の名前と値(CRLF、%x0D)、等級の並び(A と AA)、番号で引く官報や判例集(80 FR 66128、2022 WL 4447293)、日付の付いた識別子の前の種類(WD WD-ABC1-20200101)、PO Box の PO も指しません。文献を引いて始まる注(1. See L. Summers (2015), "…," IMF Economic Review)の中の略語は、引いた文献の題名や誌名の書き方なので指しません(数には入れます)。角括弧の見出しで始まる文献の項目([FETCH] WHATWG,
|
|
97
|
-
en: Common acronyms (URL, PDF), acronyms spelled out in brackets next to them, and the letters of a company name (㈱ADEKA, CO.,LTD.) are not reported. Neither are a template's placeholders (OOOO, XX 月) or an acronym in the title of a page in a list of links (it still counts towards the limit). Nor are an acronym explained under another capitalisation (TCoP, then TCOP), one a sentence about the abbreviation writes out (the abbreviation DOB … date of birth), or a term in a list whose nested link names it (- GPL above GNU General Public License). Nor are the parties and courts of a case citation (Ashwander v. TVA, 297 U.S. 288; MCI Telecomms. Corp. v. AT&T; (SDNY 1952)), an agency's docket number in a citation (NOV/CFA 01-01); a citation's acronyms still count towards the limit. Nor is the MR. JUSTICE that opens a line of an opinion. An acronym given another name after "or" in its parenthesis (Department of Health and Human Services (HHS or the Department)) or spelled out with its hyphened letter (Agency for Health (ARPA-H)) counts as expanded, and the letters of an email address (OASH-RFI@hhs.gov) are not an acronym. Nor are the rule names and values of an ABNF grammar in the text (CRLF, %x0D), the rungs of a grade ladder (A and AA), a register or reporter cited by number (80 FR 66128, 2022 WL 4447293), the kind written before a dated identifier (WD WD-ABC1-20200101), or the PO of a PO Box. A note that opens with a citation (1. See L. Summers (2015), "…," IMF Economic Review) is written in the cited work's words, and its acronyms are not reported (they still count towards the limit); so is an entry of a reference list keyed by a bracketed label ([FETCH] WHATWG,
|
|
96
|
+
ja: 誰でも知っている略語(URL、PDF など)と、前後の括弧で説明した略語、会社の名前の中の英字(㈱ADEKA、CO.,LTD.)は指しません。ひな形の名前の置き場所(OOOO、XX 月)と、外のページへのリンクを並べた一覧の題名の中の略語も指しません(題名の略語は数には入れます)。大文字の違うだけの書き方で説明した略語(TCoP と TCOP)、略語を話題にする文で語に書き出した略語(略語の DOB … date of birth)、一覧で語のすぐ下にその語を名指すリンクを入れ子にした語(- GPL の下の GNU General Public License)も指しません。判例の引用の中の当事者と裁判所の名前(Ashwander v. TVA, 297 U.S. 288、MCI Telecomms. Corp. v. AT&T、(SDNY 1952))、引用の中の行政機関の事件番号(NOV/CFA 01-01)も指しません(引用の略語は数には入れます)。判決の頭の MR. JUSTICE も指しません。括弧の中で略語に「or」で別の呼び名を添えたもの(Department of Health and Human Services (HHS or the Department))、ハイフンで繋いだ字まで名前と揃うもの(Agency for Health (ARPA-H))は説明したと読み、メールアドレスの中の英字(OASH-RFI@hhs.gov)は略語と読みません。文書の中に書いた ABNF の文法の規則の名前と値(CRLF、%x0D)、等級の並び(A と AA)、番号で引く官報や判例集(80 FR 66128、2022 WL 4447293)、日付の付いた識別子の前の種類(WD WD-ABC1-20200101)、PO Box の PO も指しません。文献を引いて始まる注(1. See L. Summers (2015), "…," IMF Economic Review)の中の略語は、引いた文献の題名や誌名の書き方なので指しません(数には入れます)。角括弧の見出しで始まる文献の項目([FETCH] WHATWG, …。長い見出しの後ろの空白が 1 つでも、見出しだけの行の下に字下げして続けても)の中の略語も同じです。2 つ以上の番号で引く続き物の名前(BCP 78 と BCP 14、DR 4339 と DR 4340)、同じ文の前のほうで名前を書き出した略語(U.S. Small Business Administration … SBA)、肩書きの後ろの判事の姓(Lord HOLT、Mr. Justice BULLER)、商標の印の付いた名前(Acrobat DC®)、条で引く法令集(44 USC. 3502、15 USCA § 709、FAR 12.212)と、編と区分で引く法令集(21 CFR subpart J)も指しません。ショートメッセージで送るキーワード(texting GNPCGS to 333111)、名前のまま書いた製品の版(Adobe Acrobat Reader DC)、頭だけ大文字の語に繋いだ名前の中の大文字(NITE SAFE-Lite)も指しません。同じ文の前のほうで、同じ名詞の前に小文字で書き出した略語(incident response plan … IR plans)と、括弧の中で小文字の語を添えた略語の名前の頭の頭文字が揃うもの(… Partnerships to Stimulate Cybersecurity Education (RAMPS program))は説明したと読みます。貼り付けたチャットの発言(<jinxer-wm> FIRING …)の中の略語は、発言した人やボットの言葉なので指しません(数には入れます)。番地から州と郵便番号まで揃った所在地の中の大文字(1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329 の NE と MS)、SQL のキーワード(VIEW、WHERE)、文の中で頭だけ大文字の語にも書いた名前を大文字で書いたもの(a hotel / Airbnb と書いた文書の AIRBNB)も指しません。行の頭に大文字で書いた接続詞(OR, Skip to …、二つの選択肢の間に一行で置いた OR)も指しません。ファイルの種類の名前としてだけ書いた大文字(the MAP files、MAPファイル、拡張子の “.MAP”)も指しません。辞書が間投詞としてしか知らない 3 文字以上の語を大文字で書いたもの(製品の名前の HEY)も指しません。どちらも 5 文字以上の大文字の語が 2 つ並んだもの(計画の名前の MIRAI SCHOOL、UNITED STATES)は、大文字で書いた名前や語なので指しません。
|
|
97
|
+
en: Common acronyms (URL, PDF), acronyms spelled out in brackets next to them, and the letters of a company name (㈱ADEKA, CO.,LTD.) are not reported. Neither are a template's placeholders (OOOO, XX 月) or an acronym in the title of a page in a list of links (it still counts towards the limit). Nor are an acronym explained under another capitalisation (TCoP, then TCOP), one a sentence about the abbreviation writes out (the abbreviation DOB … date of birth), or a term in a list whose nested link names it (- GPL above GNU General Public License). Nor are the parties and courts of a case citation (Ashwander v. TVA, 297 U.S. 288; MCI Telecomms. Corp. v. AT&T; (SDNY 1952)), an agency's docket number in a citation (NOV/CFA 01-01); a citation's acronyms still count towards the limit. Nor is the MR. JUSTICE that opens a line of an opinion. An acronym given another name after "or" in its parenthesis (Department of Health and Human Services (HHS or the Department)) or spelled out with its hyphened letter (Agency for Health (ARPA-H)) counts as expanded, and the letters of an email address (OASH-RFI@hhs.gov) are not an acronym. Nor are the rule names and values of an ABNF grammar in the text (CRLF, %x0D), the rungs of a grade ladder (A and AA), a register or reporter cited by number (80 FR 66128, 2022 WL 4447293), the kind written before a dated identifier (WD WD-ABC1-20200101), or the PO of a PO Box. A note that opens with a citation (1. See L. Summers (2015), "…," IMF Economic Review) is written in the cited work's words, and its acronyms are not reported (they still count towards the limit); so is an entry of a reference list keyed by a bracketed label ([FETCH] WHATWG, …; also when a long label leaves one space, or stands alone above the indented entry). Nor are capitals the document cites by two or more numbers (BCP 78 and BCP 14, DR 4339 and DR 4340), an acronym whose name the same sentence writes out before it (U.S. Small Business Administration … SBA), a judge's surname after his title (Lord HOLT, Mr. Justice BULLER), a name marked as a trademark (Acrobat DC®), a code cited by section (44 USC. 3502, 15 USCA § 709, FAR 12.212), or a code cited by title and division (21 CFR subpart J). Nor are a keyword to send by text message (texting GNPCGS to 333111), a product's edition written with the product's name (Adobe Acrobat Reader DC), or capitals joined to a capitalised word in a name (NITE SAFE-Lite). An acronym the same sentence writes out in lower case before the same noun (incident response plan … IR plans), and one bracketed with a word in lower case after a name whose head gives its letters (… Partnerships to Stimulate Cybersecurity Education (RAMPS program)), count as expanded. An acronym in a pasted chat line (<jinxer-wm> FIRING …) is the speaker's or the bot's words, and is not reported (it still counts towards the limit). Nor are the capitals inside a postal address that runs from a street number to a state and ZIP code (the NE and MS of 1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329), a keyword of SQL (VIEW, WHERE), or a name in capitals that the document also writes inside a sentence with only its first letter a capital (AIRBNB in a text that writes a hotel / Airbnb). Nor is a conjunction written in capitals at the head of a line (OR, Skip to …; an OR alone between two options). Nor are capitals a document writes only as the name of a kind of file (the MAP files, MAPファイル, the extension “.MAP”). Nor is a word of three letters or more that the dictionary knows only as an interjection, written in capitals (HEY, a product's name). Nor are two words in capitals side by side, each of five letters or more (MIRAI SCHOOL, the name of a plan; UNITED STATES), which are a name or words written in capitals.
|
|
98
98
|
level_meaning:
|
|
99
99
|
ja: 説明のない略語が {limit} 種類あれば指摘。文書が自分で略語を {limit} 個展開していれば、1 つの抜けから指摘
|
|
100
|
-
en: reported once {limit} different acronyms go unexplained, or from the first one when the document itself spells out {limit} others
|
|
100
|
+
en: reported once {limit} different {limit|acronym goes|acronyms go} unexplained, or from the first one when the document itself spells out {limit} {limit|other|others}
|
|
@@ -10,8 +10,8 @@ name:
|
|
|
10
10
|
en: Unfilled placeholder
|
|
11
11
|
|
|
12
12
|
why:
|
|
13
|
-
ja: "「【会社名】」「[Your Name]」「(ここに会社名を書く)」は、雛形や生成した下書きに残る空欄です。値に「TODO: …」「未定」とだけ書いたものも、後で埋めるつもりの空欄です。英語の雛形の指示の行(OPTIONAL: General conclusions …)が、埋めた報告書に残ったものも同じです。文体の好みではなく、埋め忘れです。ビジネス文書の宛名・署名・金額・日付・住所・電話番号の位置に残った「〇〇様」「株式会社〇〇」「〇万円」「氏名:〇〇」「03-〇〇〇〇」も同じ空欄です。表の升に残った空欄も数えます。文の中で例として置いた「○○」は正しい書き方なので数えません。"
|
|
14
|
-
en: '"[Your Name]"
|
|
13
|
+
ja: "「【会社名】」「[Your Name]」「[Candidate Name]」「(ここに会社名を書く)」は、雛形や生成した下書きに残る空欄です。値に「TODO: …」「未定」とだけ書いたものも、後で埋めるつもりの空欄です。英語の雛形の指示の行(OPTIONAL: General conclusions …)が、埋めた報告書に残ったものも同じです。文体の好みではなく、埋め忘れです。ビジネス文書の宛名・署名・金額・日付・住所・電話番号の位置に残った「〇〇様」「株式会社〇〇」「〇万円」「氏名:〇〇」「03-〇〇〇〇」も同じ空欄です。表の升に残った空欄も数えます。文の中で例として置いた「○○」は正しい書き方なので数えません。"
|
|
14
|
+
en: '"[Your Name]", "[Insert Date]" and "[Candidate Name]" are the blanks a template or a generated draft leaves. A value that only says "TODO: …" or "TBD" is a blank too, left to fill in later, and so is an instruction line from the template left in a filled report ("OPTIONAL: General conclusions …"). This is not a matter of style: the blank was never filled. In a Japanese business document, the blank marks (〇〇) left where a name, a sum, a date, an address or a phone number belongs (〇〇様, 株式会社〇〇, 〇万円, 氏名:〇〇, 03-〇〇〇〇) are blanks too. A blank left in a table cell counts as well.'
|
|
15
15
|
|
|
16
16
|
message:
|
|
17
17
|
ja: 「{matched}」が埋まっていません
|
|
@@ -43,5 +43,5 @@ example:
|
|
|
43
43
|
We can meet on Friday 9 October to go through the quote.
|
|
44
44
|
|
|
45
45
|
not_flagged:
|
|
46
|
-
ja: "文の中で例として置いた「○○」とビジネス文書以外の「○○」、行頭の「○」(箇条書きの印)、Markdown のリンク、脚注の番号、チェック欄とチェックリストの項目(- [ ] TODO: …)、値が続く見出しの札(【氏名】山田)、大文字でない「Optional:」と行の途中の OPTIONAL、コードとコードのコメント(// TODO)、文の中の「未定」(日程は未定です)、見出しが雛形と言う節(「## 雛形」「# 記入例」)の中の空欄、文書がほかの行で値を書き入れている書式の欄の名前(【氏名】 山田 花子 とある文書の「【氏名】に旧氏を書く」)、記入線の横の札(____ [Name of New Employer]
|
|
47
|
-
en: 'Markdown links and reference definitions, footnote numbers, checkboxes and checklist items ("- [ ] TODO: …"), a label its value follows ("[Date]: 2024-04-01"), "Optional:" not in capitals and OPTIONAL inside a line, code and code comments ("// TODO"), "TBD" inside a sentence ("the date is TBD"), and blanks under a heading that names a template ("## Template", "# Sample letter") are not reported. Nor are a field label of a form that the document fills in on another line (【氏名】 followed by a name), the caption beside a line to write on ("________ [Name of New Employer]"), and a blank inside a quoted example ("Helpful: “See the link [insert link name] below the image”"). Nor is a Japanese example mark (○○) inside a sentence or outside a business document.'
|
|
46
|
+
ja: "文の中で例として置いた「○○」とビジネス文書以外の「○○」、行頭の「○」(箇条書きの印)、Markdown のリンク、脚注の番号、チェック欄とチェックリストの項目(- [ ] TODO: …)、値が続く見出しの札(【氏名】山田)、大文字でない「Optional:」と行の途中の OPTIONAL、コードとコードのコメント(// TODO)、文の中の「未定」(日程は未定です)、見出しが雛形と言う節(「## 雛形」「# 記入例」)の中の空欄、文書がほかの行で値を書き入れている書式の欄の名前(【氏名】 山田 花子 とある文書の「【氏名】に旧氏を書く」)、記入線の横の札(____ [Name of New Employer])、例を示す行のかぎ括弧の中(例:「【会社名】の田中です」)も指しません。英語の括弧は、Name や Date で終わっても、語の頭がみな大文字の二語から四語でなければ指しません(編者の補い [the defendant's name]、注記 [sic])。"
|
|
47
|
+
en: 'Markdown links and reference definitions, footnote numbers, checkboxes and checklist items ("- [ ] TODO: …"), a label its value follows ("[Date]: 2024-04-01"), "Optional:" not in capitals and OPTIONAL inside a line, code and code comments ("// TODO"), "TBD" inside a sentence ("the date is TBD"), and blanks under a heading that names a template ("## Template", "# Sample letter") are not reported. Nor are a field label of a form that the document fills in on another line (【氏名】 followed by a name), the caption beside a line to write on ("________ [Name of New Employer]"), and a blank inside a quoted example ("Helpful: “See the link [insert link name] below the image”"). Nor is a Japanese example mark (○○) inside a sentence or outside a business document. A bracket ending in "Name" or "Date" counts only as two to four capitalised words ("[Candidate Name]"), so an editor''s insertion ("[the defendant''s name]") and a note ("[sic]") are not reported.'
|
|
@@ -56,4 +56,4 @@ not_flagged:
|
|
|
56
56
|
en: A superlative with its comparison or scope in the same sentence ("in our range", "than last year", "the fastest in the industry") is not reported, nor is one limited by a clause ("the best we have measured"), nor one inside quotation marks, which are someone else's words, nor one inside a set phrase ("even the best", "in the best case", "make the most of", "the most recent", "the most common"), nor one in a question, nor one inside a condition ("If spreadsheet formulas are the most prolific government code, …"). A superlative that is sought or chosen rather than claimed ("to achieve the best results", "before deciding the best way", "start with the most important tasks") is not reported, nor one whose predicate points at a member of a set ("the best plan is the one you keep") or puts it in an order ("the most critical vulnerabilities are addressed first"), nor one whose noun names a part of a whole ("the most important part", "the most important role"), nor one whose set follows its noun ("the best thing about this event", "the most common form of debunking", "the most important tool for creating the culture").
|
|
57
57
|
level_meaning:
|
|
58
58
|
ja: 比べる相手のない最上級が {limit} 箇所あれば指摘
|
|
59
|
-
en: reported once there are {limit} such claims
|
|
59
|
+
en: reported once there {limit|is|are} {limit} {limit|such claim|such claims}
|
|
@@ -50,8 +50,8 @@ example:
|
|
|
50
50
|
This agreement is between Harbour Ltd (the "Seller") and Hill Ltd (the "Buyer"). The Seller ships within five days.
|
|
51
51
|
|
|
52
52
|
not_flagged:
|
|
53
|
-
ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。規約やポリシーの丁寧な形(以下「X」といいます)も、法令の形と同じに読みます。見出しの行(章・節の行、条の前の「(買主の義務)」のような見出し)の語と、漢字で終わる語にさらに漢字が続く長い語(「監査委員会」の「監査委員」)と、定義の括弧の前の長い名前をそのまま書いた所(「…作成の手引き(以下「手引き」という。)」より前の「…作成の手引き」)は、使った所に数えません。最初の一か所だけを指します。別の語を定義する括弧の前の名前の中(This Services Agreement (this "Agreement") の Services、本サービス利用契約(以下「本契約」という。)の本サービス)も、使った所に数えません。目次・索引の行(目次の見出しの下の項目、一行に詰めた目次、定義した語と条の番地の一覧)と、条の番号の後ろの題(Section 1.1 Closing.)と、番号と語の終わりに条の番地の括弧を添えただけの札((1)文化芸術推進基本計画(第7条関係))と、語を含むもっと長い名前(定義の括弧の前の名前を前で写した株式会社みなと、もっと長い定義した語、Navistar Financial Corporation)も数えません。文書自身の名前と定義した語に同じ頭を付けた所(この就業規則(以下「規則」)より前の「この規則」)と、すぐ後ろの括弧に定義の長い名前を書き添えた所は、読み手に分かるので言いません。要約の節(「要旨」「裁判要旨」「Summary」のような見出しの下)で、定義がその節の外にある語と、番号と題だけの項目の行((2)本件仮換地の指定等)は、本文を縮めたり名前を付けたりした所なので数えません。番地や法令の名前に続けて語の意味の出どころを書いた所(69条の3所定の小規模宅地等)も数えません。「はじめに」「序論」の節は後の本文が定義することを先に名指す所なので、要約の節と同じに読みます。他の法令を引き写した節(見出しがその法令の名前で、文書がほかでその法令を引いている)の条の中の定義は、その法令の定義で、この文書の語の定義としては読みません。英語の語を大文字の長い名前の終わりに書いた所(The National Security Act of 1947)より後ろの the Act
|
|
54
|
-
en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. A heading line (a chapter or section line, or the caption above an article) does not count as a use, nor does a longer word that runs on in kanji past a term ending in kanji, nor an earlier copy of the long name written just before the definition's bracket. The polite Japanese form (以下「X」といいます) is read like the statute form. Only the first early use is pointed at. A word inside the name written right before another term's defining bracket (Services in This Services Agreement (this "Agreement")) is not a use either. Nor are contents and index lines (the items under a contents heading, a table of contents or a list of defined terms and section numbers packed on one line), a caption after a section number (Section 1.1 Closing.), a label of a number and the term ending in a bracketed section reference ((a) Seller (Section 2)), or a longer name that holds the term, such as an earlier copy of the name before the bracket (Board of Directors before our Board of Directors ("Board")), a longer defined term, a capitalised name ending in it (Navistar Financial Corporation). The document naming itself (this Agreement before (this "Agreement")) and a use followed by the long name in brackets are clear to the reader and not pointed at. A use in a summary section (under a heading such as Summary, Syllabus or 裁判要旨) of a term defined outside it, and a numbered line that only names the section below ((2) Interim Land Designation) summarise or name the body, so they are not uses either. An introduction (a heading that is the whole of Introduction, Preface or Foreword) names ahead what the body defines and is read like a summary. A definition inside an article copied from another statute (under a heading that names a document the text cites elsewhere) is that statute's, not this document's. After a longer capitalised name ending in the term (The National Security Act of 1947), "the Act" points back to that name and is not an early use.
|
|
53
|
+
ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。規約やポリシーの丁寧な形(以下「X」といいます)も、法令の形と同じに読みます。見出しの行(章・節の行、条の前の「(買主の義務)」のような見出し)の語と、漢字で終わる語にさらに漢字が続く長い語(「監査委員会」の「監査委員」)と、定義の括弧の前の長い名前をそのまま書いた所(「…作成の手引き(以下「手引き」という。)」より前の「…作成の手引き」)は、使った所に数えません。最初の一か所だけを指します。別の語を定義する括弧の前の名前の中(This Services Agreement (this "Agreement") の Services、本サービス利用契約(以下「本契約」という。)の本サービス)も、使った所に数えません。目次・索引の行(目次の見出しの下の項目、一行に詰めた目次、定義した語と条の番地の一覧)と、条の番号の後ろの題(Section 1.1 Closing.)と、番号と語の終わりに条の番地の括弧を添えただけの札((1)文化芸術推進基本計画(第7条関係))と、語を含むもっと長い名前(定義の括弧の前の名前を前で写した株式会社みなと、もっと長い定義した語、Navistar Financial Corporation)も数えません。文書自身の名前と定義した語に同じ頭を付けた所(この就業規則(以下「規則」)より前の「この規則」)と、すぐ後ろの括弧に定義の長い名前を書き添えた所は、読み手に分かるので言いません。要約の節(「要旨」「裁判要旨」「Summary」のような見出しの下)で、定義がその節の外にある語と、番号と題だけの項目の行((2)本件仮換地の指定等)は、本文を縮めたり名前を付けたりした所なので数えません。番地や法令の名前に続けて語の意味の出どころを書いた所(69条の3所定の小規模宅地等)も数えません。「はじめに」「序論」の節は後の本文が定義することを先に名指す所なので、要約の節と同じに読みます。他の法令を引き写した節(見出しがその法令の名前で、文書がほかでその法令を引いている)の条の中の定義は、その法令の定義で、この文書の語の定義としては読みません。英語の語を大文字の長い名前の終わりに書いた所(The National Security Act of 1947)より後ろの the Act は、その名前を指すので数えません。一字の漢字の語は、当事者の呼び名(甲・乙・丙・丁)だけを探します。「法」「令」のような一字の語はふつうの語としても書くためです。
|
|
54
|
+
en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. A heading line (a chapter or section line, or the caption above an article) does not count as a use, nor does a longer word that runs on in kanji past a term ending in kanji, nor an earlier copy of the long name written just before the definition's bracket. The polite Japanese form (以下「X」といいます) is read like the statute form. Only the first early use is pointed at. A word inside the name written right before another term's defining bracket (Services in This Services Agreement (this "Agreement")) is not a use either. Nor are contents and index lines (the items under a contents heading, a table of contents or a list of defined terms and section numbers packed on one line), a caption after a section number (Section 1.1 Closing.), a label of a number and the term ending in a bracketed section reference ((a) Seller (Section 2)), or a longer name that holds the term, such as an earlier copy of the name before the bracket (Board of Directors before our Board of Directors ("Board")), a longer defined term, a capitalised name ending in it (Navistar Financial Corporation). The document naming itself (this Agreement before (this "Agreement")) and a use followed by the long name in brackets are clear to the reader and not pointed at. A use in a summary section (under a heading such as Summary, Syllabus or 裁判要旨) of a term defined outside it, and a numbered line that only names the section below ((2) Interim Land Designation) summarise or name the body, so they are not uses either. An introduction (a heading that is the whole of Introduction, Preface or Foreword) names ahead what the body defines and is read like a summary. A definition inside an article copied from another statute (under a heading that names a document the text cites elsewhere) is that statute's, not this document's. After a longer capitalised name ending in the term (The National Security Act of 1947), "the Act" points back to that name and is not an early use. A Japanese term of a single kanji is checked only when it is a party's short name (甲, 乙, 丙, 丁); other single-kanji words such as 法 are also written in their everyday sense.
|
|
55
55
|
rewrite:
|
|
56
56
|
depth: structure
|
|
57
57
|
ja:
|
|
@@ -53,11 +53,11 @@ example:
|
|
|
53
53
|
Report an incident within 30 minutes and notify the affected teams. Record it in the incident log and fix the cause by the next working day.
|
|
54
54
|
|
|
55
55
|
not_flagged:
|
|
56
|
-
ja: 文書の長さに対して少ないものは指しません。短すぎる文書も測りません。指すのは語のある文ごとに一度で、長い言い方の中の語(in a timely manner の timely)は一つと数えます。英語の法務の文書では、法律や慣行が意味を決めている言い方(reasonable、best efforts、from time to time
|
|
57
|
-
en: 'A few vague words for the document''s length are not reported, and very short documents are not measured. Each sentence is reported once, and a word inside a longer phrase ("timely" in "in a timely manner") counts once. In legal documents, a word inside a term that law and practice define ("reasonable", "best efforts", "from time to time") is not counted. Inside a requirement, requirement-smell also reads "where possible" and "as needed". A word that the bracket right after it pins down ("a reasonable fee (USD 50)") is not counted either; a bracket that only names it ("(hereinafter the ""Fee"")") pins nothing down. Lines under a table of contents heading (the sections'' names) are not counted, and "reasonable accommodation" is the name of a legal duty in any genre. A word that a law or a section governs right after it ("as required by applicable law", "as required under 45 CFR §164.528", "as required under HIPAA") is not counted, since that law says what is required; one a party decides ("as required by Licensor") is.'
|
|
56
|
+
ja: 文書の長さに対して少ないものは指しません。短すぎる文書も測りません。指すのは語のある文ごとに一度で、長い言い方の中の語(in a timely manner の timely)は一つと数えます。英語の法務の文書では、法律や慣行が意味を決めている言い方(reasonable、best efforts、from time to time)の中の語は数えません。データ保護の法律が義務として書く安全管理の言い方(appropriate technical and organisational measures、appropriate administrative, physical, and technical safeguards)も同じです。何も名指さない appropriate measures は数えます。要求の文の中の「可能な限り」「必要に応じて」は、要求の書き方として requirement-smell も見ます。すぐ後ろの括弧で中身を書いた語(一定の事項(請求書に書く事項))も数えません。括弧が名前を付けるだけ(以下「本措置」という。)なら数えます。目次の見出しの下の行(節の名前)は数えません。英語の reasonable accommodation は、どのジャンルでも法律が決めた義務の名前なので数えません。英語で、すぐ後ろに法律や条を名指す語が続くもの(as required by applicable law、as required under 45 CFR §164.528、as required under HIPAA)は、何が要るのかをその法律が決めているので数えません。当事者が決めるもの(as required by Licensor)は数えます。
|
|
57
|
+
en: 'A few vague words for the document''s length are not reported, and very short documents are not measured. Each sentence is reported once, and a word inside a longer phrase ("timely" in "in a timely manner") counts once. In legal documents, a word inside a term that law and practice define ("reasonable", "best efforts", "from time to time") is not counted; nor are the security duties data-protection law writes ("appropriate technical and organisational measures", "appropriate administrative, physical, and technical safeguards"), while a bare "appropriate measures" is counted. Inside a requirement, requirement-smell also reads "where possible" and "as needed". A word that the bracket right after it pins down ("a reasonable fee (USD 50)") is not counted either; a bracket that only names it ("(hereinafter the ""Fee"")") pins nothing down. Lines under a table of contents heading (the sections'' names) are not counted, and "reasonable accommodation" is the name of a legal duty in any genre. A word that a law or a section governs right after it ("as required by applicable law", "as required under 45 CFR §164.528", "as required under HIPAA") is not counted, since that law says what is required; one a party decides ("as required by Licensor") is.'
|
|
58
58
|
level_meaning:
|
|
59
59
|
ja: 1000 字あたりあいまいな語 {limit} 個まで
|
|
60
|
-
en: up to {limit} vague words per 1000 words
|
|
60
|
+
en: up to {limit} {limit|vague word|vague words} per 1000 words
|
|
61
61
|
rewrite:
|
|
62
62
|
depth: light
|
|
63
63
|
ja:
|
package/rules/weasel-word.yaml
CHANGED
|
@@ -53,7 +53,7 @@ not_flagged:
|
|
|
53
53
|
en: Only the phrases on chaff's list are checked. A citation right after the phrase does not silence it, since the sentence can name the study itself. In Japanese, 研究によると and 専門家によると, which often follow their source, are checked only as ある・最近の・多くの forms, と言われる only as と言われている (not よく言われる, which mostly talks about the saying itself), and 一般的に alone is not checked. Nor is a quotation reported as told on an occasion or by a named sayer (申し込んだら、「…」と言われています, 業者から「…」と言われている), since someone did say it.
|
|
54
54
|
level_meaning:
|
|
55
55
|
ja: 当てはまる言い回しが {limit} 箇所あれば指摘
|
|
56
|
-
en: reported once there are {limit}
|
|
56
|
+
en: reported once there {limit|is|are} {limit}
|
|
57
57
|
rewrite:
|
|
58
58
|
depth: light
|
|
59
59
|
ja:
|
|
@@ -47,7 +47,7 @@ not_flagged:
|
|
|
47
47
|
en: 'A non-restrictive clause set off by a comma ("the rule, which we added,"), "which" after a preposition ("in which"), a "that" followed by its own subject ("the report that we wrote", "the fact that it works"), a document where the usual form appears fewer than 3 times, and one where the fewer form passes the level (used on purpose) are not reported. Text inside quotation marks (single ones too, ‘…’, even over several sentences) and block quotations (a > paragraph, a paragraph opening with a bracketed alteration such as [T]he, or one that goes on in lowercase after a paragraph left without a full stop) keep the quoted text''s wording and are not counted.'
|
|
48
48
|
level_meaning:
|
|
49
49
|
ja: 少ないほうの書き方が {limit} 箇所以下のとき指摘
|
|
50
|
-
en: reported when the fewer form appears {limit} times or fewer
|
|
50
|
+
en: reported when the fewer form appears {limit} {limit|time|times} or fewer
|
|
51
51
|
|
|
52
52
|
rewrite:
|
|
53
53
|
depth: light
|
package/rules/wordy-phrase.yaml
CHANGED
|
@@ -53,7 +53,7 @@ not_flagged:
|
|
|
53
53
|
en: Only the phrases on chaff's list are checked. Phrases that contracts and statutes use on purpose ("with regard to", "prior to", "in accordance with") are not on it, nor is "at all times", which states the scope of a rule ("pets must be on a leash at all times"). In Japanese, することができる, ordinary in human writing, and 必要性, which a noun phrase may need, are left out; translationese (を可能にする) is translationese-density's and 〜を行う is nominalization's.
|
|
54
54
|
level_meaning:
|
|
55
55
|
ja: 回りくどい言い回しを含む文が {limit} 文あれば指摘
|
|
56
|
-
en: reported once {limit} sentences hold one
|
|
56
|
+
en: reported once {limit} {limit|sentence holds|sentences hold} one
|
|
57
57
|
rewrite:
|
|
58
58
|
depth: light
|
|
59
59
|
ja:
|
package/skills/chaff/SKILL.md
CHANGED
|
@@ -76,7 +76,9 @@ calls nothing. Ask the person before a real run; the passages leave the machine.
|
|
|
76
76
|
| Change the rule | Wrong for this team or genre | `npx chaffjs relax <rule-id> --why "reason"` (or `strict` / `off`). The reason and date are written into `chaff.yaml`. |
|
|
77
77
|
|
|
78
78
|
`npx chaffjs explain <rule-id>` shows why a rule exists, its levels and the current one. Read it before
|
|
79
|
-
relaxing a rule.
|
|
79
|
+
relaxing a rule. A worked before and after for a rule, with chaff's real output and the settings, is at
|
|
80
|
+
`https://github.com/isamu/lab/blob/main/text/docs/samples/<ja|en>/<rule-id>.md` when that rule has one (the index:
|
|
81
|
+
`docs/samples/<ja|en>/README.md`).
|
|
80
82
|
|
|
81
83
|
When a finding is wrong for a reason that is not about this team (chaff misread the text), tell the person and offer
|
|
82
84
|
`npx chaffjs feedback <file> --rule <rule-id> --line <n>`: it drafts a report and sends nothing. A document the
|
package/src/announced-count.ts
CHANGED
|
@@ -125,7 +125,28 @@ const pointsAhead = (sentence: string, phrase: Phrase, anchors: readonly string[
|
|
|
125
125
|
const lowered = anchors.map((anchor) => anchor.toLowerCase());
|
|
126
126
|
if (!phrase.counted) return lowered.some((anchor) => endsWithWord(before.trimEnd(), anchor));
|
|
127
127
|
if (lowered.some((anchor) => before.includes(anchor))) return true;
|
|
128
|
-
|
|
128
|
+
const after = sentence.slice(phrase.end);
|
|
129
|
+
return COLON_END.test(sentence.trimEnd()) && !number.test(after) && !inEarlierClause(after.toLowerCase(), lowered);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** 句切りの読点やコンマ。「3点、以下の」の読点は数のすぐ後ろで、手前に語が無いので、数を前の節に閉じ込めない。 */
|
|
133
|
+
const CLAUSE_MARK = /[、,,]/u;
|
|
134
|
+
const WRITTEN = /\S/u;
|
|
135
|
+
|
|
136
|
+
/** 読点やコンマのどれかの手前(一つ前の読点から)に語がある。 */
|
|
137
|
+
const hasClauseBreak = (text: string): boolean =>
|
|
138
|
+
text
|
|
139
|
+
.split(CLAUSE_MARK)
|
|
140
|
+
.slice(0, -1)
|
|
141
|
+
.some((part) => WRITTEN.test(part));
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 数の後ろに先を指す語があり、その手前で一度節が切れる(二人に聞いて分かった、困っていたことは以下のとおり)。
|
|
145
|
+
* 先を指す語が予告するのは後ろの節の語で、前の節の数(聞いた人数)は並べるものの数ではない。
|
|
146
|
+
*/
|
|
147
|
+
const inEarlierClause = (after: string, anchors: readonly string[]): boolean => {
|
|
148
|
+
const anchorAt = Math.min(...anchors.map((anchor) => after.indexOf(anchor)).filter((at) => at >= 0));
|
|
149
|
+
return Number.isFinite(anchorAt) && hasClauseBreak(after.slice(0, anchorAt));
|
|
129
150
|
};
|
|
130
151
|
|
|
131
152
|
/**
|
package/src/announced-list.ts
CHANGED
|
@@ -44,6 +44,12 @@ export const namesInOrder = (tokens: readonly Token[], joiners: ReadonlySet<stri
|
|
|
44
44
|
return runs.flatMap((run) => memberOf(run, source) ?? []);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
/** 語のすぐ後ろの区切り(動作環境は、Windows と macOS)は一覧の始まりの前に置いた読点で、名前の区切りではない。 */
|
|
48
|
+
const afterLeadingJoiner = (tokens: readonly Token[], joiners: ReadonlySet<string>): readonly Token[] => {
|
|
49
|
+
const first = tokens[0];
|
|
50
|
+
return first !== undefined && first.pos === "PUNCT" && isJoiner(first, joiners) ? tokens.slice(1) : tokens;
|
|
51
|
+
};
|
|
52
|
+
|
|
47
53
|
/** 一覧の語の、一つの現れから読んだ名前。before の語は後ろの名前を、after の語は前の名前を読む。 */
|
|
48
54
|
const membersAt = (
|
|
49
55
|
tokens: readonly Token[],
|
|
@@ -54,7 +60,7 @@ const membersAt = (
|
|
|
54
60
|
): ListMember[] =>
|
|
55
61
|
entry.position === "after"
|
|
56
62
|
? namesInOrder(tokens.slice(0, range.start).toReversed(), joiners, source).toReversed()
|
|
57
|
-
: namesInOrder(tokens.slice(range.end), joiners, source);
|
|
63
|
+
: namesInOrder(afterLeadingJoiner(tokens.slice(range.end), joiners), joiners, source);
|
|
58
64
|
|
|
59
65
|
/** 一覧を読む言葉。frames は一覧を言う語、joiners は名前をつなぐ語、negations は打ち消しの語、ordinals は序数の語(小文字)。 */
|
|
60
66
|
export type ListWords = {
|
package/src/cli.ts
CHANGED
|
@@ -50,7 +50,8 @@ import { notRunAmong } from "./not-run.ts";
|
|
|
50
50
|
import { settingProblems } from "./setting-problems.ts";
|
|
51
51
|
import { withExtensions } from "./extension/load.ts";
|
|
52
52
|
import { offOnlyAsExperimental } from "./experimental-alone.ts";
|
|
53
|
-
import { levelFor } from "./run.ts";
|
|
53
|
+
import { genreStop, levelFor } from "./run.ts";
|
|
54
|
+
import { REASONS } from "./reasons.ts";
|
|
54
55
|
import { DEFAULT_GENRE } from "./init-choice.ts";
|
|
55
56
|
import { stoppingOnYamlFileError } from "./config/yaml-file.ts";
|
|
56
57
|
|
|
@@ -239,7 +240,8 @@ const explain = (config: Config, ruleId: string | undefined, genreFlag: string |
|
|
|
239
240
|
const preset = genre === undefined ? {} : presetLevels(genre);
|
|
240
241
|
const current = levelFor(rule, config.rules, config.experimental, preset);
|
|
241
242
|
const alone = offOnlyAsExperimental(rule, config, genre ?? DEFAULT_GENRE, preset, language);
|
|
242
|
-
|
|
243
|
+
const stop = genre === undefined ? undefined : genreStop(rule, config.rules, preset, genre, REASONS[uiLanguageOf(language)]);
|
|
244
|
+
console.log(renderExplain(rule, current, language, genre, { ...settingSourcesOf(config, rule.id, language), offOnlyAsExperimental: alone, genreStop: stop }));
|
|
243
245
|
return 0;
|
|
244
246
|
};
|
|
245
247
|
|
package/src/composite-signals.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import type { Finding } from "./plugin.ts";
|
|
1
|
+
import type { Finding, RuleDefinition } from "./plugin.ts";
|
|
2
|
+
import { localized } from "./render/text.ts";
|
|
3
|
+
|
|
4
|
+
/** The signals as a reader knows them: each rule's name in the language, its id where no rule of that id is loaded. */
|
|
5
|
+
export const signalNames = (ids: readonly string[], rules: readonly Pick<RuleDefinition, "id" | "name">[], language: string): string[] =>
|
|
6
|
+
ids.map((id) => {
|
|
7
|
+
const name = rules.find((rule) => rule.id === id)?.name;
|
|
8
|
+
const words = name === undefined ? "" : localized(name, language);
|
|
9
|
+
return words === "" ? id : words;
|
|
10
|
+
});
|
|
2
11
|
|
|
3
12
|
/** A finding that adds up measures names here the rules that read the same shapes as some of them (ai-structure). */
|
|
4
13
|
export const SAME_SHAPE_VALUE = "same_shape_rules";
|
|
@@ -101,8 +101,8 @@ const TRADEMARKED = new RegExp(String.raw`${EDGE_BEFORE}\p{Lu}{2,}(?=[®™])`,
|
|
|
101
101
|
export const trademarkSpans = (text: string): Span[] => spansOf(text, TRADEMARKED);
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
* 引用の形の中の、法令の名前(45 CFR Parts 160、CFR §164.524、21 USC §301、44 USC. 3502、22 CCR §§ 12701、94/820/EC
|
|
105
|
-
*
|
|
104
|
+
* 引用の形の中の、法令の名前(45 CFR Parts 160、CFR §164.524、21 USC §301、44 USC. 3502、22 CCR §§ 12701、94/820/EC、FAR section 12.212)。
|
|
105
|
+
* 後ろに条(§、Part、section、番号)があるか、/ で繋いだ番号の後ろのときだけ。名前の後ろの点(USC.)は略しの印で、条の前に書いてもよい。§ の前には大文字で始まる
|
|
106
106
|
* 1 語を挟んでもよい(15 USCA Appendix § 12)。巻の番号の後ろで点で終わる名前(See 44 USC. 3502)も引用で、文を分ける読み手は
|
|
107
107
|
* 点の後ろの条を次の文に送る。法令集そのものを言う所(the CFR title、the 2 CFR export)は略語のまま数える。
|
|
108
108
|
*/
|
|
@@ -112,7 +112,10 @@ export const citationSpans = (text: string, series: readonly string[]): Span[] =
|
|
|
112
112
|
const section = String.raw`(?:\p{Lu}\p{L}*\.?[ \t]+)?§`;
|
|
113
113
|
return spansOf(
|
|
114
114
|
text,
|
|
115
|
-
new RegExp(
|
|
115
|
+
new RegExp(
|
|
116
|
+
String.raw`(?<=\d/)${name}${EDGE_AFTER}|${EDGE_BEFORE}${name}(?=\.?[ \t]*(?:${section}|(?:[Pp]arts?|[Ss]ections?)[ \t]+\d|\d))|(?<=\d[ \t]+)${name}(?=\.)`,
|
|
117
|
+
"gu",
|
|
118
|
+
),
|
|
116
119
|
);
|
|
117
120
|
};
|
|
118
121
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Detector, Finding, Sentence, Token } from "../plugin.ts";
|
|
1
|
+
import type { Detector, Finding, Lexicon, Sentence, Token } from "../plugin.ts";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 受動のまま動作主を書かないと、誰がしたのかが文から消える。
|
|
@@ -11,13 +11,57 @@ import type { Detector, Finding, Sentence, Token } from "../plugin.ts";
|
|
|
11
11
|
*/
|
|
12
12
|
const isPassive = (token: Token): boolean => token.features?.["Voice"] === "Pass";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** 起点の語(から)と、数のすぐ後ろで時を言う単位(月、時)。どちらも語彙表の group で受け取る。 */
|
|
15
|
+
const SOURCE_GROUP = "source";
|
|
16
|
+
const TIME_GROUP = "time";
|
|
17
|
+
|
|
18
|
+
type AgentWords = { readonly markers: readonly string[]; readonly sources: readonly string[]; readonly timeUnits: readonly string[] };
|
|
19
|
+
|
|
20
|
+
const patternsOf = (lexicon: Lexicon, group: string | undefined): string[] => lexicon.filter((entry) => entry.group === group).map((entry) => entry.pattern);
|
|
21
|
+
|
|
22
|
+
const agentWordsOf = (lexicon: Lexicon): AgentWords => ({
|
|
23
|
+
markers: patternsOf(lexicon, undefined),
|
|
24
|
+
sources: patternsOf(lexicon, SOURCE_GROUP),
|
|
25
|
+
timeUnits: patternsOf(lexicon, TIME_GROUP),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** 時の語: 副詞のように使う名詞(来月、本日)か、数のすぐ後ろの時の単位(4月、10時)。 */
|
|
29
|
+
const isTime = (tokens: readonly Token[], at: number, timeUnits: readonly string[]): boolean => {
|
|
30
|
+
const token = tokens[at];
|
|
31
|
+
if (token === undefined) return false;
|
|
32
|
+
if (token.features?.["Adverbial"] === "Yes") return true;
|
|
33
|
+
return timeUnits.includes(token.surface) && tokens[at - 1]?.features?.["NumType"] === "Card";
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** 起点の語のうち、すぐ前が時の語でないもの(部長から)。来月から、4月1日からは時の起点で、した人を言わない。 */
|
|
37
|
+
const namesSource = (tokens: readonly Token[], { sources, timeUnits }: AgentWords): boolean =>
|
|
38
|
+
tokens.some((token, at) => sources.includes(token.surface) && at > 0 && !isTime(tokens, at - 1, timeUnits));
|
|
39
|
+
|
|
40
|
+
const hasAgent = (sentence: Sentence, words: AgentWords): boolean =>
|
|
41
|
+
words.markers.some((marker) => sentence.text.includes(marker)) || namesSource(sentence.tokens ?? [], words);
|
|
42
|
+
|
|
43
|
+
const isLightVerb = (token: Token | undefined): boolean => token?.pos === "VERB" && token.features?.["VerbType"] === "Light";
|
|
44
|
+
const isVerbalNoun = (token: Token | undefined): boolean => token?.pos === "NOUN" && token.features?.["VerbForm"] === "Vnoun";
|
|
45
|
+
const touches = (left: Token | undefined, right: Token | undefined): boolean => left !== undefined && right !== undefined && left.span.end === right.span.start;
|
|
46
|
+
|
|
47
|
+
/** 受け身の印のすぐ前に続けて書いた動詞の始まり(送ら れ、決定 さ れ)。印が動詞そのもの(reviewed)なら印の位置。 */
|
|
48
|
+
const verbStart = (tokens: readonly Token[], at: number): number => {
|
|
49
|
+
const before = tokens[at - 1];
|
|
50
|
+
if (!touches(before, tokens[at]) || before?.pos !== "VERB") return at;
|
|
51
|
+
return isLightVerb(before) && isVerbalNoun(tokens[at - 2]) && touches(tokens[at - 2], before) ? at - 2 : at - 1;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** 指摘が引く受け身の語。印だけ(れ)では読み手に何の受け身かが分からないので、動詞から引く(決定され)。 */
|
|
55
|
+
const passiveVerb = (source: string, tokens: readonly Token[], passive: Token): string => {
|
|
56
|
+
const start = tokens[verbStart(tokens, tokens.indexOf(passive))]?.span.start ?? passive.span.start;
|
|
57
|
+
return source.slice(start, passive.span.end);
|
|
58
|
+
};
|
|
15
59
|
|
|
16
60
|
export const agentlessPassive: Detector = (doc, options): Finding[] => {
|
|
17
|
-
const
|
|
61
|
+
const words = agentWordsOf(options.lexicon ?? []);
|
|
18
62
|
return doc.sentences
|
|
19
63
|
.map((sentence) => ({ sentence, passives: (sentence.tokens ?? []).filter(isPassive) }))
|
|
20
|
-
.filter(({ sentence, passives }) => passives.length >= options.limit && !hasAgent(sentence,
|
|
64
|
+
.filter(({ sentence, passives }) => passives.length >= options.limit && !hasAgent(sentence, words))
|
|
21
65
|
.map(({ sentence, passives }) => ({
|
|
22
66
|
rule: "agentless-passive",
|
|
23
67
|
severity: "warning",
|
|
@@ -27,7 +71,7 @@ export const agentlessPassive: Detector = (doc, options): Finding[] => {
|
|
|
27
71
|
values: {
|
|
28
72
|
count: passives.length,
|
|
29
73
|
limit: options.limit,
|
|
30
|
-
word: passives.map((token) => token
|
|
74
|
+
word: passives.map((token) => passiveVerb(doc.source, sentence.tokens ?? [], token)).join(" "),
|
|
31
75
|
offset: passives[0]?.span.start ?? sentence.span.start,
|
|
32
76
|
},
|
|
33
77
|
}));
|
|
@@ -26,6 +26,8 @@ export type AgreementLists = {
|
|
|
26
26
|
readonly afterArticle: ReadonlySet<string>;
|
|
27
27
|
/** 名詞句を目的語に取る前置詞(on / of)。この後ろの this / these は主語にならない。 */
|
|
28
28
|
readonly prepositions?: ReadonlySet<string>;
|
|
29
|
+
/** homophone-slip が言う組(their are)。その規則が正しい語まで言うので、ここでは数えない。 */
|
|
30
|
+
readonly homophones?: ReadonlySet<string>;
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export type Slip = { readonly variant: "number" | "possessive" | "determiner"; readonly first: Token; readonly last: Token; readonly word: string };
|
|
@@ -42,6 +44,8 @@ const CLOSING_MARK = new Set([".", ";", ":", "?", "!", ")"]);
|
|
|
42
44
|
*/
|
|
43
45
|
const PHRASE_END = new Set(["AUX", "ADP", "SCONJ", "PRON", "DET", "ADV"]);
|
|
44
46
|
const PREDICATE_TAIL = new Set(["DET", "ADJ", "PRON", "NUM"]);
|
|
47
|
+
/** 所有の印('s / ')。不変化詞のうち、これだけが名詞を重ねた語の途中(a children's book)。to や not は名詞句の外。 */
|
|
48
|
+
const POSSESSIVE_MARK = /^['’]/u;
|
|
45
49
|
|
|
46
50
|
const lower = (token: Token): string => token.surface.toLowerCase();
|
|
47
51
|
|
|
@@ -54,6 +58,7 @@ const isPlural = (token: Token): boolean => token.features?.["Number"] === "Plur
|
|
|
54
58
|
/** 名詞の後ろの語で、名詞句が終わるか。分詞(a data driven approach)も名詞を重ねた語の途中。 */
|
|
55
59
|
export const endsNounPhrase = (next: Token | undefined, finite: ReadonlySet<string>): boolean => {
|
|
56
60
|
if (next === undefined || finite.has(lower(next))) return true;
|
|
61
|
+
if (next.pos === "PART") return !POSSESSIVE_MARK.test(next.surface);
|
|
57
62
|
return next.pos === "PUNCT" ? CLOSING_MARK.has(next.surface) : PHRASE_END.has(next.pos);
|
|
58
63
|
};
|
|
59
64
|
|
|
@@ -128,7 +133,8 @@ const mayBeNoun = (token: Token): boolean => token.features?.["AlsoNoun"] === "Y
|
|
|
128
133
|
/**
|
|
129
134
|
* 名詞が動詞にも読め(works)、その前に名詞句の頭になれる語があれば、限定詞と名詞ではなく主語と動詞かもしれない。
|
|
130
135
|
* an individual works(individual は名詞にもなる)/ Those responsible report to the board(those は代名詞にもなる)。
|
|
131
|
-
* 後ろが is / has なら、名詞は動詞ではない(these key result is
|
|
136
|
+
* 後ろが is / has なら、名詞は動詞ではない(these key result is)。後ろが to なら、解析器が動詞と知らない語も動詞かもしれない
|
|
137
|
+
* (every key maps to an array の maps)。
|
|
132
138
|
*/
|
|
133
139
|
const mayBeVerb = (
|
|
134
140
|
determiner: Determiner,
|
|
@@ -138,7 +144,7 @@ const mayBeVerb = (
|
|
|
138
144
|
finite: ReadonlySet<string>,
|
|
139
145
|
bound: boolean,
|
|
140
146
|
): boolean =>
|
|
141
|
-
noun.features?.["AlsoVerb"] === "Yes" &&
|
|
147
|
+
(noun.features?.["AlsoVerb"] === "Yes" || next?.pos === "PART") &&
|
|
142
148
|
!(next !== undefined && finite.has(lower(next))) &&
|
|
143
149
|
((standsAlone(determiner) && !bound) || modifiers.some(mayBeNoun));
|
|
144
150
|
|
|
@@ -188,7 +194,8 @@ const possessiveSlipAt = (source: string, tokens: readonly Token[], at: number,
|
|
|
188
194
|
const auxiliary = verb.pos === "AUX" && isBaseVerb(tokens[at + 2]) && !isNounAfterPreposition(tokens, at);
|
|
189
195
|
const verbal = LOWER.test(verb.surface) && (lists.finite.has(lower(verb)) || auxiliary);
|
|
190
196
|
if (!verbal || !joinedBySpace(source, [possessive, verb]) || isPartOfLongerWord(source, possessive, verb)) return undefined;
|
|
191
|
-
|
|
197
|
+
const slip = slipOf("possessive", source, possessive, verb);
|
|
198
|
+
return lists.homophones?.has(slip.word.toLowerCase()) === true ? undefined : slip;
|
|
192
199
|
};
|
|
193
200
|
|
|
194
201
|
/** ones of the most。前に限定詞・形容詞・代名詞があれば、ones は代名詞(the ones of the most use)。 */
|
|
@@ -236,6 +243,7 @@ const listsOf = (lexicons: Readonly<Record<string, Lexicon>>): AgreementLists =>
|
|
|
236
243
|
misnumbered: lexicons["misnumbered-phrase"] ?? [],
|
|
237
244
|
afterArticle: setOf(lexicons["determiner-after-article"]),
|
|
238
245
|
prepositions: setOf(lexicons["object-preposition"]),
|
|
246
|
+
homophones: setOf(lexicons["homophone-slip"]),
|
|
239
247
|
});
|
|
240
248
|
|
|
241
249
|
export const agreementSlip: Detector = (doc): Finding[] => {
|
|
@@ -4,7 +4,7 @@ import type { Detector, Finding, Lexicon, ProseDocument } from "../plugin.ts";
|
|
|
4
4
|
import { escapeRegExp } from "../orthography.ts";
|
|
5
5
|
import { amountValue, scaleMixes, withoutRoundTextFigures, type ScaleWord, type ScaledAmount } from "../structure/amount-scale.ts";
|
|
6
6
|
import { AMOUNT, amountsIn, formsOf, type WrittenAmount } from "./currency-notation.ts";
|
|
7
|
-
import { quoteAround } from "./quote-around.ts";
|
|
7
|
+
import { quoteAround, sentenceQuoteAt } from "./quote-around.ts";
|
|
8
8
|
import { proseAndTablesOf } from "../table-text.ts";
|
|
9
9
|
|
|
10
10
|
/** How far back a larger part of one amount may start (1億2,000万円 is read from 2,000万円). */
|
|
@@ -90,7 +90,7 @@ export const amountScale: Detector = (doc): Finding[] => {
|
|
|
90
90
|
severity: "info",
|
|
91
91
|
line: 0,
|
|
92
92
|
column: 0,
|
|
93
|
-
quote: quoteAround(text, odd.offset, odd.offset + odd.written.length),
|
|
93
|
+
quote: sentenceQuoteAt(doc.sentences, odd.offset) ?? quoteAround(text, odd.offset, odd.offset + odd.written.length),
|
|
94
94
|
values: { written: odd.written.trim(), usual: usual.written.trim(), offset: odd.offset },
|
|
95
95
|
}));
|
|
96
96
|
};
|
|
@@ -6,8 +6,10 @@ import { leadingPrefix, trailingTitle, type AddresseeWords } from "./addressee-t
|
|
|
6
6
|
import {
|
|
7
7
|
followsForm,
|
|
8
8
|
followsUnit,
|
|
9
|
+
fillsGloss,
|
|
9
10
|
holdsName,
|
|
10
11
|
isListItem,
|
|
12
|
+
labelsLines,
|
|
11
13
|
leadingDate,
|
|
12
14
|
leadingOrdinal,
|
|
13
15
|
leadingReference,
|
|
@@ -45,6 +47,8 @@ type KanjiRun = {
|
|
|
45
47
|
readonly text: string;
|
|
46
48
|
readonly span: Span | undefined;
|
|
47
49
|
readonly quoted: boolean;
|
|
50
|
+
/** 連なりが、下に番号や内容の行が続く一行の名前(labelsLines: 児童相談所虐待対応ダイヤル / 189)。 */
|
|
51
|
+
readonly label: boolean;
|
|
48
52
|
readonly placed: boolean;
|
|
49
53
|
readonly after: string | undefined;
|
|
50
54
|
readonly before: string;
|
|
@@ -78,7 +82,7 @@ const maskedProse = (prose: string, profile: DocumentProfile | undefined, names:
|
|
|
78
82
|
* 括弧でくくった名前は、書き手が 1 つの名前として示したもの(「登録業者情報検索入力ページ」)。
|
|
79
83
|
*/
|
|
80
84
|
const fillsQuote = (sentence: Sentence, start: number, end: number): boolean =>
|
|
81
|
-
quotedSpans(sentence.text, NAME_MARKS).some((span) => holdsName(sentence.text, span, start, end));
|
|
85
|
+
quotedSpans(sentence.text, NAME_MARKS).some((span) => holdsName(sentence.text, span, start, end)) || fillsGloss(sentence.text, start, end);
|
|
82
86
|
|
|
83
87
|
const runsOf = (sentence: Sentence, profile: DocumentProfile | undefined, names: readonly string[]): KanjiRun[] => {
|
|
84
88
|
const prose = proseText(sentence);
|
|
@@ -92,6 +96,7 @@ const runsOf = (sentence: Sentence, profile: DocumentProfile | undefined, names:
|
|
|
92
96
|
text: match[0],
|
|
93
97
|
span: undefined,
|
|
94
98
|
quoted: false,
|
|
99
|
+
label: false,
|
|
95
100
|
placed: false,
|
|
96
101
|
after: undefined,
|
|
97
102
|
before: "",
|
|
@@ -112,6 +117,7 @@ const runsOf = (sentence: Sentence, profile: DocumentProfile | undefined, names:
|
|
|
112
117
|
text: match[0],
|
|
113
118
|
span,
|
|
114
119
|
quoted,
|
|
120
|
+
label: labelsLines(sentence.text, start, last + 1),
|
|
115
121
|
placed: isTitlePosition(sentence.text, start, last + 1),
|
|
116
122
|
after,
|
|
117
123
|
before: sentence.text.slice(0, start),
|
|
@@ -251,13 +257,17 @@ const measuredOf = (tokens: readonly Token[], run: KanjiRun, span: Span, words:
|
|
|
251
257
|
return { rest: { start: head?.span.end ?? span.start, end: tail?.start ?? span.end }, text: name.slice(head?.surface.length ?? 0), keptHead };
|
|
252
258
|
};
|
|
253
259
|
|
|
260
|
+
/** 書き手が名前として示した連なり(括弧でくくった、一行に置いた、用語集の見出し語、文脈で名前と分かる)。 */
|
|
261
|
+
const isPresentedName = (run: KanjiRun, context: RunContext): boolean =>
|
|
262
|
+
run.quoted || run.label || (context.headwords && run.alone) || isNamedByContext(run, context.words);
|
|
263
|
+
|
|
254
264
|
/**
|
|
255
265
|
* 数えない連なりは空。頭の、数に付いた助数詞(2日日本弁護士連合会の「日」)と、尻の、数に付く接頭の語(施行令第172条の「第」)と
|
|
256
266
|
* 宛先に付く語(市政情報課宛ての「宛」)は数えない。宛名の「各」と、宛名の行の役職(各国公私立高等専門学校長の「各」と「長」)も数えない。
|
|
257
267
|
* 住所か名前かは、それを外した残りで決める(1日日本銀行の「日本銀行」)。品詞が無ければ判定しない。
|
|
258
268
|
*/
|
|
259
269
|
const measuredRun = (tokens: readonly Token[] | undefined, run: KanjiRun, context: RunContext): string => {
|
|
260
|
-
if (
|
|
270
|
+
if (isPresentedName(run, context)) return "";
|
|
261
271
|
if (tokens === undefined || run.span === undefined) return run.text;
|
|
262
272
|
const { rest, text, keptHead } = measuredOf(tokens, run, run.span, context.words);
|
|
263
273
|
if (context.presented.has(text) || inStatuteTitle(tokens, run.brackets, context.words.fixedName)) return "";
|
|
@@ -340,6 +350,10 @@ const statuteTerms = (runs: readonly DocumentRun[], fixedName: TitleWords, max:
|
|
|
340
350
|
return terms.filter((term) => [...term].length >= MIN_TERM_LENGTH && [...term].length <= max);
|
|
341
351
|
});
|
|
342
352
|
|
|
353
|
+
/** 文書が一行の名前として置いた連なり(labelsLines)のうち MIN_TERM_LENGTH 字からのもの。文の中の連なり(〜相談電話窓口)を、その名前の後ろで割る。 */
|
|
354
|
+
const labelNames = (runs: readonly DocumentRun[]): string[] =>
|
|
355
|
+
runs.flatMap(({ run }) => (run.label && [...run.text].length >= MIN_TERM_LENGTH ? [run.text] : []));
|
|
356
|
+
|
|
343
357
|
/** 文書の genre が、rule の headword_genres(見出し語の行を数えない genre: 用語集)にあるか。 */
|
|
344
358
|
const isHeadwordGenre = (options: DetectorOptions): boolean => {
|
|
345
359
|
const genres = options.settings?.["headword_genres"];
|
|
@@ -384,8 +398,9 @@ const contextOf = (doc: ProseDocument, options: DetectorOptions): RunContext =>
|
|
|
384
398
|
terms: new Set([
|
|
385
399
|
...standaloneNames([...inSentences, ...headingRuns(doc)], MIN_TERM_LENGTH, options.limit, words.organisation.units),
|
|
386
400
|
...statuteTerms(runs, words.fixedName, options.limit),
|
|
401
|
+
...labelNames(runs),
|
|
387
402
|
]),
|
|
388
|
-
presented: new Set(runs.flatMap(({ run }) => (run.quoted ? [run.text] : []))),
|
|
403
|
+
presented: new Set(runs.flatMap(({ run }) => (run.quoted || run.label ? [run.text] : []))),
|
|
389
404
|
headwords: isHeadwordGenre(options),
|
|
390
405
|
maxKnownWords: Math.max(options.limit, ...[...words.knownWords].map((word) => [...word].length)),
|
|
391
406
|
};
|