@finbheara/domain 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/chunks/{place-jksxqsqb.js → place-17e26rga.js} +26 -4
- package/dist/place.js +2 -1
- package/dist/school.js +31 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ A `Place` is one of four arms: `resolved`, `plural` (a print naming more than on
|
|
|
105
105
|
says they cannot be one place; `same`, `contains` and `overlaps` do not.
|
|
106
106
|
|
|
107
107
|
A print that is clearly not a place is refused, with its reason: a placeholder
|
|
108
|
-
(`[address withheld]`, `
|
|
108
|
+
(`[address withheld]`, `TBA`), a URL anywhere in the print (`web`), an online event in the
|
|
109
109
|
venue field (`online`), a change-of-venue notice (`notice`), or a replacement character where
|
|
110
110
|
the source lost bytes (`damaged`). These are asked only where the store reads nothing, so a
|
|
111
111
|
refusal never takes a reading away. Mojibake that can be decoded back is not refused: repair it
|
|
@@ -171,7 +171,8 @@ compareSchoolNames("Ardvarna Academy", "Ardvarna Academy (Ontario)", reader);
|
|
|
171
171
|
### Your own garbage
|
|
172
172
|
|
|
173
173
|
The shipped refusals are generic: a card number, keyboard filler, a run with no letter in it,
|
|
174
|
-
|
|
174
|
+
what a school cell prints where no school was entered (`N/A`, `No School`, `-- Choose One --`,
|
|
175
|
+
...). What YOUR data
|
|
175
176
|
prints in a school field and is not a school, such as an entry system's own "school not
|
|
176
177
|
listed" instruction, a test entry, or a note typed into the wrong field, is yours to declare.
|
|
177
178
|
Pass it as `garbage`, the same idea as `phraseClassifier(lexicon, { garbageVocab })` in
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SHARED_ROW_SENTINELS2,
|
|
3
|
+
sentinelIn2
|
|
4
|
+
} from "./place-tcgfvemw.js";
|
|
1
5
|
import {
|
|
2
6
|
validity
|
|
3
7
|
} from "./place-q9kwsmzd.js";
|
|
4
8
|
|
|
5
|
-
import { isPlaceholderPrint } from "@finbheara/names/normalize";
|
|
6
|
-
|
|
7
9
|
var PLACE_NODES = [
|
|
8
10
|
{
|
|
9
11
|
id: "world",
|
|
@@ -6781,6 +6783,8 @@ function inWebSpan(at, index) {
|
|
|
6781
6783
|
}
|
|
6782
6784
|
|
|
6783
6785
|
var DEFAULT_PLACE_CAPACITY2 = 8192;
|
|
6786
|
+
var PLACE_CELL_SENTINELS = [...SHARED_ROW_SENTINELS2];
|
|
6787
|
+
var placeCellSentinelOf = sentinelIn2(PLACE_CELL_SENTINELS);
|
|
6784
6788
|
function createPlaceReader2(options = {}) {
|
|
6785
6789
|
const nodes = options.tree ?? PLACE_NODES;
|
|
6786
6790
|
let index;
|
|
@@ -6822,7 +6826,7 @@ function createPlaceReader2(options = {}) {
|
|
|
6822
6826
|
return "online";
|
|
6823
6827
|
if (folded === NOTICE || folded.startsWith(`${NOTICE} `))
|
|
6824
6828
|
return "notice";
|
|
6825
|
-
if (
|
|
6829
|
+
if (placeCellSentinelOf(raw) !== undefined)
|
|
6826
6830
|
return "placeholder";
|
|
6827
6831
|
return;
|
|
6828
6832
|
}
|
|
@@ -7415,6 +7419,24 @@ function createPlaceReader2(options = {}) {
|
|
|
7415
7419
|
}
|
|
7416
7420
|
return;
|
|
7417
7421
|
}
|
|
7422
|
+
function taggedHead(core, declared) {
|
|
7423
|
+
const m = /^(.*\S)\s*(?:\(([^()[\]{}]*)\)|\[([^()[\]{}]*)\])$/su.exec(core);
|
|
7424
|
+
if (m === null)
|
|
7425
|
+
return;
|
|
7426
|
+
const head = m[1];
|
|
7427
|
+
const tag = (m[2] ?? m[3] ?? "").trim();
|
|
7428
|
+
if (fold(head) === "" || fold(tag) === "")
|
|
7429
|
+
return;
|
|
7430
|
+
const h = read(head, declared);
|
|
7431
|
+
const t = read(tag, declared);
|
|
7432
|
+
if (h.refusal !== null || t.refusal !== null || h.heads.length === 0 || t.heads.length === 0)
|
|
7433
|
+
return;
|
|
7434
|
+
const held = (n) => t.heads.some((x) => isAncestor(x, n));
|
|
7435
|
+
if (h.members !== undefined)
|
|
7436
|
+
return h.members.every(held) ? h : undefined;
|
|
7437
|
+
const kept = h.heads.filter(held);
|
|
7438
|
+
return kept.length === 0 ? undefined : { ...h, heads: kept };
|
|
7439
|
+
}
|
|
7418
7440
|
function pieced(left, country) {
|
|
7419
7441
|
if (namedInside(left, country).length > 0)
|
|
7420
7442
|
return [left];
|
|
@@ -7569,7 +7591,7 @@ function createPlaceReader2(options = {}) {
|
|
|
7569
7591
|
}
|
|
7570
7592
|
const first = sane[0];
|
|
7571
7593
|
if (first === undefined)
|
|
7572
|
-
return (smushed ? desmush(core, declared) : undefined) ?? NOTHING;
|
|
7594
|
+
return taggedHead(core, declared) ?? (smushed ? desmush(core, declared) : undefined) ?? NOTHING;
|
|
7573
7595
|
if (sane.length === 1)
|
|
7574
7596
|
return first;
|
|
7575
7597
|
const heads = [];
|
package/dist/place.js
CHANGED
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
placesRelation2,
|
|
18
18
|
probablySamePlace2,
|
|
19
19
|
sameReading2
|
|
20
|
-
} from "./chunks/place-
|
|
20
|
+
} from "./chunks/place-17e26rga.js";
|
|
21
|
+
import"./chunks/place-tcgfvemw.js";
|
|
21
22
|
export {
|
|
22
23
|
DEFAULT_PLACE_CAPACITY2 as DEFAULT_PLACE_CAPACITY,
|
|
23
24
|
DEFAULT_PLACE_READER2 as DEFAULT_PLACE_READER,
|
package/dist/school.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SHARED_ROW_SENTINELS2,
|
|
3
|
+
sentinelIn2
|
|
4
|
+
} from "./chunks/place-tcgfvemw.js";
|
|
1
5
|
import {
|
|
2
6
|
NEVER_NAME,
|
|
3
7
|
printZones,
|
|
@@ -8,11 +12,7 @@ import {
|
|
|
8
12
|
areAllPlaceTokens2,
|
|
9
13
|
placeRelation2,
|
|
10
14
|
sameReading2
|
|
11
|
-
} from "./chunks/place-
|
|
12
|
-
import {
|
|
13
|
-
SHARED_ROW_SENTINELS2,
|
|
14
|
-
sentinelIn2
|
|
15
|
-
} from "./chunks/place-tcgfvemw.js";
|
|
15
|
+
} from "./chunks/place-17e26rga.js";
|
|
16
16
|
import {
|
|
17
17
|
validity
|
|
18
18
|
} from "./chunks/place-q9kwsmzd.js";
|
|
@@ -21,8 +21,6 @@ import { normalizeApostrophes as normalizeApostrophes2 } from "@finbheara/names/
|
|
|
21
21
|
import { SURNAME_SEPARATOR, lexiconKey, titleCaseNamePart } from "@finbheara/names/normalize";
|
|
22
22
|
import { personName } from "@finbheara/names/normalize";
|
|
23
23
|
|
|
24
|
-
import { placeholderOf } from "@finbheara/names/normalize";
|
|
25
|
-
|
|
26
24
|
var SCHOOL_CELL_OWN_SENTINELS = [
|
|
27
25
|
{
|
|
28
26
|
print: "no school",
|
|
@@ -74,7 +72,31 @@ var SCHOOL_CELL_OWN_SENTINELS = [
|
|
|
74
72
|
print: "unknown irish dancing school",
|
|
75
73
|
authority: "`Unknown Irish Dancing School`: 1 school cell"
|
|
76
74
|
},
|
|
77
|
-
{ print: "none inactive dancer", authority: "`None - Inactive Dancer`: 1 school cell" }
|
|
75
|
+
{ print: "none inactive dancer", authority: "`None - Inactive Dancer`: 1 school cell" },
|
|
76
|
+
{ print: "not applicable", authority: "`Not applicable`: a school print, no school entered" },
|
|
77
|
+
{
|
|
78
|
+
print: "no school judge",
|
|
79
|
+
authority: "`No School - Judge`: an entry form's option for an adjudicator"
|
|
80
|
+
},
|
|
81
|
+
{ print: "no dance school", authority: "`No Dance School`: an entry form's option" },
|
|
82
|
+
{ print: "unknown music school", authority: "`Unknown Music School`: an entry form's option" },
|
|
83
|
+
{ print: "school deleted", authority: "`---SCHOOL DELETED`: an entry form's option" },
|
|
84
|
+
{ print: "select school", authority: "`--Select School--`: an entry form's unchosen option" },
|
|
85
|
+
{ print: "school other", authority: "`School Other`: an entry form's option" },
|
|
86
|
+
{ print: "non", authority: "`Non`: an entry form's option, the truncation of `Non-dancer`" },
|
|
87
|
+
{
|
|
88
|
+
print: "x closed select new school",
|
|
89
|
+
authority: "`X - CLOSED - Select New School`: an entry form's option for a closed school"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
print: "x school closed please select another school",
|
|
93
|
+
authority: "`X -SCHOOL CLOSED - Please select another school`: an entry form's option"
|
|
94
|
+
},
|
|
95
|
+
{ print: "default school", authority: "`Default School`: an entry form's default" },
|
|
96
|
+
{
|
|
97
|
+
print: "my school of irish dance",
|
|
98
|
+
authority: "`My School of Irish Dance`: an entry form's example text"
|
|
99
|
+
}
|
|
78
100
|
];
|
|
79
101
|
var SCHOOL_CELL_SENTINELS = [
|
|
80
102
|
...SHARED_ROW_SENTINELS2,
|
|
@@ -321,7 +343,7 @@ function notASchoolIn(rows) {
|
|
|
321
343
|
const text = normalizeForRefusal(print);
|
|
322
344
|
if (text === "")
|
|
323
345
|
return;
|
|
324
|
-
const placeholder = schoolCellSentinelOf(text)
|
|
346
|
+
const placeholder = schoolCellSentinelOf(text);
|
|
325
347
|
if (placeholder !== undefined)
|
|
326
348
|
return placeholderRow(placeholder);
|
|
327
349
|
for (const row of rows) {
|
package/package.json
CHANGED