chaffjs 0.36.0 → 0.37.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/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +10 -3
- package/dist/detectors/acronym-expansion.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/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/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +37 -14
- package/dist/detectors/char-shape.js.map +1 -1
- 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/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/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/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +9 -4
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/document-shape.d.ts +5 -0
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +15 -1
- package/dist/detectors/document-shape.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 +9 -2
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +39 -8
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +7 -1
- package/dist/detectors/fullwidth-alnum.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-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/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +7 -0
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +5 -2
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/mark-shape.d.ts +3 -1
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +20 -5
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +6 -0
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/organisation-run.d.ts +0 -6
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +4 -1
- 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 +33 -4
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +4 -2
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +33 -3
- package/dist/detectors/oxford-comma.js.map +1 -1
- 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/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/sentence-counts.d.ts +10 -2
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +34 -4
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-length.d.ts.map +1 -1
- package/dist/detectors/sentence-length.js +13 -4
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +15 -3
- package/dist/detectors/signals.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/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +3 -1
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/undefined-term.d.ts.map +1 -1
- package/dist/detectors/undefined-term.js +5 -0
- package/dist/detectors/undefined-term.js.map +1 -1
- package/dist/detectors/unknown-word.d.ts +4 -1
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +1 -1
- package/dist/detectors/unknown-word.js.map +1 -1
- 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/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/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/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/sentence-load.d.ts +2 -1
- package/dist/sentence-load.d.ts.map +1 -1
- package/dist/sentence-load.js +11 -3
- package/dist/sentence-load.js.map +1 -1
- 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/definition-use.d.ts +5 -2
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +24 -7
- 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/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/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 +87 -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/package.json +3 -3
- package/rules/adversative-ga-repeat.yaml +1 -0
- package/rules/all-caps-shouting.yaml +2 -2
- package/rules/bare-url-mix.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +1 -0
- package/rules/contraction-consistency.yaml +2 -2
- package/rules/duplicate-definition.yaml +2 -2
- package/rules/duplicate-heading.yaml +2 -2
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/kutoten-consistency.yaml +2 -2
- package/rules/latin-spacing.yaml +2 -2
- package/rules/max-kanji-continuous.yaml +1 -1
- package/rules/max-sentence-length.yaml +2 -2
- package/rules/ngram-repetition.yaml +2 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/oxford-comma-consistency.yaml +2 -2
- package/rules/preamble-length.yaml +3 -2
- package/rules/range-notation-consistency.yaml +2 -2
- package/rules/requirement-smell.yaml +2 -2
- package/rules/title-length.yaml +2 -2
- package/rules/topic-predicate-distance.yaml +2 -2
- package/rules/undefined-acronym.yaml +3 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unqualified-superlative.yaml +1 -1
- package/rules/unused-definition.yaml +2 -2
- package/rules/use-before-definition.yaml +2 -2
- package/src/detectors/acronym-expansion.ts +10 -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/capitalised-term.ts +26 -2
- package/src/detectors/caps-caption.ts +43 -9
- package/src/detectors/char-shape.ts +55 -17
- package/src/detectors/citation-sentence.ts +44 -0
- package/src/detectors/contraction-mention.ts +24 -0
- package/src/detectors/dash-break.ts +45 -0
- package/src/detectors/date-any-year.ts +7 -3
- package/src/detectors/definition-use.ts +12 -8
- package/src/detectors/document-shape.ts +20 -1
- package/src/detectors/duplicate-heading.ts +26 -3
- package/src/detectors/email-letter.ts +50 -7
- package/src/detectors/fullwidth-alnum.ts +9 -1
- package/src/detectors/gram-openers.ts +36 -7
- package/src/detectors/heading-record-rhythm.ts +57 -0
- package/src/detectors/kutoten-consistency.ts +9 -0
- package/src/detectors/lexicon.ts +6 -2
- package/src/detectors/mark-shape.ts +30 -5
- package/src/detectors/name-variant.ts +6 -0
- package/src/detectors/organisation-run.ts +6 -1
- package/src/detectors/orthographic-variant.ts +45 -6
- package/src/detectors/orthography.ts +6 -2
- package/src/detectors/oxford-comma.ts +35 -3
- package/src/detectors/range-notation.ts +26 -6
- package/src/detectors/requirement-smell.ts +12 -8
- package/src/detectors/sentence-counts.ts +40 -4
- package/src/detectors/sentence-length.ts +17 -4
- package/src/detectors/signals.ts +18 -3
- package/src/detectors/superlative-name.ts +10 -0
- package/src/detectors/token-shape.ts +3 -1
- package/src/detectors/undefined-term.ts +8 -0
- package/src/detectors/unknown-word.ts +1 -1
- package/src/html/html-site-chrome.ts +70 -13
- package/src/latin-word-boundary.ts +18 -0
- package/src/leading-label.ts +15 -0
- package/src/link-shape.ts +15 -3
- package/src/name-misspelt-usual.ts +25 -0
- package/src/notice-header.ts +57 -0
- package/src/sentence-load.ts +14 -3
- package/src/structure/attached-parts.ts +24 -9
- package/src/structure/definition-use.ts +33 -7
- package/src/structure/gerund-phrase.ts +31 -0
- package/src/structure/universal.ts +22 -7
- package/src/title-line.ts +2 -1
- package/src/topic-clause.ts +109 -0
- package/src/uncounted-particles.ts +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gerund-phrase.js","sourceRoot":"","sources":["../../src/structure/gerund-phrase.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,gGAAgG;AAEhG,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAC9C,sFAAsF;AACtF,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAEzC,wGAAwG;AACxG,MAAM,OAAO,GAAG,CAAC,IAAY,EAAY,EAAE;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,IAAI,IAAI,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,IAAI,IAAI,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9I,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAE/F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,WAAgC,EAAY,EAAE;IACtF,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAAE,OAAO,EAAE,CAAC;IACrG,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,OAAO,CAAC,IAAI,CAAC;SACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAC9F,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAChD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { NumberedLine, NumberingContext, StructurePatterns } from "../plugin.ts";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* closedByDot: 番号を点で閉じたか(「5. 」)。「1.5 万人」の 1.5 は閉じていない。wideGap: 番号と題の間に全角の空白を置いたか
|
|
4
|
+
* (「9(全角空白)年間収入階級」)。どちらも番号の札の書き方で、数量はそう書かない。
|
|
5
|
+
*/
|
|
3
6
|
type DottedLine = NumberedLine & {
|
|
4
7
|
readonly closedByDot: boolean;
|
|
8
|
+
readonly wideGap: boolean;
|
|
5
9
|
};
|
|
6
10
|
/**
|
|
7
11
|
* 本文の「1. 」は箇条書きで、見出しの「1. 」は章番号。点を含まない番号は、見出しの行か、テキストの章見出しの形でだけ読む。
|
|
@@ -9,8 +13,8 @@ type DottedLine = NumberedLine & {
|
|
|
9
13
|
*/
|
|
10
14
|
export declare const dottedNumber: (line: string, context: NumberingContext, plainText?: boolean) => DottedLine | undefined;
|
|
11
15
|
/**
|
|
12
|
-
* 番号の後ろが単位なら数量(「1.5 万人」「2.5 days」)。点で閉じた番号(「5. ページ自身の通信」「2. Days off
|
|
13
|
-
*
|
|
16
|
+
* 番号の後ろが単位なら数量(「1.5 万人」「2.5 days」)。点で閉じた番号(「5. ページ自身の通信」「2. Days off」)と、全角の空白を
|
|
17
|
+
* 置いた番号(「9(全角空白)年間収入階級」)は札で、数量はそう書かないので、後ろに単位の語が来ても数量にしない。
|
|
14
18
|
*/
|
|
15
19
|
export declare const isAmount: (dotted: DottedLine, countedAfter: StructurePatterns["countedAfter"]) => boolean;
|
|
16
20
|
/** 番号が年まで書いた日付の頭(「8 December 2022」の 8)か。日付を言語の dates が読む。年表の見出しの日は番号の並びではない。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal.d.ts","sourceRoot":"","sources":["../../src/structure/universal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA4BtF
|
|
1
|
+
{"version":3,"file":"universal.d.ts","sourceRoot":"","sources":["../../src/structure/universal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA4BtF;;;GAGG;AACH,KAAK,UAAU,GAAG,YAAY,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,SAAS,gBAAgB,EAAE,mBAAiB,KAAG,UAAU,GAAG,SAqBtG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ,UAAU,EAAE,cAAc,iBAAiB,CAAC,cAAc,CAAC,KAAG,OACA,CAAC;AAKhG,gFAAgF;AAChF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,OAAO,iBAAiB,CAAC,OAAO,CAAC,KAAG,OAG5E,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,eAAe,GAAI,UAAU,iBAAiB,EAAE,MAAM,MAAM,EAAE,SAAS,gBAAgB,EAAE,WAAW,OAAO,KAAG,YAAY,GAAG,SAKzI,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { numberInSentence } from "./number-in-sentence.js";
|
|
|
3
3
|
* 「4.2 設定」「3.1.4 Scope」のような通し番号。数字と点だけで書くので言語を問わない。
|
|
4
4
|
* 各部分を 3 桁・深さを 6 までに抑え、後戻りが爆発しない形にしてある。
|
|
5
5
|
*/
|
|
6
|
-
const DOTTED = /^[ \t]{0,3}(?<number>\d{1,3}(?:\.\d{1,3}){0,5})(?<closing>[..])?[ \t\u3000]+(?<rest>\S.*)$/u;
|
|
6
|
+
const DOTTED = /^[ \t]{0,3}(?<number>\d{1,3}(?:\.\d{1,3}){0,5})(?<closing>[..])?(?<gap>[ \t\u3000]+)(?<rest>\S.*)$/u;
|
|
7
7
|
/**
|
|
8
8
|
* 見出しで、点で閉じた番号に題を詰めて書いたもの(「7.委託」「7.委託」「2.Overview」)。後ろが数字なら小数(「1.5万人」)、
|
|
9
9
|
* 小文字なら版(「2.x 系」)なので読まない。
|
|
@@ -33,13 +33,25 @@ export const dottedNumber = (line, context, plainText = false) => {
|
|
|
33
33
|
if (depth < 2 && !context.isHeading && !(plainText && isTopSection(line, rest)))
|
|
34
34
|
return undefined;
|
|
35
35
|
const closedByDot = groups?.["closing"] !== undefined;
|
|
36
|
-
|
|
36
|
+
const wideGap = groups?.["gap"]?.includes("\u3000") === true;
|
|
37
|
+
return {
|
|
38
|
+
kind: "article",
|
|
39
|
+
depth,
|
|
40
|
+
number,
|
|
41
|
+
absolute: true,
|
|
42
|
+
label: number,
|
|
43
|
+
heading: rest,
|
|
44
|
+
rest,
|
|
45
|
+
ordinal: Number(number.split(".").at(-1)),
|
|
46
|
+
closedByDot,
|
|
47
|
+
wideGap,
|
|
48
|
+
};
|
|
37
49
|
};
|
|
38
50
|
/**
|
|
39
|
-
* 番号の後ろが単位なら数量(「1.5 万人」「2.5 days」)。点で閉じた番号(「5. ページ自身の通信」「2. Days off
|
|
40
|
-
*
|
|
51
|
+
* 番号の後ろが単位なら数量(「1.5 万人」「2.5 days」)。点で閉じた番号(「5. ページ自身の通信」「2. Days off」)と、全角の空白を
|
|
52
|
+
* 置いた番号(「9(全角空白)年間収入階級」)は札で、数量はそう書かないので、後ろに単位の語が来ても数量にしない。
|
|
41
53
|
*/
|
|
42
|
-
export const isAmount = (dotted, countedAfter) => !dotted.closedByDot && countedAfter?.(dotted.number, dotted.rest) === true;
|
|
54
|
+
export const isAmount = (dotted, countedAfter) => !dotted.closedByDot && !dotted.wideGap && countedAfter?.(dotted.number, dotted.rest) === true;
|
|
43
55
|
/** 年まで書いた日付の値(2022-12-08)。年の無い「2 May」は、番号 2 の題「May」とも読める。 */
|
|
44
56
|
const WITH_YEAR = /^\d{4}-/u;
|
|
45
57
|
/** 番号が年まで書いた日付の頭(「8 December 2022」の 8)か。日付を言語の dates が読む。年表の見出しの日は番号の並びではない。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal.js","sourceRoot":"","sources":["../../src/structure/universal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,C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C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACtI,CAAC,CAAC;AAEF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA2B,EAAE,IAAY,EAAE,OAAyB,EAAE,SAAkB,EAA4B,EAAE;IACpJ,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACtD,IAAI,MAAM,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1H,MAAM,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IAC5F,OAAO,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACrF,CAAC,CAAC"}
|
package/dist/title-line.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export type TitleNotion = {
|
|
|
13
13
|
*/
|
|
14
14
|
readonly edge: "any-whitespace" | "blank-line";
|
|
15
15
|
};
|
|
16
|
+
/** rest, the words after a label and its number, are a short title by notion's measure. */
|
|
17
|
+
export declare const isShortTitle: (rest: string, notion: TitleNotion) => boolean;
|
|
16
18
|
/**
|
|
17
19
|
* The line from lineStart to lineEnd (-1: the last line) is a title: rest, the words after its label and number, are a
|
|
18
20
|
* short title, and a blank line or the document's edge is on both sides.
|
package/dist/title-line.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title-line.d.ts","sourceRoot":"","sources":["../src/title-line.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,qHAAqH;IACrH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,4HAA4H;IAC5H,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAAC;CAChD,CAAC;
|
|
1
|
+
{"version":3,"file":"title-line.d.ts","sourceRoot":"","sources":["../src/title-line.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,qHAAqH;IACrH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,4HAA4H;IAC5H,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAAC;CAChD,CAAC;AAWF,2FAA2F;AAC3F,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,QAAQ,WAAW,KAAG,OAQhE,CAAC;AAQF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,EAAE,SAAS,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,WAAW,KAAG,OAG7B,CAAC"}
|
package/dist/title-line.js
CHANGED
|
@@ -8,7 +8,8 @@ const BLANK_LINE = /\n[ \t\r]*\n[ \t\r]*$/u;
|
|
|
8
8
|
const ENDS_LINE = /^[ \t\r]*\n/u;
|
|
9
9
|
const BLANK = /^[ \t\r]*$/u;
|
|
10
10
|
const LOWER_START = /^\p{Ll}/u;
|
|
11
|
-
|
|
11
|
+
/** rest, the words after a label and its number, are a short title by notion's measure. */
|
|
12
|
+
export const isShortTitle = (rest, notion) => {
|
|
12
13
|
const title = rest.trim();
|
|
13
14
|
const words = title.split(/\s+/u).filter((word) => word !== "");
|
|
14
15
|
return (words.length <= TITLE_MAX_WORDS &&
|
package/dist/title-line.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title-line.js","sourceRoot":"","sources":["../src/title-line.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,6EAA6E;AAkB7E,uEAAuE;AACvE,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,wFAAwF;AACxF,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,KAAK,GAAG,aAAa,CAAC;AAC5B,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,MAAmB,EAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"title-line.js","sourceRoot":"","sources":["../src/title-line.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,6EAA6E;AAkB7E,uEAAuE;AACvE,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,wFAAwF;AACxF,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,KAAK,GAAG,aAAa,CAAC;AAC5B,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,MAAmB,EAAW,EAAE;IACzE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,I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O,GAAG,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Token } from "./plugin.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The index of the word that ends the topic's own clause, between the topic and the sentence's last word, or undefined when the
|
|
4
|
+
* topic's predicate is the one the sentence ends on.
|
|
5
|
+
*/
|
|
6
|
+
export declare const topicClauseEnd: (tokens: readonly Token[], topic: number, last: number) => number | undefined;
|
|
7
|
+
//# sourceMappingURL=topic-clause.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-clause.d.ts","sourceRoot":"","sources":["../src/topic-clause.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAkGzC;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,SAI/F,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const COMMA = new Set(["、", ","]);
|
|
2
|
+
const NOMINAL = new Set(["NOUN", "PRON", "PROPN"]);
|
|
3
|
+
const PREDICATE = new Set(["VERB", "AUX", "ADJ", "SCONJ"]);
|
|
4
|
+
/** The nouns a restrictive であって leads to: 失業者であって、支援の必要がある者. */
|
|
5
|
+
const RESTRICTED_HEADS = new Set(["者", "もの", "物", "方"]);
|
|
6
|
+
/** Verbs that report what others say or think (〜と言われている). とされる is a rule's wording, not a report. */
|
|
7
|
+
const REPORTING = new Set(["言う", "思う", "考える", "見る", "伝える"]);
|
|
8
|
+
/**
|
|
9
|
+
* The copula that says what the topic is: で (ものである; read as a particle in 事業ではなく) and です. な before a noun is not a
|
|
10
|
+
* predicate.
|
|
11
|
+
*/
|
|
12
|
+
const isCopula = (token) => token?.surface === "で" ? token.pos === "AUX" || token.pos === "ADP" : token?.pos === "AUX" && token.lemma === "です";
|
|
13
|
+
/** The words a copula is finished with before its conjunction: あり, ござい, ます, ませ, ん, the は of ではありません. */
|
|
14
|
+
const COPULA_TAIL = new Set(["ある", "ござる", "ます", "ん", "ぬ", "は"]);
|
|
15
|
+
const isCopulaTail = (token) => COPULA_TAIL.has(token.lemma ?? token.surface) || COPULA_TAIL.has(token.surface);
|
|
16
|
+
/** Whether the words just before end are a copula and its tail (ではありません, でございます, である). */
|
|
17
|
+
/** The first word at or before at that is not a copula's tail. Walks back only over the tail, so each call is short. */
|
|
18
|
+
const beforeTail = (tokens, at) => {
|
|
19
|
+
const token = tokens[at];
|
|
20
|
+
return token !== undefined && isCopulaTail(token) ? beforeTail(tokens, at - 1) : at;
|
|
21
|
+
};
|
|
22
|
+
const copulaBefore = (tokens, end) => isCopula(tokens[beforeTail(tokens, end - 1)]);
|
|
23
|
+
const isComma = (token) => COMMA.has(token?.surface ?? "");
|
|
24
|
+
/** A noun of its own, not a nominaliser (こと, の, ところ) that only turns the clause before it into a noun. */
|
|
25
|
+
const isOwnNoun = (token) => NOMINAL.has(token?.pos ?? "") && token?.features?.["NounType"] !== "Dependent";
|
|
26
|
+
const isParticle = (token, surface) => token.surface === surface && token.pos === "ADP";
|
|
27
|
+
/**
|
|
28
|
+
* The last place a subject of its own stands before the sentence's last word: a new topic (法律はありませんが) anywhere, or a
|
|
29
|
+
* noun with が that the final predicate takes (no comma after it: 動きが見られ始めている). A noun with が inside a condition
|
|
30
|
+
* (債務者が請求した場合、) is not one. -1 when there is none. A clause has a subject of its own after it when this is past it.
|
|
31
|
+
*/
|
|
32
|
+
const lastOwnSubject = (tokens, last) => {
|
|
33
|
+
const lastComma = tokens.findLastIndex((token, at) => at < last && isComma(token));
|
|
34
|
+
return tokens.findLastIndex((token, at) => at < last && isOwnNoun(tokens[at - 1]) && (isParticle(token, "は") || (isParticle(token, "が") && at > lastComma)));
|
|
35
|
+
};
|
|
36
|
+
/** The words of the clause after a comma at from, up to the next clause stopped by a comma, or the sentence's last word. */
|
|
37
|
+
const nextClause = (tokens, from, last) => {
|
|
38
|
+
const stop = tokens.findIndex((token, at) => at > from && at < last && isComma(token) && PREDICATE.has(tokens[at - 1]?.pos ?? ""));
|
|
39
|
+
return tokens.slice(from + 1, stop === -1 ? last : stop);
|
|
40
|
+
};
|
|
41
|
+
/** であって that narrows a class to a head noun after it (失業者であって、支援の必要がある者の…): the topic's predicate is still to come. */
|
|
42
|
+
const narrowsToHead = (tokens, comma, last) => nextClause(tokens, comma, last).some((token, at, clause) => token.pos === "NOUN" && RESTRICTED_HEADS.has(token.surface) && clause[at + 1]?.surface !== "は");
|
|
43
|
+
/** A copula with が or て and a comma (〜ではありませんが、, 〜でございますが、, 〜であって、 that does not narrow to a head noun). */
|
|
44
|
+
const closesCopula = (tokens, at, last) => {
|
|
45
|
+
const token = tokens[at];
|
|
46
|
+
if (token?.pos !== "SCONJ" || (token.surface !== "が" && token.surface !== "て"))
|
|
47
|
+
return false;
|
|
48
|
+
if (!isComma(tokens[at + 1]) || !copulaBefore(tokens, at))
|
|
49
|
+
return false;
|
|
50
|
+
return token.surface === "が" || !narrowsToHead(tokens, at + 1, last);
|
|
51
|
+
};
|
|
52
|
+
/** A quotation the sentence reports in the passive (〜だと言われているが), whose topic is inside the quotation. */
|
|
53
|
+
const closesReport = (tokens, at) => {
|
|
54
|
+
const token = tokens[at];
|
|
55
|
+
return token?.surface === "と" && token.pos === "ADP" && REPORTING.has(tokens[at + 1]?.lemma ?? "") && tokens[at + 2]?.features?.["Voice"] === "Pass";
|
|
56
|
+
};
|
|
57
|
+
/** A clause the topic's predicate closes for certain. */
|
|
58
|
+
const closesSurely = (tokens, at, last) => closesCopula(tokens, at, last) || closesReport(tokens, at);
|
|
59
|
+
/** 〜にあるところ、 / 〜したところ、: a clause the nominaliser ところ closes after a predicate. */
|
|
60
|
+
const closesWithTokoro = (tokens, at) => tokens[at]?.surface === "ところ" && tokens[at]?.features?.["NounType"] === "Dependent" && PREDICATE.has(tokens[at - 1]?.pos ?? "");
|
|
61
|
+
/** 〜であるならば、: a copula's conditional. */
|
|
62
|
+
const closesWithCondition = (tokens, at) => tokens[at]?.surface === "ば" && tokens[at]?.pos === "SCONJ" && tokens[at - 1]?.surface === "なら" && tokens[at - 1]?.lemma === "だ";
|
|
63
|
+
/**
|
|
64
|
+
* A clause that may close the topic's predicate, when a new subject follows, each stopped by a comma: a copula after ない or
|
|
65
|
+
* ため (〜ではなく、, 〜であるため、), a copula's condition (〜であるならば、), ところ (〜にあるところ、), and a continuing verb
|
|
66
|
+
* (〜を続けており、).
|
|
67
|
+
*/
|
|
68
|
+
const closesIfNewSubject = (tokens, at) => {
|
|
69
|
+
const token = tokens[at];
|
|
70
|
+
if (!isComma(tokens[at + 1]))
|
|
71
|
+
return false;
|
|
72
|
+
if (token?.surface === "ため" || token?.lemma === "ない")
|
|
73
|
+
return copulaBefore(tokens, at);
|
|
74
|
+
if (closesWithTokoro(tokens, at) || closesWithCondition(tokens, at))
|
|
75
|
+
return true;
|
|
76
|
+
return token?.pos === "VERB" && token.lemma === "おる" && token.features?.["Bound"] === "Yes";
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The index of the word that ends the topic's own clause, between the topic and the sentence's last word, or undefined when the
|
|
80
|
+
* topic's predicate is the one the sentence ends on.
|
|
81
|
+
*/
|
|
82
|
+
export const topicClauseEnd = (tokens, topic, last) => {
|
|
83
|
+
const subject = lastOwnSubject(tokens, last);
|
|
84
|
+
const end = tokens.findIndex((_, at) => at > topic && at < last && (closesSurely(tokens, at, last) || (closesIfNewSubject(tokens, at) && subject > at)));
|
|
85
|
+
return end === -1 ? undefined : end;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=topic-clause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-clause.js","sourceRoot":"","sources":["../src/topic-clause.ts"],"names":[],"mappings":"AAIA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,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7C,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACzJ,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Lexicon, Token } from "./plugin.ts";
|
|
2
|
+
/** The words that decide which particle-looking tokens are not links in a chain of particles. */
|
|
3
|
+
export type UncountedWords = {
|
|
4
|
+
/** The particles a chain is made of (の). */
|
|
5
|
+
readonly particles: readonly string[];
|
|
6
|
+
/** Words written as a number: every character one of these, or a decimal digit. */
|
|
7
|
+
readonly numeralChars: ReadonlySet<string>;
|
|
8
|
+
/** Words that number a provision and may be followed by a branch number (第70条の2: 条). */
|
|
9
|
+
readonly counters: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const isNumeral: (surface: string, numeralChars: ReadonlySet<string>) => boolean;
|
|
12
|
+
/** The particle tokens of a sentence that join the parts of a number (第70条の2) and are not links of a chain. */
|
|
13
|
+
export declare const uncountedParticles: (tokens: readonly Token[], words: UncountedWords) => ReadonlySet<Token>;
|
|
14
|
+
/** The words for `uncountedParticles`, read from the document's lexicons. */
|
|
15
|
+
export declare const uncountedWordsOf: (lexicons: Readonly<Record<string, Lexicon>>, particles: readonly string[]) => UncountedWords;
|
|
16
|
+
/** The tokens of a sentence without the particles that join the parts of a number. */
|
|
17
|
+
export declare const countedTokens: (tokens: readonly Token[], words: UncountedWords) => readonly Token[];
|
|
18
|
+
//# sourceMappingURL=uncounted-particles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncounted-particles.d.ts","sourceRoot":"","sources":["../src/uncounted-particles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAElD,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG;IAC3B,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,mFAAmF;IACnF,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAIF,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,EAAE,cAAc,WAAW,CAAC,MAAM,CAAC,KAAG,OAC2B,CAAC;AAqC3G,+GAA+G;AAC/G,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,OAAO,cAAc,KAAG,WAAW,CAAC,KAAK,CACqB,CAAC;AAM5H,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,GAAI,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,WAAW,SAAS,MAAM,EAAE,KAAG,cAI3G,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,OAAO,cAAc,KAAG,SAAS,KAAK,EAG7F,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const DECIMAL_DIGITS = /^\p{Nd}+$/u;
|
|
2
|
+
export const isNumeral = (surface, numeralChars) => DECIMAL_DIGITS.test(surface) || (surface !== "" && [...surface].every((char) => numeralChars.has(char)));
|
|
3
|
+
const numeralAt = (tokens, at, words) => {
|
|
4
|
+
const token = tokens[at];
|
|
5
|
+
return token !== undefined && isNumeral(token.surface, words.numeralChars);
|
|
6
|
+
};
|
|
7
|
+
/** 第70条, 第3項: a counter right after a number. */
|
|
8
|
+
const numberedCounterAt = (tokens, at, words) => {
|
|
9
|
+
const token = tokens[at];
|
|
10
|
+
return token !== undefined && words.counters.includes(token.surface) && numeralAt(tokens, at - 1, words);
|
|
11
|
+
};
|
|
12
|
+
const NOMINAL = new Set(["NOUN", "PROPN"]);
|
|
13
|
+
const LETTER = /\p{L}/u;
|
|
14
|
+
/** Where the run of number tokens that starts at `at` ends (三十 may be two tokens). */
|
|
15
|
+
const numeralRunEnd = (tokens, at, words) => {
|
|
16
|
+
const end = tokens.findIndex((token, index) => index >= at && !isNumeral(token.surface, words.numeralChars));
|
|
17
|
+
return end === -1 ? tokens.length : end;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A word after the number makes it a quantity (資料2-1の4ページ: page 4 of it), not a branch number. A word that opens
|
|
21
|
+
* the next number (第 of 第70条の2第1項) is not one.
|
|
22
|
+
*/
|
|
23
|
+
const isWordAt = (tokens, at, words) => {
|
|
24
|
+
const token = tokens[at];
|
|
25
|
+
return token !== undefined && NOMINAL.has(token.pos) && LETTER.test(token.surface) && !numeralAt(tokens, at + 1, words);
|
|
26
|
+
};
|
|
27
|
+
/** 第70条の2, 70の2-8の2, 第2の2: the particle joins a branch number to the number before it, so it is part of the number. */
|
|
28
|
+
const isNumberingConnector = (tokens, at, words) => numeralAt(tokens, at + 1, words) &&
|
|
29
|
+
!isWordAt(tokens, numeralRunEnd(tokens, at + 1, words), words) &&
|
|
30
|
+
(numeralAt(tokens, at - 1, words) || numberedCounterAt(tokens, at - 1, words));
|
|
31
|
+
/** The particle tokens of a sentence that join the parts of a number (第70条の2) and are not links of a chain. */
|
|
32
|
+
export const uncountedParticles = (tokens, words) => new Set(tokens.filter((token, at) => words.particles.includes(token.surface) && isNumberingConnector(tokens, at, words)));
|
|
33
|
+
const COUNTER_LEXICON = "numbering-counter";
|
|
34
|
+
const NUMBER_LEXICON = "number-word";
|
|
35
|
+
const NUMERAL_GROUPS = ["digit", "place"];
|
|
36
|
+
/** The words for `uncountedParticles`, read from the document's lexicons. */
|
|
37
|
+
export const uncountedWordsOf = (lexicons, particles) => ({
|
|
38
|
+
particles,
|
|
39
|
+
numeralChars: new Set((lexicons[NUMBER_LEXICON] ?? []).filter((entry) => NUMERAL_GROUPS.includes(entry.group)).map((entry) => entry.pattern)),
|
|
40
|
+
counters: (lexicons[COUNTER_LEXICON] ?? []).map((entry) => entry.pattern),
|
|
41
|
+
});
|
|
42
|
+
/** The tokens of a sentence without the particles that join the parts of a number. */
|
|
43
|
+
export const countedTokens = (tokens, words) => {
|
|
44
|
+
const uncounted = uncountedParticles(tokens, words);
|
|
45
|
+
return uncounted.size === 0 ? tokens : tokens.filter((token) => !uncounted.has(token));
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=uncounted-particles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncounted-particles.js","sourceRoot":"","sources":["../src/uncounted-particles.ts"],"names":[],"mappings":"AAYA,MAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,YAAiC,EAAW,EAAE,CACvF,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE3G,MAAM,SAAS,GAAG,CAAC,MAAwB,EAAE,EAAU,EAAE,KAAqB,EAAW,EAAE;IACzF,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACzB,OAAO,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;AAC7E,CAAC,CAAC;AAEF,iDAAiD;AACj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AC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7I,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;CAC1E,CAAC,CAAC;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAwB,EAAE,KAAqB,EAAoB,EAAE;IACjG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,SAAS,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chaffjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Prose validation harness. Finds what is hard to read, and never rewrites it for you.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chaff",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@anthropic-ai/sdk": "^0.125.0",
|
|
91
|
-
"@chaffjs/lang-en": "0.
|
|
92
|
-
"@chaffjs/lang-ja": "0.
|
|
91
|
+
"@chaffjs/lang-en": "0.34.0",
|
|
92
|
+
"@chaffjs/lang-ja": "0.36.0",
|
|
93
93
|
"character-entities": "^2.0.2",
|
|
94
94
|
"mdast-util-from-markdown": "^2.0.3",
|
|
95
95
|
"mdast-util-frontmatter": "^2.0.1",
|
|
@@ -41,8 +41,8 @@ example:
|
|
|
41
41
|
Do not delete the log. Do not delete this file before the audit.
|
|
42
42
|
|
|
43
43
|
not_flagged:
|
|
44
|
-
ja: 三語以上の連なりだけを見ます。略語の並び(文書のほかの所で小文字で書かれない語)とコードは見ません。仕様書の MUST や SHALL は慣習の大文字として数えません。段落の頭に置いた大文字の見出し語(「AGENCY:」「WORKING GROUP MEMBERS
|
|
45
|
-
en: Only runs of three or more words. Runs of acronyms (words never written in lower case elsewhere) and code are not reported, and MUST or SHALL in a specification count as conventional capitals. A caption in capitals that opens a paragraph and ends in a colon or stands alone ("AGENCY:", "WORKING GROUP MEMBERS"), and prose naming such a caption, are not reported either. Nor is a paragraph
|
|
44
|
+
ja: 三語以上の連なりだけを見ます。略語の並び(文書のほかの所で小文字で書かれない語)とコードは見ません。仕様書の MUST や SHALL は慣習の大文字として数えません。段落の頭に置いた大文字の見出し語(「AGENCY:」「WORKING GROUP MEMBERS」のように、コロンで終わるか一行で段落になるもの)と、本文でその見出し語を挙げた所も見ません。全部の行が大文字で文で終わらない段落(「BOARD OF GOVERNORS」で始まるレターヘッドや宛名、議事録が一行で立てる「OPENING STATEMENT OF HON. JANE DOE,」のような見出し)と、名簿の欄の「JANE Q. DOE, Ohio」のように大文字の名前の後ろに普通の書き方の地名や役職が続くものも見ません。法令と文学の文書では既定で止めています(大文字で目立たせる決まりや、題を大文字で組む慣習があるため)。
|
|
45
|
+
en: Only runs of three or more words. Runs of acronyms (words never written in lower case elsewhere) and code are not reported, and MUST or SHALL in a specification count as conventional capitals. A caption in capitals that opens a paragraph and ends in a colon or stands alone ("AGENCY:", "WORKING GROUP MEMBERS"), and prose naming such a caption, are not reported either. Nor is a paragraph whose lines are all in capitals and end no sentence, such as a letterhead, an addressee block ("BOARD OF GOVERNORS") or a heading a transcript sets on a line of its own ("OPENING STATEMENT OF HON. JANE DOE,"), nor a roster entry that gives a name in capitals and the place or office in ordinary case ("JANE Q. DOE, Ohio"). The legal and literature presets turn it off, since contracts set disclaimers in capitals by rule and older texts set titles that way.
|
|
46
46
|
level_meaning:
|
|
47
47
|
ja: "{limit} 箇所あれば指摘"
|
|
48
48
|
en: reported once there are {limit}
|
package/rules/bare-url-mix.yaml
CHANGED
|
@@ -51,8 +51,8 @@ example:
|
|
|
51
51
|
Prices are on [the pricing page](https://example.com/pricing). Send questions through [the contact form](https://example.com/contact) today.
|
|
52
52
|
|
|
53
53
|
not_flagged:
|
|
54
|
-
ja: 山括弧で囲んだ URL(<https://…>)、言葉が URL のリンク、コードと引用の中の URL、項目の値として行に一つだけ書いた URL(**ライセンス本文** https
|
|
55
|
-
en: A URL in angle brackets ("<https://…>"), a link whose text is the URL, URLs in code or quotations,
|
|
54
|
+
ja: 山括弧で囲んだ URL(<https://…>)、言葉が URL のリンク、コードと引用の中の URL、項目の値として行に一つだけ書いた URL(**ライセンス本文** https://…)、本文に書いたデータの例の値({"home":"https://…"})は指しません。参照の形のリンク([言葉][1])は言葉のリンクに数えません。言葉のリンクが指摘に要る数に届かない文書と、URL をそのまま書くほうが多い文書も指しません。
|
|
55
|
+
en: A URL in angle brackets ("<https://…>"), a link whose text is the URL, URLs in code or quotations, a URL that is a field's value alone on its line ("**Licence text** https://…"), and one that is a value in an example payload written in the text (`{"home":"https://…"}`) are not reported; reference-style links ("[text][1]") are not counted as worded links; nor is a document with fewer worded links than the level needs, or one where bare URLs are not the few.
|
|
56
56
|
level_meaning:
|
|
57
57
|
ja: 言葉のリンクが {limit} 個以上ある文書で指摘
|
|
58
58
|
en: reported in a document with {limit} or more worded links
|
|
@@ -31,6 +31,7 @@ off_for:
|
|
|
31
31
|
academic: "Science writes in the passive, hedges its claims on purpose (may, suggest) and cites numbers as its evidence."
|
|
32
32
|
literature: "Length, rhythm, repetition and register are the author's choices in literature, and dialogue mixes styles. Only what one work can hold itself to runs: consistent spacing and commas, and numbering without gaps."
|
|
33
33
|
speech: "A speech opens with greetings and closes with thanks: that is its form, not padding."
|
|
34
|
+
business/meeting-notes: "Minutes record what was said and decided; a section of members' opinions has no reason to carry a number, code or link."
|
|
34
35
|
|
|
35
36
|
group: structure
|
|
36
37
|
summary:
|
|
@@ -42,8 +42,8 @@ example:
|
|
|
42
42
|
We don't store your password. We don't read your messages. We don't share your data. We don't sell your address.
|
|
43
43
|
|
|
44
44
|
not_flagged:
|
|
45
|
-
ja: 短縮形を使うかどうかは決めません。比べるのは同じ語の 2 つの形(「you're」と「you are」)だけで、別の語どうしは比べません。「you're」と書き、否定は「do not」と書く文書は揃っています。同じ語の 2
|
|
46
|
-
en: Whether to use contractions is not decided. Only the two forms of the same word are compared ("you're" with "you are"), never different words, so a document that writes "you're" but keeps "do not" in full is consistent. When both forms of a word appear as often, there is no minority and nothing is pointed at.
|
|
45
|
+
ja: 短縮形を使うかどうかは決めません。比べるのは同じ語の 2 つの形(「you're」と「you are」)だけで、別の語どうしは比べません。「you're」と書き、否定は「do not」と書く文書は揃っています。同じ語の 2 つの形が同じ回数なら、少ないほうが無いので指しません。引用符で挙げた短い語句("Do Not Disturb"、‘we’re going to x’)は名前か例なので数えません。
|
|
46
|
+
en: Whether to use contractions is not decided. Only the two forms of the same word are compared ("you're" with "you are"), never different words, so a document that writes "you're" but keeps "do not" in full is consistent. When both forms of a word appear as often, there is no minority and nothing is pointed at. A short phrase in quotation marks ("Do Not Disturb", ‘we’re going to x’) is a name or an example and is not counted.
|
|
47
47
|
level_meaning:
|
|
48
48
|
ja: 同じ語の少ないほうの書き方が {limit} 箇所以下のとき指摘
|
|
49
49
|
en: reported when the minority form of a word appears {limit} times or fewer
|
|
@@ -82,5 +82,5 @@ example:
|
|
|
82
82
|
Users may use the Service free of charge.
|
|
83
83
|
|
|
84
84
|
not_flagged:
|
|
85
|
-
ja: 二つの定義が食い違っているかは決めません。二つ目を指すだけです。語を名前にした見出しは定義に数えません。英語で、括弧に引用符だけで入れた語句のうち、名前らしく大文字で始めていない語を含むもの(("The key point is"))は、例を引いたものとして定義に数えません。添付した文書(前後を空行に挟まれた「Exhibit A to Merger Agreement
|
|
86
|
-
en: 'Whether the two definitions conflict is not decided; only the second is pointed at. A heading that names the term is not a definition. In English, a phrase quoted alone in brackets with a word a name would capitalise left in lower case ("The key point is") quotes an example, and is not a definition. An attached instrument (from a title line such as "Exhibit A to Merger Agreement" between blank lines) is a separate document: its definitions are compared only with each other, not with those of the body.'
|
|
85
|
+
ja: 二つの定義が食い違っているかは決めません。二つ目を指すだけです。語を名前にした見出しは定義に数えません。英語で、括弧に引用符だけで入れた語句のうち、名前らしく大文字で始めていない語を含むもの(("The key point is"))は、例を引いたものとして定義に数えません。添付した文書(前後を空行に挟まれた「Exhibit A to Merger Agreement」のような題の行、または「## **SCHEDULE B**」のような見出しから後ろ)は別の文書なので、その中の定義は、本文の定義とは比べず、添付した文書の中でだけ比べます。
|
|
86
|
+
en: 'Whether the two definitions conflict is not decided; only the second is pointed at. A heading that names the term is not a definition. In English, a phrase quoted alone in brackets with a word a name would capitalise left in lower case ("The key point is") quotes an example, and is not a definition. An attached instrument (from a title line such as "Exhibit A to Merger Agreement" between blank lines, or a heading such as "## **SCHEDULE B**") is a separate document: its definitions are compared only with each other, not with those of the body.'
|
|
@@ -74,5 +74,5 @@ example:
|
|
|
74
74
|
Wear gloves.
|
|
75
75
|
|
|
76
76
|
not_flagged:
|
|
77
|
-
ja:
|
|
78
|
-
en: Headings under different parents (each version's "Added" and "Fixed", each chapter's "Summary") are not compared. It runs on Markdown only.
|
|
77
|
+
ja: 親が違う見出しどうし(版ごとの「追加」「修正」、章ごとの「まとめ」)は比べません。事例ごとに決まった見出しの組(【相談事例】【回答】、Question と Answer)を同じ順でくり返す所も言いません。括弧の添え書き(【事例(約款)】)は除いて組を見ます。Markdown の文書でだけ動きます。
|
|
78
|
+
en: Headings under different parents (each version's "Added" and "Fixed", each chapter's "Summary") are not compared. A fixed set of labels repeated in the same order for each case (Question and Answer, 【相談事例】 and 【回答】) is not reported either; a qualifier in brackets (Case (terms)) is set aside when the set is read. It runs on Markdown only.
|
|
@@ -46,8 +46,8 @@ example:
|
|
|
46
46
|
申込は2024年4月10日までです。説明会は2024年4月3日と2024年4月5日に開きます。
|
|
47
47
|
|
|
48
48
|
not_flagged:
|
|
49
|
-
ja: 鉤括弧で引いたもの、項目と注の番号(「1.」「(1)」「※1」)、箇条書きの頭の番号、版の番号の続き(TLS1.2 の 2)、注や URL
|
|
50
|
-
en: Quotations in brackets, item and note numbers (1., (1), ※1), a number at the head of a list item, the rest of a version number (the 2 of TLS1.2), and notes or sentences with a URL are not counted. Single letters, words, single digits and longer numbers are compared separately, so "one digit full-width, more digits half-width" counts as consistent. Neither way is called right.
|
|
49
|
+
ja: 鉤括弧で引いたもの、項目と注の番号(「1.」「(1)」「※1」)、箇条書きの頭の番号、版の番号の続き(TLS1.2 の 2)、注や URL を含む文は数えません。小文字を含む半角の英語の語(AI for Science の for と Science)は、英字の書き方の票には入れますが、少ないほうとしては指摘しません。英語の語は、略語を全角で書く文書でも半角で書くためです。英字一字・英字の語・数字一字・数字の並びは別々に比べるので、「1桁は全角、2桁以上は半角」はそろっていると見ます。どちらの書き方が正しいかは決めません。
|
|
50
|
+
en: Quotations in brackets, item and note numbers (1., (1), ※1), a number at the head of a list item, the rest of a version number (the 2 of TLS1.2), and notes or sentences with a URL are not counted. A half-width English word with lower case (the for and Science of AI for Science) counts toward the document's way of writing letters but is never reported itself, since English words stay half-width even where acronyms are full-width. Single letters, words, single digits and longer numbers are compared separately, so "one digit full-width, more digits half-width" counts as consistent. Neither way is called right.
|
|
51
51
|
level_meaning:
|
|
52
52
|
ja: 少ないほうが組の {limit}% 以下のとき指摘
|
|
53
53
|
en: reported when the minority form is {limit}% of its group or less
|
|
@@ -46,8 +46,8 @@ example:
|
|
|
46
46
|
申込書は、窓口で受け付けます。書類は、担当者が確認します。結果は、翌日に知らせます。
|
|
47
47
|
|
|
48
48
|
not_flagged:
|
|
49
|
-
ja: 数の中の「,」「.」(1,000、3.5)、番号の印の点(1.、(注)
|
|
50
|
-
en: Marks inside numbers (1,000, 3.5), after a list number or label (1., (注)1., イ.), in a letter label (Q.), in a company form (CO.,LTD.), inside 「」, and in a note or a sentence with a URL are not counted. Neither way is called right.
|
|
49
|
+
ja: 数の中の「,」「.」(1,000、3.5)、番号の印の点(1.、(注)1.、イ.)、番号を指す点(3.から5.まで、(1)4.の改正)、「Q.」のような英字の印、英字の会社の名前の形(CO.,LTD.)、「」の中、注の番号で始まる行と URL を含む文は数えません。どちらの書き方が正しいかは決めません。
|
|
50
|
+
en: Marks inside numbers (1,000, 3.5), after a list number or label (1., (注)1., イ.), after a number that is referred to (3.から5.まで, (1)4.の改正), in a letter label (Q.), in a company form (CO.,LTD.), inside 「」, and in a note or a sentence with a URL are not counted. Neither way is called right.
|
|
51
51
|
level_meaning:
|
|
52
52
|
ja: 少ないほうの書き方が {limit} 箇所あれば指摘
|
|
53
53
|
en: reported once {limit} places go against the document's habit
|
package/rules/latin-spacing.yaml
CHANGED
|
@@ -70,8 +70,8 @@ example:
|
|
|
70
70
|
表は Excel で作り、Word に貼ります。図は PowerPoint で描きます。最後に PDF にします。
|
|
71
71
|
|
|
72
72
|
not_flagged:
|
|
73
|
-
ja: 電話番号や日付のような番号、版番号(1.0.0)、予約番号や型番(MN-48215)の前後、単位つきの日付や時刻(9月、10時5分)、AM・PM を付けた時刻(9:30AM)の後ろ、建物の名前の後ろに空白で区切った階や部屋の番号(本社 5階)の前、名前だけを並べた行の名前と名前のあいだ(経営企画部 IR担当)、6 桁以上の番号やナンバープレートの前後、項目名とコロンの後ろの値の組のあいだ(所属:経済学科 1年)、項目名と値のあいだ(Bronzeプラン 10万円 (税込))、日本語の句をつなぐ英語の語の前後(名前 or メッセージ)、英字の語に付けた接尾の語(PDF版、IT
|
|
74
|
-
en: Codes such as phone numbers, dates and version numbers (1.0.0), the spaces beside a booking or model number (MN-48215), dates and times with units (9月, 10時5分), the space after a time with AM or PM (9:30AM), the space before a floor or room number after the name of a building (本社 5階), the space between names on a line of names alone (経営企画部 IR担当), the spaces beside a code of six digits or more or a number plate, the space between the parts of a value after a label and a colon (所属:経済学科 1年), the space between a label and its value (Bronzeプラン 10万円 (税込)), the spaces around an English word joining Japanese phrases (名前 or メッセージ), the boundary before a suffix bound to a Latin word (PDF版, IT化), heading numbers, the space after an item number at the head of a line (一 JIS…), quotations and the text of links are not counted. Neither way is called right. When the less common way is more than a fifth of the places (and at least five), or both ways are used equally at two places or more each, it is reported once, as a document written two ways, rather than place by place. A one-to-one tie is not reported.
|
|
73
|
+
ja: 電話番号や日付のような番号、版番号(1.0.0)、予約番号や型番(MN-48215)の前後、単位つきの日付や時刻(9月、10時5分)、AM・PM を付けた時刻(9:30AM)の後ろ、建物の名前の後ろに空白で区切った階や部屋の番号(本社 5階)の前、名前だけを並べた行の名前と名前のあいだ(経営企画部 IR担当)、6 桁以上の番号やナンバープレートの前後、項目名とコロンの後ろの値の組のあいだ(所属:経済学科 1年)、項目名と値のあいだ(Bronzeプラン 10万円 (税込))、日本語の句をつなぐ英語の語の前後(名前 or メッセージ)、英字の語に付けた接尾の語(PDF版、IT化)の前、チャンネルや宛先の名前(#pj_oss-team、@sato)の後ろ、見出しの番号、行の頭の項目の番号(「一 JIS…」の一、イ)の後ろ、「」の中、リンクの文字の中は数えません。どちらの空け方が正しいかは決めません。少ないほうが全体の 2 割を超えるほど多ければ(5 箇所以上)、また二通りが 2 箇所以上ずつの同数なら、1 箇所ずつではなく、書き方が二通りあることを 1 件で言います。1 対 1 の同数は言いません。
|
|
74
|
+
en: Codes such as phone numbers, dates and version numbers (1.0.0), the spaces beside a booking or model number (MN-48215), dates and times with units (9月, 10時5分), the space after a time with AM or PM (9:30AM), the space before a floor or room number after the name of a building (本社 5階), the space between names on a line of names alone (経営企画部 IR担当), the spaces beside a code of six digits or more or a number plate, the space between the parts of a value after a label and a colon (所属:経済学科 1年), the space between a label and its value (Bronzeプラン 10万円 (税込)), the spaces around an English word joining Japanese phrases (名前 or メッセージ), the boundary before a suffix bound to a Latin word (PDF版, IT化), the boundary after a channel or handle name (#pj_oss-team, @sato), heading numbers, the space after an item number at the head of a line (一 JIS…), quotations and the text of links are not counted. Neither way is called right. When the less common way is more than a fifth of the places (and at least five), or both ways are used equally at two places or more each, it is reported once, as a document written two ways, rather than place by place. A one-to-one tie is not reported.
|
|
75
75
|
level_meaning:
|
|
76
76
|
ja: 少ないほうの空け方が {limit} 箇所あれば指摘
|
|
77
77
|
en: reported once {limit} places go against the document's habit
|
|
@@ -10,7 +10,7 @@ uses: [pos]
|
|
|
10
10
|
# または固有名詞か地名を含み、名前の後ろに立つ法人格で閉じる)は数えない。
|
|
11
11
|
# 題の名前(title-ending で閉じ、括弧を閉じるか補いの括弧が続くか一行だけか見出しにあるもの: 〜実施要綱、〜選考試験)は数えない。
|
|
12
12
|
# 日付の単位(4月の「月」)は、数に付いた助数詞として連なりの頭から外す。
|
|
13
|
-
extra_word_lists: [prefecture-unit, organisation-form, organisation-unit, title-ending, calendar-unit]
|
|
13
|
+
extra_word_lists: [prefecture-unit, organisation-form, organisation-unit, title-ending, calendar-unit, addressee-prefix, addressee-title]
|
|
14
14
|
languages: [ja]
|
|
15
15
|
severity: info
|
|
16
16
|
|
|
@@ -101,8 +101,8 @@ example:
|
|
|
101
101
|
The new pricing will be trialled from next month. We have not yet decided how to explain it to existing customers, or when to change the billing system. We will agree on a plan this week.
|
|
102
102
|
|
|
103
103
|
not_flagged:
|
|
104
|
-
ja: 見出し、表のセル、コードは数えません。印刷版を文字にした文書が文の途中に残すページの印(「( printed page 52044)」「- 12
|
|
105
|
-
en: Headings, table cells and code are not counted, nor are the page markers a converted print edition leaves inside a sentence ("( printed page 52044)", "[[Page 52044]]"). Genres where long sentences are normal (statutes, papers) raise the limit.
|
|
104
|
+
ja: 見出し、表のセル、コードは数えません。印刷版を文字にした文書が文の途中に残すページの印(「( printed page 52044)」「- 12 -」)も数えません。脚注の文献の記載(著者 (2025), "題," 出版者)は、その前に書き手が置いた言葉(For example, see …)だけを数えます。法令や論文のように長い一文が普通の種類では、ジャンルが上限を長くします。
|
|
105
|
+
en: Headings, table cells and code are not counted, nor are the page markers a converted print edition leaves inside a sentence ("( printed page 52044)", "[[Page 52044]]"). A footnote that is a bibliographic citation (authors (2025), "Title," publisher) counts only the words the writer puts before it ("For example, see …"). Genres where long sentences are normal (statutes, papers) raise the limit.
|
|
106
106
|
level_meaning:
|
|
107
107
|
ja: 一文 {limit} 字まで
|
|
108
108
|
en: up to {limit} words in a sentence
|
|
@@ -52,8 +52,8 @@ example:
|
|
|
52
52
|
We listen to our customers. Regulars try every prototype, and store staff ask shoppers what they thought.
|
|
53
53
|
|
|
54
54
|
not_flagged:
|
|
55
|
-
ja: 一覧の飾り(各項目に付くタグやリンクの文字)と、名前にかかる語句は数えません。英語の、名詞と形容詞だけが並ぶ用語(the federal funds rate
|
|
56
|
-
en: Tags, link text and symbols that a listing repeats on every entry, and the words around a repeated name, are not counted. A term made only of nouns and adjectives ("the federal funds rate") is not a phrasing and is not counted. The answers in a FAQ are counted one question at a time. A phrase found only in the first sentence of sections (each section's template opening) is not counted. Short documents are not measured.
|
|
55
|
+
ja: 一覧の飾り(各項目に付くタグやリンクの文字)と、名前にかかる語句は数えません。英語の、名詞と形容詞だけが並ぶ用語(the federal funds rate)は言い回しではないので数えません。よくある質問の答えは、問いの見出しごとに別々に数えます。どの出現も節の最初の文にある言い回し(節ごとのひな形の書き出し)と、どの出現も番号を振った項目の見出し((1)…に係る規定に関する改正)にある言い回しは数えません。短い文書は測りません。
|
|
56
|
+
en: Tags, link text and symbols that a listing repeats on every entry, and the words around a repeated name, are not counted. A term made only of nouns and adjectives ("the federal funds rate") is not a phrasing and is not counted. The answers in a FAQ are counted one question at a time. A phrase found only in the first sentence of sections (each section's template opening) is not counted, nor one found only in numbered item titles that a paragraph follows ((1) ... amendment of the provision on ...). Short documents are not measured.
|
|
57
57
|
level_meaning:
|
|
58
58
|
ja: 同じ言い回し {limit} 回まで
|
|
59
59
|
en: up to {limit} uses of the same phrase
|
|
@@ -56,8 +56,8 @@ example:
|
|
|
56
56
|
Send the form by email. We answer every email within a day. Attach the receipt to the email.
|
|
57
57
|
|
|
58
58
|
not_flagged:
|
|
59
|
-
ja: 読みが同じでも漢字の違う語(書く・描く)、補助動詞・形式名詞と本来の使い方の書き分け(見て下さい・資料を下さい)、書き分けが意味の違いになる語(成る・なる、言う・いう。法務のジャンルでは、法令の書き方で書き分ける 時・とき、物・もの、在る・ある も)、名詞と動詞(払込み・払い込む、申出・申し出る。辞書が名詞を動詞と読んでも)、語末の「ー」だけの違い(katakana-long-vowel が見ます)、鉤括弧や引用符の中、行の頭のリンクで引いた外のページの題名、語の直後のふりがなの括弧の中(HTTP(えいちてぃーてぃーぴー))、会社の名前(青葉硝子㈱、株式会社の前後の名前)、chaff.yaml の names
|
|
60
|
-
en: The case of a word's first letter (Email, email; Long-Term, long-term) is not a spelling, nor is a word in capitals only (emphasis or an acronym), nor a name in capitals with an ending (SENDs, OPENed), nor the letters of an acronym picked out beside it (CLImatology next to CLIPER), nor a word inside a passage written in capitals (eGAIN in a disclaimer), nor a name coined from capitalised pieces that are not words (Medi-Cal beside medical). A name spelled with capitals (HBase) is still compared. In Japanese, words whose kanji and kana forms mean different things (成る and なる) are not compared, and in the legal genres neither are 時 and とき, 物 and もの or 在る and ある, which legal drafting writes apart. A noun and a verb (払込み and 払い込む) are different words, even where the analyser reads the noun as the verb. Hyphenated words that are another word (re-sign, resign), part of an address (github.com), anything in quotation marks, the title of an outside page quoted by a link at a line's head, a Japanese reading in brackets right after a word (HTTP(えいちてぃーてぃーぴー)), a Japanese company name written with its form (青葉硝子㈱) and the team's names are not compared. Nothing is reported when the minority is more than a third. The literature preset turns it off, since old spelling belongs to its time.
|
|
59
|
+
ja: 読みが同じでも漢字の違う語(書く・描く)、補助動詞・形式名詞と本来の使い方の書き分け(見て下さい・資料を下さい)、書き分けが意味の違いになる語(成る・なる、言う・いう。法務のジャンルでは、法令の書き方で書き分ける 時・とき、物・もの、在る・ある も)、名詞と動詞(払込み・払い込む、申出・申し出る。辞書が名詞を動詞と読んでも)、語末の「ー」だけの違い(katakana-long-vowel が見ます)、鉤括弧や引用符の中、行の頭のリンクで引いた外のページの題名、語の直後のふりがなの括弧の中(HTTP(えいちてぃーてぃーぴー))、会社の名前(青葉硝子㈱、株式会社の前後の名前)、chaff.yaml の names に書いた名前は見ません。「方」と「ほう」は「が」「で」の前(早いほうが)だけで比べ、人の「方」の多い所(担当の方に)は比べません。文の頭の丸括弧の印(問答の(答))も比べません。名詞に続けて書いたかなの名詞(全員ぶん)と慣用句の動詞(気をつける)、見立ての「みる」(〜とみられる、増加がみられる)は、同じ読みの語(文、名札を付ける、資料を見る)と別に比べます。英字は、頭の字の大文字小文字(Email と email)と、大文字だけの語(強調や略語)、大文字の名前に語尾が付いた語(関数名の SENDs)、同じ文の略語の字を示した語(CLIPER と並ぶ CLImatology)、大文字で書いた一節の中の語(免責の段落の eGAIN)、大文字で始まる語でないかけらをハイフンでつないだ名前(medical と並ぶ Medi-Cal)を書き方の違いにしません(HBase のような名前の大文字は比べます)。少ないほうが三分の一を超えるときも言いません。文学のジャンルでは既定で止めています(その時代の書き方のため)。
|
|
60
|
+
en: The case of a word's first letter (Email, email; Long-Term, long-term) is not a spelling, nor is a word in capitals only (emphasis or an acronym), nor a name in capitals with an ending (SENDs, OPENed), nor the letters of an acronym picked out beside it (CLImatology next to CLIPER), nor a word inside a passage written in capitals (eGAIN in a disclaimer), nor a name coined from capitalised pieces that are not words (Medi-Cal beside medical). A name spelled with capitals (HBase) is still compared. In Japanese, words whose kanji and kana forms mean different things (成る and なる) are not compared, 方 and ほう are compared only before が or で (早いほうが), since elsewhere 方 is mostly the person (担当の方に), nor a label opening a sentence (the (答) of a Q&A); the judging みる (〜とみられる) is compared apart from looking (資料を見る), and in the legal genres neither are 時 and とき, 物 and もの or 在る and ある, which legal drafting writes apart. A noun and a verb (払込み and 払い込む) are different words, even where the analyser reads the noun as the verb. Hyphenated words that are another word (re-sign, resign), part of an address (github.com), anything in quotation marks, the title of an outside page quoted by a link at a line's head, a Japanese reading in brackets right after a word (HTTP(えいちてぃーてぃーぴー)), a Japanese company name written with its form (青葉硝子㈱) and the team's names are not compared. Nothing is reported when the minority is more than a third. The literature preset turns it off, since old spelling belongs to its time.
|
|
61
61
|
level_meaning:
|
|
62
62
|
ja: 少ないほうが語の {limit}% 以下のとき指摘
|
|
63
63
|
en: reported when the minority spelling is {limit}% of the word's uses or less
|
|
@@ -40,8 +40,8 @@ example:
|
|
|
40
40
|
We sell apples, pears, and plums. We ship to homes, offices, and schools. We accept cash, cards, and vouchers.
|
|
41
41
|
|
|
42
42
|
not_flagged:
|
|
43
|
-
ja: カンマを打つかどうかは決めません。半々に分かれた文書では、どちらが少ないとも言えないので指しません。郵便番号で終わる住所のあとの and / or(Leeds LS1 4AB, or email
|
|
44
|
-
en: Whether to use the comma is not decided. A document split evenly has no minority and is not reported. An and / or right after a postal address closed by its postcode ("Leeds LS1 4AB, or email us") follows the address's commas and is not counted as a list. Nor is a contrast after a comma ("more correct, not cleaner or more elegant") or an introduction opened by a sequence word ("First, outside a block, …").
|
|
43
|
+
ja: カンマを打つかどうかは決めません。半々に分かれた文書では、どちらが少ないとも言えないので指しません。郵便番号で終わる住所のあとの and / or(Leeds LS1 4AB, or email)は、住所の読点のあとなので並びとして数えません。最後の読点のあとに前後を空けたダッシュがある and / or(Washington, DC – The Cybersecurity and Infrastructure Security Agency)も、読点はダッシュの前の日付行のものなので数えません。読点のあとの否定(more correct, not cleaner or more elegant)と、順番の語で始まる導入(First, outside a block, …)も並びではありません。主語と述語のあいだに読点で挟んだ例の句(X, such as Y, are excluded and are not…)も並びの項目に数えません。
|
|
44
|
+
en: Whether to use the comma is not decided. A document split evenly has no minority and is not reported. An and / or right after a postal address closed by its postcode ("Leeds LS1 4AB, or email us") follows the address's commas and is not counted as a list, and neither is one after a spaced dash that follows the last comma (a dateline such as "Washington, DC – The Cybersecurity and Infrastructure Security Agency"). Nor is a contrast after a comma ("more correct, not cleaner or more elegant") or an introduction opened by a sequence word ("First, outside a block, …"), and an example phrase set off by commas between a subject and its predicate ("X, such as Y, are excluded and are not…") is not counted as an item.
|
|
45
45
|
level_meaning:
|
|
46
46
|
ja: 少ないほうの打ち方が {limit} 箇所以下のとき指摘
|
|
47
47
|
en: reported when the minority style appears {limit} times or fewer
|