@chaffjs/lang-en 0.29.0 → 0.31.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/lexicons.d.ts.map +1 -1
- package/dist/lexicons.js +3 -0
- package/dist/lexicons.js.map +1 -1
- package/lexicons/breakdown-partial-word.yaml +14 -0
- package/lexicons/closing-balance-label.yaml +3 -0
- package/lexicons/dated-pair-label.yaml +27 -5
- package/lexicons/dated-signer-label.yaml +11 -0
- package/lexicons/dated-span-label.yaml +4 -2
- package/lexicons/fact-attribute.yaml +22 -0
- package/lexicons/fact-document-term.yaml +6 -0
- package/lexicons/fact-per-unit.yaml +10 -0
- package/lexicons/fact-term-restating.yaml +10 -0
- package/lexicons/formula-amount-word.yaml +13 -0
- package/lexicons/heading-announcer.yaml +46 -0
- package/lexicons/installment-label.yaml +14 -0
- package/lexicons/installment-word.yaml +25 -0
- package/lexicons/instruction-verb.yaml +10 -0
- package/lexicons/piece-count-column.yaml +19 -0
- package/lexicons/range-start-end.yaml +29 -0
- package/lexicons/reference-label.yaml +7 -0
- package/lexicons/total-back-reference.yaml +16 -0
- package/lexicons/total-breakdown-lead.yaml +9 -0
- package/package.json +2 -2
- package/src/lexicons.ts +4 -0
package/dist/lexicons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicons.d.ts","sourceRoot":"","sources":["../src/lexicons.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"lexicons.d.ts","sourceRoot":"","sources":["../src/lexicons.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AA6B5D;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAK,MAAY,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CASpE,CAAC"}
|
package/dist/lexicons.js
CHANGED
|
@@ -2,6 +2,7 @@ import { parse } from "yaml";
|
|
|
2
2
|
import { PACKAGE_DIR, joinPath, readDir, readText } from "./package-files.js";
|
|
3
3
|
const DIR = joinPath(PACKAGE_DIR, "lexicons");
|
|
4
4
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5
|
+
const isStringList = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
5
6
|
const POSITIONS = ["before", "after"];
|
|
6
7
|
const toEntry = (raw) => {
|
|
7
8
|
if (!isRecord(raw) || typeof raw["pattern"] !== "string")
|
|
@@ -10,6 +11,7 @@ const toEntry = (raw) => {
|
|
|
10
11
|
const instead = raw["instead_of"];
|
|
11
12
|
const rewrite = raw["rewrite"];
|
|
12
13
|
const group = raw["group"];
|
|
14
|
+
const genres = raw["genres"];
|
|
13
15
|
return {
|
|
14
16
|
pattern: raw["pattern"],
|
|
15
17
|
weight: typeof weight === "number" ? weight : undefined,
|
|
@@ -17,6 +19,7 @@ const toEntry = (raw) => {
|
|
|
17
19
|
position: POSITIONS.find((position) => position === raw["position"]),
|
|
18
20
|
rewrite: typeof rewrite === "string" ? rewrite : undefined,
|
|
19
21
|
...(typeof group === "string" ? { group } : {}),
|
|
22
|
+
...(isStringList(genres) ? { genres } : {}),
|
|
20
23
|
};
|
|
21
24
|
};
|
|
22
25
|
/**
|
package/dist/lexicons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicons.js","sourceRoot":"","sources":["../src/lexicons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAE9C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,OAAO,KAAK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AC;AAC3F,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Words that, between a total and the amounts after it, show the amounts may not be every item of the total: only some of
|
|
2
|
+
# them ("including $5,000 for design"), alternatives ("$5,000 or $6,000") or limits ("up to $5,000").
|
|
3
|
+
# total-mismatch does not compare such a breakdown.
|
|
4
|
+
id: breakdown-partial-word
|
|
5
|
+
language: en
|
|
6
|
+
entries:
|
|
7
|
+
- pattern: including
|
|
8
|
+
- pattern: includes
|
|
9
|
+
- pattern: such as
|
|
10
|
+
- pattern: among them
|
|
11
|
+
- pattern: at least
|
|
12
|
+
- pattern: " or "
|
|
13
|
+
- pattern: either
|
|
14
|
+
- pattern: up to
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# of the period), inflow (the total paid in), outflow (the total paid out) or closing (the balance at the end). When one
|
|
3
3
|
# table or one section has one word each of the four, each with an amount, the closing balance is compared with opening
|
|
4
4
|
# + inflow - outflow. A table heading, row label or line label that is only this word (a unit in brackets aside) is read.
|
|
5
|
+
# Group as-of marks a bracketed note that dates a balance (Previous balance (as of June 30, 2026)): a date, not a unit.
|
|
5
6
|
# Previous balance and New balance stand with Points earned and Points used: a card statement uses them for an amount owed,
|
|
6
7
|
# which credits reduce, but no word here names a card's payments or purchases, and points are not compared with dollars.
|
|
7
8
|
# Credits and Debits alone are left out for the same reason: on a card or loan statement credits lower the balance.
|
|
@@ -33,3 +34,5 @@ entries:
|
|
|
33
34
|
- { pattern: Balance carried forward, group: closing }
|
|
34
35
|
- { pattern: Balance at the end of this month, group: closing }
|
|
35
36
|
- { pattern: New balance, group: closing }
|
|
37
|
+
- { pattern: as of, group: as-of }
|
|
38
|
+
- { pattern: as at, group: as-of }
|
|
@@ -39,6 +39,18 @@ entries:
|
|
|
39
39
|
- { pattern: "Date collected", group: checkup-report, position: before }
|
|
40
40
|
- { pattern: "Report date", group: checkup-report, position: after }
|
|
41
41
|
- { pattern: "Date reported", group: checkup-report, position: after }
|
|
42
|
+
# A results report's issue date comes after the examination or the sample too. It is read only when the title or a
|
|
43
|
+
# field's label names the results, to keep it apart from an admission ticket or a lab order.
|
|
44
|
+
- { pattern: "Examination date", group: checkup-result-issue, position: before }
|
|
45
|
+
- { pattern: "Test date", group: checkup-result-issue, position: before }
|
|
46
|
+
- { pattern: "Collection date", group: checkup-result-issue, position: before }
|
|
47
|
+
- { pattern: "Date collected", group: checkup-result-issue, position: before }
|
|
48
|
+
- { pattern: "Issue date", group: checkup-result-issue, position: after }
|
|
49
|
+
- { pattern: "Date of issue", group: checkup-result-issue, position: after }
|
|
50
|
+
- { pattern: "Test results", group: checkup-result-issue }
|
|
51
|
+
- { pattern: "Laboratory results", group: checkup-result-issue }
|
|
52
|
+
- { pattern: "Lab results", group: checkup-result-issue }
|
|
53
|
+
- { pattern: "Results report", group: checkup-result-issue }
|
|
42
54
|
# A product warranty: the registration deadline comes after the purchase.
|
|
43
55
|
- { pattern: "Purchase date", group: warranty, position: before }
|
|
44
56
|
- { pattern: "Date of purchase", group: warranty, position: before }
|
|
@@ -97,8 +109,8 @@ entries:
|
|
|
97
109
|
- { pattern: "Check-in date", group: cancel, position: after }
|
|
98
110
|
- { pattern: "Pick-up", group: cancel, position: after }
|
|
99
111
|
- { pattern: "Pick-up date", group: cancel, position: after }
|
|
100
|
-
# A payslip: the pay date
|
|
101
|
-
# by its
|
|
112
|
+
# A payslip: the pay date does not come before the pay period starts. Pay can come in the middle of the period (on the
|
|
113
|
+
# 25th for the whole month), so the pay period line is compared by its start (dated-span-label).
|
|
102
114
|
- { pattern: "Pay period", group: payroll, position: before }
|
|
103
115
|
- { pattern: "Pay date", group: payroll, position: after }
|
|
104
116
|
# A trip or an expense report: the return does not come before the departure. A same-day return (a day trip) is not
|
|
@@ -140,12 +152,19 @@ entries:
|
|
|
140
152
|
- { pattern: "Date of claim", group: incident, position: after }
|
|
141
153
|
- { pattern: "Claim date", group: incident, position: after }
|
|
142
154
|
# An annual earnings and tax withholding statement is issued once the tax year has ended or, for a leaver, after the
|
|
143
|
-
# leaving date. "Period covered" is left out
|
|
155
|
+
# leaving date. "Period covered" is left out of this group (tax-statement-period below).
|
|
144
156
|
- { pattern: "Tax year", group: tax-statement, position: before }
|
|
145
157
|
- { pattern: "Leaving date", group: tax-statement, position: before }
|
|
146
158
|
- { pattern: "Date of leaving", group: tax-statement, position: before }
|
|
147
159
|
- { pattern: "Issue date", group: tax-statement, position: after }
|
|
148
160
|
- { pattern: "Date of issue", group: tax-statement, position: after }
|
|
161
|
+
# The period covered is compared with the issue date only on a statement whose title or a field's label names the tax
|
|
162
|
+
# withholding statement: an invoice billed in advance is issued at the start of the period it covers.
|
|
163
|
+
- { pattern: "Period covered", group: tax-statement-period, position: before }
|
|
164
|
+
- { pattern: "Issue date", group: tax-statement-period, position: after }
|
|
165
|
+
- { pattern: "Date of issue", group: tax-statement-period, position: after }
|
|
166
|
+
- { pattern: "Withholding statement", group: tax-statement-period }
|
|
167
|
+
- { pattern: "Tax statement", group: tax-statement-period }
|
|
149
168
|
# A packing list or a commercial invoice: the goods do not arrive before they are shipped. An estimated date (Estimated
|
|
150
169
|
# arrival, ETA) is only ever the later side. The invoice date is left out: an invoice is dated before or after shipment.
|
|
151
170
|
- { pattern: "On-board date", group: shipping, position: before }
|
|
@@ -215,10 +234,13 @@ entries:
|
|
|
215
234
|
- { pattern: "Closing date", group: sale, position: after }
|
|
216
235
|
- { pattern: "Possession date", group: sale, position: after }
|
|
217
236
|
# A banquet or meeting room quote is accepted before the event, so it is not valid past the event date. The event's
|
|
218
|
-
# words make the pair: an invoice's or a coupon's validity sits beside no event date.
|
|
219
|
-
# header column names the quote
|
|
237
|
+
# words make the pair: an invoice's or a coupon's validity sits beside no event date. Quote and Quotation name the
|
|
238
|
+
# document: a table is read only when a header column names the quote, and lines only when the title does or a field's
|
|
239
|
+
# label is Quote number.
|
|
220
240
|
- { pattern: "Valid until", group: quote-validity, position: before }
|
|
221
241
|
- { pattern: "Quote valid until", group: quote-validity, position: before }
|
|
222
242
|
- { pattern: "Event date", group: quote-validity, position: after }
|
|
223
243
|
- { pattern: "Date of event", group: quote-validity, position: after }
|
|
224
244
|
- { pattern: "Quote", group: quote-validity }
|
|
245
|
+
- { pattern: "Quotation", group: quote-validity }
|
|
246
|
+
- { pattern: "Quote number", group: quote-validity }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Role words read on a signature line. group and position are as in dated-pair-label: the signature line's date is the
|
|
2
|
+
# group's later date (due-before-issue). A signature line holds one date, this word and a name, and nothing else
|
|
3
|
+
# (Jane Doe, Honorary Auditor, April 12, 2026). A sentence, a line without a name, or another role (Chair) is not read.
|
|
4
|
+
# A line headed by a label is read by dated-pair-label.
|
|
5
|
+
id: dated-signer-label
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
# A treasurer's report's audit signature. The accounts are audited after the financial year ends.
|
|
9
|
+
- { pattern: "Auditor", group: fiscal-audit, position: after }
|
|
10
|
+
- { pattern: "Honorary Auditor", group: fiscal-audit, position: after }
|
|
11
|
+
- { pattern: "Hon. Auditor", group: fiscal-audit, position: after }
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# The dated-pair-label words whose line states a period rather than one date ("Reporting period: April 1, 2025 to
|
|
2
2
|
# March 31, 2026"). due-before-issue compares the period's end as the pair's earlier date; a period written without a
|
|
3
|
-
# year is not compared.
|
|
3
|
+
# year is not compared. An entry with a group and position before is compared by the period's start, in that group only:
|
|
4
|
+
# pay can come in the middle of its pay period (on the 25th for the whole month), so only a pay date before the period
|
|
5
|
+
# starts is reported.
|
|
4
6
|
id: dated-span-label
|
|
5
7
|
language: en
|
|
6
8
|
entries:
|
|
7
9
|
- pattern: Reporting period
|
|
8
10
|
- pattern: Period covered
|
|
9
|
-
- pattern: Pay period
|
|
10
11
|
- pattern: Tax year
|
|
11
12
|
- pattern: Fiscal year
|
|
12
13
|
- pattern: Financial year
|
|
14
|
+
- { pattern: Pay period, group: payroll, position: before }
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# Phrases naming an attribute (fact-conflict, summary-fact-mismatch), written before the value: "headquartered in Austin".
|
|
2
|
+
# The reader's entry age limit, written as what the reader can do up to an age ("You can apply up to the age of 70"): the
|
|
3
|
+
# value right after the phrase is the item fact-document-term groups as age-limit. A phrase about someone else ("Children
|
|
4
|
+
# can travel free up to the age of 12") or about renewal is another limit and is not here. group clause: the phrase is a
|
|
5
|
+
# clause with its own subject, so a phrase before it and a comma ("For the basic plan, you can apply") is a condition.
|
|
2
6
|
id: fact-attribute
|
|
3
7
|
language: en
|
|
4
8
|
entries:
|
|
5
9
|
- pattern: headquartered in
|
|
6
10
|
position: before
|
|
11
|
+
- pattern: you can apply
|
|
12
|
+
position: before
|
|
13
|
+
group: clause
|
|
14
|
+
- pattern: you can join
|
|
15
|
+
position: before
|
|
16
|
+
group: clause
|
|
17
|
+
- pattern: you can enrol
|
|
18
|
+
position: before
|
|
19
|
+
group: clause
|
|
20
|
+
- pattern: you can enroll
|
|
21
|
+
position: before
|
|
22
|
+
group: clause
|
|
23
|
+
- pattern: you can buy this policy
|
|
24
|
+
position: before
|
|
25
|
+
group: clause
|
|
26
|
+
- pattern: you can take out this policy
|
|
27
|
+
position: before
|
|
28
|
+
group: clause
|
|
@@ -17,6 +17,12 @@ entries:
|
|
|
17
17
|
- { pattern: maximum age, group: age-limit }
|
|
18
18
|
- { pattern: maximum entry age, group: age-limit }
|
|
19
19
|
- { pattern: maximum age at entry, group: age-limit }
|
|
20
|
+
- { pattern: you can apply, group: age-limit }
|
|
21
|
+
- { pattern: you can join, group: age-limit }
|
|
22
|
+
- { pattern: you can enrol, group: age-limit }
|
|
23
|
+
- { pattern: you can enroll, group: age-limit }
|
|
24
|
+
- { pattern: you can buy this policy, group: age-limit }
|
|
25
|
+
- { pattern: you can take out this policy, group: age-limit }
|
|
20
26
|
# The length of a warranty ("the warranty runs for 12 months" names it as the warranty). An extended warranty is
|
|
21
27
|
# another name.
|
|
22
28
|
- { pattern: warranty period, group: warranty-period }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Shapes saying a value is per a unit (fact-conflict, summary-fact-mismatch, cross-doc-fact-conflict). * is the unit word
|
|
2
|
+
# (per mile), read only when rate-unit names it (a quantity: hour, day, mile). position is the side of the value it is written
|
|
3
|
+
# on ($0.45 per mile: after). A value per a quantity is a price, a different thing from the amount it multiplies into, so the
|
|
4
|
+
# two are not compared. "for each transfer" is not a quantity and is compared as before. Fixed marks (a day, /km) are per-unit-mark.
|
|
5
|
+
id: fact-per-unit
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
- { pattern: "per *", position: after }
|
|
9
|
+
- { pattern: "for each *", position: after }
|
|
10
|
+
- { pattern: "/*", position: after }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# The start of a phrase written right after a one-value item's name (fact-document-term, fact-conflict) to say what the
|
|
2
|
+
# value was used for: "the number of dependants used for the dependant allowance" is the number of dependants. A phrase
|
|
3
|
+
# that narrows the item to a part ("the number of dependants used for children under 17", "applied to part-time staff")
|
|
4
|
+
# is not here: only a purpose named with "the" is.
|
|
5
|
+
id: fact-term-restating
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
- pattern: used for the
|
|
9
|
+
- pattern: used in the
|
|
10
|
+
- pattern: used to calculate the
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# The words of formula-amount-mismatch. rate-name stands between a rate and the amount it is of ("5% of the sale price");
|
|
2
|
+
# name-rate between the amount and its rate ("sale price × 5%"). plus comes before a fixed amount added to the rate's part
|
|
3
|
+
# ("plus $500"). not-included says a tax is left out although a word of inclusion stands in it ("tax not included").
|
|
4
|
+
id: formula-amount-word
|
|
5
|
+
language: en
|
|
6
|
+
entries:
|
|
7
|
+
- { pattern: of the, group: rate-name }
|
|
8
|
+
- { pattern: of, group: rate-name }
|
|
9
|
+
- { pattern: ×, group: name-rate }
|
|
10
|
+
- { pattern: plus, group: plus }
|
|
11
|
+
- { pattern: "+", group: plus }
|
|
12
|
+
- { pattern: not included, group: not-included }
|
|
13
|
+
- { pattern: not incl., group: not-included }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Words in a section's first sentence that announce or point at the section instead of saying something about its
|
|
2
|
+
# subject (This section covers installation. Charges are described below.). heading-echo still reports a sentence whose
|
|
3
|
+
# only predicate is one of these; a sentence with a verb or a copula's complement of its own (All charges include sales
|
|
4
|
+
# tax.) states a fact and is not reported. Matched against the word's base form. group copula: a linking verb, whose
|
|
5
|
+
# complement on the given side is the predicate. group negation: a word that denies what the copula links (There are no
|
|
6
|
+
# issues.), which is a claim. An imperative with one of these verbs (Give feedback in private.) is still reported.
|
|
7
|
+
id: heading-announcer
|
|
8
|
+
language: en
|
|
9
|
+
entries:
|
|
10
|
+
- pattern: be
|
|
11
|
+
group: copula
|
|
12
|
+
position: after
|
|
13
|
+
- pattern: "no"
|
|
14
|
+
group: negation
|
|
15
|
+
- pattern: not
|
|
16
|
+
group: negation
|
|
17
|
+
- pattern: never
|
|
18
|
+
group: negation
|
|
19
|
+
- pattern: n't
|
|
20
|
+
group: negation
|
|
21
|
+
- pattern: cover
|
|
22
|
+
- pattern: describe
|
|
23
|
+
- pattern: explain
|
|
24
|
+
- pattern: list
|
|
25
|
+
- pattern: outline
|
|
26
|
+
- pattern: introduce
|
|
27
|
+
- pattern: discuss
|
|
28
|
+
- pattern: summarize
|
|
29
|
+
- pattern: summarise
|
|
30
|
+
- pattern: show
|
|
31
|
+
- pattern: detail
|
|
32
|
+
- pattern: provide
|
|
33
|
+
- pattern: contain
|
|
34
|
+
- pattern: give
|
|
35
|
+
- pattern: tell
|
|
36
|
+
- pattern: mention
|
|
37
|
+
- pattern: read
|
|
38
|
+
- pattern: let
|
|
39
|
+
- pattern: see
|
|
40
|
+
- pattern: refer
|
|
41
|
+
- pattern: below
|
|
42
|
+
- pattern: following
|
|
43
|
+
- pattern: follow
|
|
44
|
+
- pattern: section
|
|
45
|
+
- pattern: chapter
|
|
46
|
+
- pattern: page
|
|
@@ -31,3 +31,17 @@ entries:
|
|
|
31
31
|
- { pattern: Total amount payable, group: total }
|
|
32
32
|
- { pattern: Total amount repayable, group: total }
|
|
33
33
|
- { pattern: Total repayable, group: total }
|
|
34
|
+
# numbered labels a table row or a list item of a series of instalments; {n} is its number (1st payment, Instalment 2,
|
|
35
|
+
# Second payment). final is the last one after the others, deposit a deposit listed as one of them. They are added up
|
|
36
|
+
# and compared with the fee stated in the same section ("The trip costs £300 per student").
|
|
37
|
+
- { pattern: "{n} payment", group: numbered }
|
|
38
|
+
- { pattern: "{n} instalment", group: numbered }
|
|
39
|
+
- { pattern: "{n} installment", group: numbered }
|
|
40
|
+
- { pattern: "Payment {n}", group: numbered }
|
|
41
|
+
- { pattern: "Instalment {n}", group: numbered }
|
|
42
|
+
- { pattern: "Installment {n}", group: numbered }
|
|
43
|
+
- { pattern: Final payment, group: final }
|
|
44
|
+
- { pattern: Final instalment, group: final }
|
|
45
|
+
- { pattern: Final installment, group: final }
|
|
46
|
+
- { pattern: Last payment, group: final }
|
|
47
|
+
- { pattern: Deposit, group: deposit }
|
|
@@ -43,3 +43,28 @@ entries:
|
|
|
43
43
|
- { pattern: residual, group: skip }
|
|
44
44
|
- { pattern: deferred, group: skip }
|
|
45
45
|
- { pattern: trade-in, group: skip }
|
|
46
|
+
# ordinal is a number written as a word in a numbered instalment (First payment), with its value. payment says a section
|
|
47
|
+
# is about paying instalments; one must stand in the section of the series. fee states the fee, and fee-link may stand
|
|
48
|
+
# between it and its amount ("The fee per student is $130").
|
|
49
|
+
- { pattern: first, weight: 1, group: ordinal }
|
|
50
|
+
- { pattern: second, weight: 2, group: ordinal }
|
|
51
|
+
- { pattern: third, weight: 3, group: ordinal }
|
|
52
|
+
- { pattern: fourth, weight: 4, group: ordinal }
|
|
53
|
+
- { pattern: fifth, weight: 5, group: ordinal }
|
|
54
|
+
- { pattern: sixth, weight: 6, group: ordinal }
|
|
55
|
+
- { pattern: seventh, weight: 7, group: ordinal }
|
|
56
|
+
- { pattern: eighth, weight: 8, group: ordinal }
|
|
57
|
+
- { pattern: ninth, weight: 9, group: ordinal }
|
|
58
|
+
- { pattern: tenth, weight: 10, group: ordinal }
|
|
59
|
+
- { pattern: payment, group: payment }
|
|
60
|
+
- { pattern: payments, group: payment }
|
|
61
|
+
- { pattern: instalment, group: payment }
|
|
62
|
+
- { pattern: instalments, group: payment }
|
|
63
|
+
- { pattern: installment, group: payment }
|
|
64
|
+
- { pattern: installments, group: payment }
|
|
65
|
+
- { pattern: costs, group: fee }
|
|
66
|
+
- { pattern: fee, group: fee }
|
|
67
|
+
- { pattern: per student, group: fee-link }
|
|
68
|
+
- { pattern: per pupil, group: fee-link }
|
|
69
|
+
- { pattern: per child, group: fee-link }
|
|
70
|
+
- { pattern: per person, group: fee-link }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Verbs that open an instruction (Click Save, Scroll down) but that the tagger's dictionary knows only as nouns or not
|
|
2
|
+
# at all. list-item-form-mix reads a list item opening with one as opening with a verb. A word the tagger already reads
|
|
3
|
+
# as a verb (select, tap) needs no entry. Matched in lower case.
|
|
4
|
+
id: instruction-verb
|
|
5
|
+
language: en
|
|
6
|
+
entries:
|
|
7
|
+
- pattern: click
|
|
8
|
+
- pattern: scroll
|
|
9
|
+
- pattern: swipe
|
|
10
|
+
- pattern: toggle
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# A quantity column that counts whatever its row hires or buys: "4 days" for the car, then "1" for one child seat
|
|
2
|
+
# (number-without-unit). group: column is the column's heading; group: period is a unit of a hired period. In a column
|
|
3
|
+
# whose other values carry a period unit, a bare whole number is a count of pieces, not a value that lost its unit.
|
|
4
|
+
id: piece-count-column
|
|
5
|
+
language: en
|
|
6
|
+
entries:
|
|
7
|
+
- { pattern: Quantity, group: column }
|
|
8
|
+
- { pattern: Qty, group: column }
|
|
9
|
+
- { pattern: Qty., group: column }
|
|
10
|
+
- { pattern: day, group: period }
|
|
11
|
+
- { pattern: days, group: period }
|
|
12
|
+
- { pattern: night, group: period }
|
|
13
|
+
- { pattern: nights, group: period }
|
|
14
|
+
- { pattern: week, group: period }
|
|
15
|
+
- { pattern: weeks, group: period }
|
|
16
|
+
- { pattern: month, group: period }
|
|
17
|
+
- { pattern: months, group: period }
|
|
18
|
+
- { pattern: hour, group: period }
|
|
19
|
+
- { pattern: hours, group: period }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# A period written with a start word and an end word in one sentence: "The term starts on 1 April 2026 and ends on
|
|
2
|
+
# 31 March 2027" (date-range-reversed). group start goes right before the first date, group end right before the second,
|
|
3
|
+
# and only a group joint word stands between them besides the end word. A sentence with two start words or two end words
|
|
4
|
+
# is not read: which date belongs to which period is not certain ("Phase 1 starts on … and Phase 2 starts on …").
|
|
5
|
+
id: range-start-end
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
- { pattern: starts on, group: start }
|
|
9
|
+
- { pattern: start on, group: start }
|
|
10
|
+
- { pattern: starting on, group: start }
|
|
11
|
+
- { pattern: begins on, group: start }
|
|
12
|
+
- { pattern: begin on, group: start }
|
|
13
|
+
- { pattern: beginning on, group: start }
|
|
14
|
+
- { pattern: commences on, group: start }
|
|
15
|
+
- { pattern: commence on, group: start }
|
|
16
|
+
- { pattern: commencing on, group: start }
|
|
17
|
+
- { pattern: ends on, group: end }
|
|
18
|
+
- { pattern: end on, group: end }
|
|
19
|
+
- { pattern: ending on, group: end }
|
|
20
|
+
- { pattern: expires on, group: end }
|
|
21
|
+
- { pattern: expire on, group: end }
|
|
22
|
+
- { pattern: expiring on, group: end }
|
|
23
|
+
- { pattern: terminates on, group: end }
|
|
24
|
+
- { pattern: terminate on, group: end }
|
|
25
|
+
- { pattern: terminating on, group: end }
|
|
26
|
+
- { pattern: and, group: joint }
|
|
27
|
+
- { pattern: ", and", group: joint }
|
|
28
|
+
- { pattern: and shall, group: joint }
|
|
29
|
+
- { pattern: and will, group: joint }
|
|
@@ -122,6 +122,13 @@ entries:
|
|
|
122
122
|
- { pattern: sku, group: item }
|
|
123
123
|
- { pattern: product code, group: item }
|
|
124
124
|
- { pattern: product code is, group: item }
|
|
125
|
+
# A product's model. Like item codes, two labelled or tabled models are two products and are never compared.
|
|
126
|
+
- { pattern: model, group: model }
|
|
127
|
+
- { pattern: model is, group: model }
|
|
128
|
+
- { pattern: model number, group: model }
|
|
129
|
+
- { pattern: model number is, group: model }
|
|
130
|
+
- { pattern: model no., group: model }
|
|
131
|
+
- { pattern: model no, group: model }
|
|
125
132
|
# A vehicle's plate. A bare "Registration" is not one: an attendee's registration is written so too.
|
|
126
133
|
- { pattern: registration plate, group: vehicle }
|
|
127
134
|
- { pattern: registration plate is, group: vehicle }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Words that open a sentence and point back to the total of the sentence before, just before a breakdown phrase
|
|
2
|
+
# ("The project costs a total of $12,000. This consists of $5,000 for design and $6,000 for development.").
|
|
3
|
+
# total-mismatch reads the next sentence's breakdown only when nothing, or one of these, comes before the phrase:
|
|
4
|
+
# "The maintenance plan consists of ..." is about another item.
|
|
5
|
+
id: total-back-reference
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
- pattern: this
|
|
9
|
+
- pattern: it
|
|
10
|
+
- pattern: that
|
|
11
|
+
- pattern: the total
|
|
12
|
+
- pattern: this total
|
|
13
|
+
- pattern: this amount
|
|
14
|
+
- pattern: the amount
|
|
15
|
+
- pattern: this sum
|
|
16
|
+
- pattern: the sum
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Marks that, right after the amount of a total phrase, start the list of every item of that total
|
|
2
|
+
# ("a total of $12,000: $5,000 for design and $6,000 for development").
|
|
3
|
+
# total-mismatch compares the total with the items up to the end of the sentence. "Including" and "of which" are left out: they may name only some of the items.
|
|
4
|
+
id: total-breakdown-lead
|
|
5
|
+
language: en
|
|
6
|
+
entries:
|
|
7
|
+
- pattern: ":"
|
|
8
|
+
- pattern: "—"
|
|
9
|
+
- pattern: "–"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaffjs/lang-en",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "English language adapter for chaff",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "isamu",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"url": "git+https://github.com/isamu/lab.git",
|
|
42
42
|
"directory": "text/packages/lang-en"
|
|
43
43
|
},
|
|
44
|
-
"homepage": "https://github.
|
|
44
|
+
"homepage": "https://isamu.github.io/lab/en/",
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
}
|
package/src/lexicons.ts
CHANGED
|
@@ -6,6 +6,8 @@ const DIR = joinPath(PACKAGE_DIR, "lexicons");
|
|
|
6
6
|
|
|
7
7
|
const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
8
|
|
|
9
|
+
const isStringList = (value: unknown): value is string[] => Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
10
|
+
|
|
9
11
|
const POSITIONS = ["before", "after"] as const;
|
|
10
12
|
|
|
11
13
|
const toEntry = (raw: unknown): LexiconEntry | undefined => {
|
|
@@ -14,6 +16,7 @@ const toEntry = (raw: unknown): LexiconEntry | undefined => {
|
|
|
14
16
|
const instead = raw["instead_of"];
|
|
15
17
|
const rewrite = raw["rewrite"];
|
|
16
18
|
const group = raw["group"];
|
|
19
|
+
const genres = raw["genres"];
|
|
17
20
|
return {
|
|
18
21
|
pattern: raw["pattern"],
|
|
19
22
|
weight: typeof weight === "number" ? weight : undefined,
|
|
@@ -21,6 +24,7 @@ const toEntry = (raw: unknown): LexiconEntry | undefined => {
|
|
|
21
24
|
position: POSITIONS.find((position) => position === raw["position"]),
|
|
22
25
|
rewrite: typeof rewrite === "string" ? rewrite : undefined,
|
|
23
26
|
...(typeof group === "string" ? { group } : {}),
|
|
27
|
+
...(isStringList(genres) ? { genres } : {}),
|
|
24
28
|
};
|
|
25
29
|
};
|
|
26
30
|
|