@finbheara/domain 0.10.0 → 0.12.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 CHANGED
@@ -43,6 +43,7 @@ ESM, Node ≥ 22 or Bun ≥ 1.4.2. MIT. Not affiliated with or endorsed by any d
43
43
  | `@finbheara/domain/noun-index` | `createIndex`, `indexSchema`, `personEncoder`, and the `SqlHandle`/`NounEncoder` types: a database-backed name map (below) |
44
44
  | `@finbheara/domain/dance-types` | `danceTypes()`, `DANCE_TYPES`, `rhythmOfTime`, and the shared `DanceMatch`/`DanceRelation`/`SetRhythm`/`TimeSignature` types |
45
45
  | `@finbheara/domain/promotion` | `samePromotedRow`, `samePromotedSchool`, `samePromotedHeir`, `samePromotedName`, `questionMarksRead`, `foldCharSynonyms`: is a row the same row after a promotion (below) |
46
+ | `@finbheara/domain/person` | `seatName`, `dancerName`, `teacherName`, `roleName`, `roleSentinelOf`, `rolePrintsNoName`, `dancerPrintsNoName`, the role lists and `SHARED_ROW_SENTINELS`: a person's print read in its role (below) |
46
47
 
47
48
  The library does no I/O and installs nothing process-wide. Every reader has a default and a
48
49
  factory: build your own with options when the default is not what you want.
@@ -457,6 +458,34 @@ Anything else is another row: a different surname or given name, one letter prin
457
458
  another, a `?` over an ASCII letter, a school that differs anywhere but a trailing `: location`.
458
459
  The caller pairs the card; nothing here reads an address.
459
460
 
461
+ ## Read a person's print in its role
462
+
463
+ A person is printed in a role: an adjudicator's seat on a panel sheet, a dancer's name cell, a
464
+ teacher in a school's listing. Each role prints its own sentinels where no one is named, and a
465
+ person-name reader cannot anticipate them. Each role here has its own not-a-name list, asked
466
+ FIRST; a print on no list is handed to `@finbheara/names` unchanged.
467
+
468
+ ```ts
469
+ import { dancerName, seatName, teacherName } from "@finbheara/domain/person";
470
+
471
+ seatName("Withdrawn Adjudicator").isPerson(); // false: the seat's own sentinel
472
+ dancerName("Withdrawn Adjudicator").isPerson(); // true: no dancer list holds it
473
+ dancerName("Test Dancer", "given-first").isPerson(); // false: the dancer's own sentinel
474
+ teacherName("N/A").printsNoName(); // true: a shared row sentinel
475
+ seatName("Aoife Mhaolvarna").nn2; // "Mhaolvarna<<Aoife": names' own parse
476
+ ```
477
+
478
+ - **A refused print is still a `PersonName`**: `isPerson()` is false, `printsNoName()` is true,
479
+ `refusal.rule` is `"placeholder"`, the print levels keep the print, and every level from NN2
480
+ down is names' refused value. Ask the type, never the string.
481
+ - **One shared list** (`SHARED_ROW_SENTINELS`: `N/A`, `TBA`, `Unknown`) opens every role's list
482
+ and the school cell's (`SCHOOL_CELL_SENTINELS` on `/school`, asked by the school reader before
483
+ its own register), so a sentinel a whole row prints has one definition.
484
+ - Each row is the folded print (`foldNameKey`), what it stands for, and where it was seen.
485
+ - **The print alone** has the same answer: `rolePrintsNoName(role, print)` (and
486
+ `dancerPrintsNoName(print)`) is `roleName(role, print).printsNoName()` without the parse, for
487
+ a walk that parses no name. Names' `isNoNamePrint` alone misses a role's own sentinel.
488
+
460
489
  ## Known gaps
461
490
 
462
491
  - `place()` reads `"Derry in Ireland"` and `"Calgary in Western Canada"` as `unread`: it does
@@ -205,6 +205,8 @@ var PLACE_NODES = [
205
205
  "mid america region",
206
206
  "mid america region usa",
207
207
  "mid american region",
208
+ "middle america",
209
+ "middle america us",
208
210
  "reigiun lar meiricea",
209
211
  "usa mid america region"
210
212
  ],
@@ -234,7 +236,13 @@ var PLACE_NODES = [
234
236
  name: "New England Region USA",
235
237
  geo: "USA",
236
238
  admin: "IDTANA",
237
- prints: ["new england", "new england region", "new england region usa", "reigiun sasana nua"],
239
+ prints: [
240
+ "new england",
241
+ "new england region",
242
+ "new england region usa",
243
+ "new england us",
244
+ "reigiun sasana nua"
245
+ ],
238
246
  codes: ["NERO"],
239
247
  oireachtas: "NERO"
240
248
  },
@@ -251,6 +259,7 @@ var PLACE_NODES = [
251
259
  "so usa",
252
260
  "southern region",
253
261
  "southern region usa",
262
+ "southern us",
254
263
  "southern usa",
255
264
  "usa southern region"
256
265
  ],
@@ -3965,7 +3974,7 @@ var PLACE_NODES = [
3965
3974
  name: "District of Columbia",
3966
3975
  geo: "USA",
3967
3976
  admin: "IDTANA-SRO",
3968
- prints: ["district of columbia"],
3977
+ prints: ["d c", "district of columbia", "washington d c", "washington dc"],
3969
3978
  codes: ["DC", "DC-USA", "US-DC", "USA-DC"]
3970
3979
  },
3971
3980
  {
@@ -6478,6 +6487,15 @@ var PLACE_NODES = [
6478
6487
  prints: ["salt lake city"],
6479
6488
  codes: []
6480
6489
  },
6490
+ {
6491
+ id: "USA-VA/dulles",
6492
+ kind: "city",
6493
+ name: "Dulles",
6494
+ geo: "USA-VA",
6495
+ admin: "IDTANA-SRO",
6496
+ prints: ["dulles", "washington dulles"],
6497
+ codes: []
6498
+ },
6481
6499
  {
6482
6500
  id: "USA-VA/leesburg",
6483
6501
  kind: "city",
@@ -7847,10 +7865,89 @@ function createPlaceReader2(options = {}) {
7847
7865
  return made;
7848
7866
  }
7849
7867
  function placeFromId(id) {
7850
- const n = idx().byId.get(id.trim());
7851
- if (n === undefined)
7868
+ const key = id.trim();
7869
+ if (key.includes("+"))
7870
+ return pluralFromId(id, key);
7871
+ const n = idx().byId.get(key);
7872
+ if (n !== undefined)
7873
+ return build(id, [chainOf(n)], { heads: [n], match: "id", truncated: false, refusal: null }, []);
7874
+ for (let at = key.lastIndexOf("/");at > 0; at = key.lastIndexOf("/", at - 1)) {
7875
+ const above = idx().byId.get(key.slice(0, at));
7876
+ if (above !== undefined)
7877
+ return build(id, [chainOf(above)], { heads: [above], match: "id", truncated: true, refusal: null }, []);
7878
+ }
7879
+ return build(id, [], NOTHING, []);
7880
+ }
7881
+ function pluralFromId(id, key) {
7882
+ const members = [];
7883
+ for (const part of key.split("+")) {
7884
+ const n = idx().byId.get(part);
7885
+ if (n === undefined || members.some((m) => m.id === n.id))
7886
+ return build(id, [], NOTHING, []);
7887
+ members.push(n);
7888
+ }
7889
+ if (members.length < 2)
7852
7890
  return build(id, [], NOTHING, []);
7853
- return build(id, [chainOf(n)], { heads: [n], match: "id", truncated: false, refusal: null }, []);
7891
+ for (let a = 0;a < members.length; a++)
7892
+ for (let b = a + 1;b < members.length; b++)
7893
+ if (!twoPlaces(members[a], members[b]))
7894
+ return build(id, [], NOTHING, []);
7895
+ members.sort((x, y) => x.id.localeCompare(y.id));
7896
+ return build(id, chainsFor(members), {
7897
+ heads: members,
7898
+ match: "id",
7899
+ truncated: false,
7900
+ refusal: null,
7901
+ members
7902
+ }, []);
7903
+ }
7904
+ const MAX_WINDOW = 6;
7905
+ function segmentsOf(text) {
7906
+ return text.split(/[;:()[\]{}|]+/).map((seg) => seg.split(/[\s,\u2013\u2014]+|\s-\s|-(?=\p{Lu})/u).filter((t) => t !== "" && t !== "-")).filter((seg) => seg.length > 0);
7907
+ }
7908
+ function placeWindows(text, ctx) {
7909
+ const found = [];
7910
+ for (const tokens of segmentsOf(text)) {
7911
+ const taken = new Array(tokens.length).fill(false);
7912
+ const here = [];
7913
+ for (let w = Math.min(MAX_WINDOW, tokens.length);w >= 1; w--)
7914
+ for (let i = 0;i + w <= tokens.length; i++) {
7915
+ if (taken.slice(i, i + w).some((x) => x))
7916
+ continue;
7917
+ const span = tokens.slice(i, i + w);
7918
+ const p = place(span.join(" "), ctx);
7919
+ if (!p.isPlace() || p.truncated)
7920
+ continue;
7921
+ for (let k = i;k < i + w; k++)
7922
+ taken[k] = true;
7923
+ here.push({ at: i, r: { p, tokens: span } });
7924
+ }
7925
+ here.sort((a, b) => a.at - b.at);
7926
+ for (const [k, h] of here.entries()) {
7927
+ const n = here[k + 1];
7928
+ if (n !== undefined && n.at === h.at + h.r.tokens.length)
7929
+ h.r.next = n.r;
7930
+ }
7931
+ found.push(...here.map((f) => f.r));
7932
+ }
7933
+ return found;
7934
+ }
7935
+ function placeParts(print) {
7936
+ const core = unbracket(repair(print));
7937
+ const { tokens, seps } = cut(core);
7938
+ const pieces = [];
7939
+ let run = tokens[0] ?? "";
7940
+ for (let i = 0;i < seps.length; i++) {
7941
+ const next = tokens[i + 1] ?? "";
7942
+ if (seps[i] === "space")
7943
+ run = `${run} ${next}`;
7944
+ else {
7945
+ pieces.push(run);
7946
+ run = next;
7947
+ }
7948
+ }
7949
+ pieces.push(run);
7950
+ return pieces.filter((p) => p.trim() !== "").map((p) => place(p));
7854
7951
  }
7855
7952
  function oireachtasOfRegion(regionId) {
7856
7953
  if (regionId === undefined)
@@ -7945,6 +8042,8 @@ function createPlaceReader2(options = {}) {
7945
8042
  countryCodeOf,
7946
8043
  areAllPlaceTokens,
7947
8044
  placeFromId,
8045
+ placeParts,
8046
+ placeWindows,
7948
8047
  oireachtasOfRegion,
7949
8048
  regionOfOireachtas,
7950
8049
  placeStats,
@@ -7971,6 +8070,12 @@ function areAllPlaceTokens2(tokens, off = 0, declared = false) {
7971
8070
  function placeFromId2(id) {
7972
8071
  return DEFAULT_PLACE_READER2.placeFromId(id);
7973
8072
  }
8073
+ function placeWindows2(text, ctx) {
8074
+ return DEFAULT_PLACE_READER2.placeWindows(text, ctx);
8075
+ }
8076
+ function placeParts2(print) {
8077
+ return DEFAULT_PLACE_READER2.placeParts(print);
8078
+ }
7974
8079
  function oireachtasOfRegion2(regionId) {
7975
8080
  return DEFAULT_PLACE_READER2.oireachtasOfRegion(regionId);
7976
8081
  }
@@ -7996,4 +8101,4 @@ function sameReading2(a, b) {
7996
8101
  return DEFAULT_PLACE_READER2.sameReading(a, b);
7997
8102
  }
7998
8103
 
7999
- export { NEVER_NAME, printZones, opensLocation, DEFAULT_PLACE_CAPACITY2, createPlaceReader2, DEFAULT_PLACE_READER2, place2, isPlaceToken2, countryCodeOf2, areAllPlaceTokens2, placeFromId2, oireachtasOfRegion2, regionOfOireachtas2, placeStats2, resetPlaceCache2, placeRelation2, placesRelation2, probablySamePlace2, sameReading2 };
8104
+ export { NEVER_NAME, printZones, opensLocation, DEFAULT_PLACE_CAPACITY2, createPlaceReader2, DEFAULT_PLACE_READER2, place2, isPlaceToken2, countryCodeOf2, areAllPlaceTokens2, placeFromId2, placeWindows2, placeParts2, oireachtasOfRegion2, regionOfOireachtas2, placeStats2, resetPlaceCache2, placeRelation2, placesRelation2, probablySamePlace2, sameReading2 };
@@ -0,0 +1,30 @@
1
+ import { foldNameKey } from "@finbheara/names/normalize";
2
+ var SHARED_ROW_SENTINELS2 = [
3
+ {
4
+ print: "n a",
5
+ authority: "`#N/A`, a spreadsheet's missing-value mark: 66 name cells and 66 school cells of one transcribed sheet set"
6
+ },
7
+ {
8
+ print: "tba",
9
+ authority: "`TBA`: 1 name cell and 1 school cell"
10
+ },
11
+ {
12
+ print: "unknown",
13
+ authority: "`Unknown`, `unknown`, `*Unknown*`: 4 name cells and 186 school cells"
14
+ }
15
+ ];
16
+ function sentinelIn2(list) {
17
+ const exact = new Map;
18
+ for (const row of list)
19
+ if (row.match === undefined && !exact.has(row.print))
20
+ exact.set(row.print, row);
21
+ const prefix = list.filter((row) => row.match === "prefix");
22
+ return (print) => {
23
+ const folded = foldNameKey(print);
24
+ if (folded === "")
25
+ return;
26
+ return exact.get(folded) ?? prefix.find((row) => folded === row.print || folded.startsWith(`${row.print} `));
27
+ };
28
+ }
29
+
30
+ export { SHARED_ROW_SENTINELS2, sentinelIn2 };
package/dist/person.js ADDED
@@ -0,0 +1,135 @@
1
+ import {
2
+ SHARED_ROW_SENTINELS2,
3
+ sentinelIn2
4
+ } from "./chunks/place-tcgfvemw.js";
5
+
6
+ import {
7
+ NAME_REFUSED,
8
+ isNoNamePrint,
9
+ personName
10
+ } from "@finbheara/names/normalize";
11
+ var ADJUDICATOR_SENTINELS = [
12
+ {
13
+ print: "withdrawn adjudicator",
14
+ authority: "`Withdrawn Adjudicator`: 180 seat cells, one panel sheet's empty seat"
15
+ },
16
+ {
17
+ print: "no school judge",
18
+ authority: "`No School Judge`: an entry form's option for an adjudicator's entry"
19
+ }
20
+ ];
21
+ var DANCER_SENTINELS = [
22
+ {
23
+ print: "name withheld",
24
+ authority: "`Name Withheld`: 136 name cells, the entry platform printed that the name was withheld"
25
+ },
26
+ {
27
+ print: "test dancer",
28
+ authority: "`Test Dancer`: 7 name cells, an entry platform's test entry"
29
+ },
30
+ {
31
+ print: "none none",
32
+ authority: "`none none`: 4 name cells, the sentinel `none` typed into both name fields"
33
+ },
34
+ {
35
+ print: "not known",
36
+ authority: "`Not known`: 1 name cell"
37
+ },
38
+ {
39
+ print: "don t know",
40
+ authority: "`Don't Know`: 1 name cell"
41
+ }
42
+ ];
43
+ var TEACHER_SENTINELS = [];
44
+ var ROLE_SENTINELS = {
45
+ adjudicator: [...SHARED_ROW_SENTINELS2, ...ADJUDICATOR_SENTINELS],
46
+ dancer: [...SHARED_ROW_SENTINELS2, ...DANCER_SENTINELS],
47
+ teacher: [...SHARED_ROW_SENTINELS2, ...TEACHER_SENTINELS]
48
+ };
49
+ var MATCHERS = {
50
+ adjudicator: sentinelIn2(ROLE_SENTINELS.adjudicator),
51
+ dancer: sentinelIn2(ROLE_SENTINELS.dancer),
52
+ teacher: sentinelIn2(ROLE_SENTINELS.teacher)
53
+ };
54
+ function roleSentinelOf(role, print) {
55
+ return MATCHERS[role](print);
56
+ }
57
+ var NO_PART = Object.freeze({ particles: [], base: "", parts: [], tradition: null });
58
+
59
+ class RoleRefusedName {
60
+ [Symbol.toStringTag] = "PersonName";
61
+ nn0;
62
+ nn1;
63
+ nn2 = NAME_REFUSED;
64
+ nn3 = NAME_REFUSED;
65
+ nn4 = NAME_REFUSED;
66
+ surname = NO_PART;
67
+ given = [];
68
+ suffixes = [];
69
+ refusal;
70
+ verdict;
71
+ role;
72
+ sentinel;
73
+ constructor(read, role, sentinel) {
74
+ this.role = role;
75
+ this.sentinel = sentinel;
76
+ this.nn0 = read.nn0;
77
+ this.nn1 = read.nn1;
78
+ this.refusal = { rule: "placeholder", printed: read.nn0, value: NAME_REFUSED };
79
+ this.verdict = { kind: "refused", refusal: this.refusal, rules: read.verdict.rules };
80
+ }
81
+ toString() {
82
+ return this.nn2;
83
+ }
84
+ get length() {
85
+ return this.nn2.length;
86
+ }
87
+ surnameKey() {
88
+ return "";
89
+ }
90
+ givenFields() {
91
+ return [];
92
+ }
93
+ givenName() {
94
+ return "";
95
+ }
96
+ isTeam() {
97
+ return false;
98
+ }
99
+ isPerson() {
100
+ return false;
101
+ }
102
+ isEmpty() {
103
+ return false;
104
+ }
105
+ printsNoName() {
106
+ return true;
107
+ }
108
+ }
109
+ function roleName(role, print, order) {
110
+ const read = personName(print, order);
111
+ const sentinel = MATCHERS[role](print);
112
+ return sentinel === undefined ? read : new RoleRefusedName(read, role, sentinel);
113
+ }
114
+ function rolePrintsNoName(role, print) {
115
+ return MATCHERS[role](print) !== undefined || isNoNamePrint(print);
116
+ }
117
+ var dancerPrintsNoName = (print) => rolePrintsNoName("dancer", print);
118
+ var seatName = (print) => roleName("adjudicator", print, "given-first");
119
+ var dancerName = (print, order) => roleName("dancer", print, order);
120
+ var teacherName = (print, order) => roleName("teacher", print, order);
121
+ export {
122
+ ADJUDICATOR_SENTINELS,
123
+ DANCER_SENTINELS,
124
+ ROLE_SENTINELS,
125
+ SHARED_ROW_SENTINELS2 as SHARED_ROW_SENTINELS,
126
+ TEACHER_SENTINELS,
127
+ dancerName,
128
+ dancerPrintsNoName,
129
+ roleName,
130
+ rolePrintsNoName,
131
+ roleSentinelOf,
132
+ seatName,
133
+ sentinelIn2 as sentinelIn,
134
+ teacherName
135
+ };
package/dist/place.js CHANGED
@@ -7,6 +7,8 @@ import {
7
7
  countryCodeOf2,
8
8
  areAllPlaceTokens2,
9
9
  placeFromId2,
10
+ placeWindows2,
11
+ placeParts2,
10
12
  oireachtasOfRegion2,
11
13
  regionOfOireachtas2,
12
14
  placeStats2,
@@ -15,7 +17,7 @@ import {
15
17
  placesRelation2,
16
18
  probablySamePlace2,
17
19
  sameReading2
18
- } from "./chunks/place-tv86hmps.js";
20
+ } from "./chunks/place-jksxqsqb.js";
19
21
  export {
20
22
  DEFAULT_PLACE_CAPACITY2 as DEFAULT_PLACE_CAPACITY,
21
23
  DEFAULT_PLACE_READER2 as DEFAULT_PLACE_READER,
@@ -26,8 +28,10 @@ export {
26
28
  oireachtasOfRegion2 as oireachtasOfRegion,
27
29
  place2 as place,
28
30
  placeFromId2 as placeFromId,
31
+ placeParts2 as placeParts,
29
32
  placeRelation2 as placeRelation,
30
33
  placeStats2 as placeStats,
34
+ placeWindows2 as placeWindows,
31
35
  placesRelation2 as placesRelation,
32
36
  probablySamePlace2 as probablySamePlace,
33
37
  regionOfOireachtas2 as regionOfOireachtas,
package/dist/school.js CHANGED
@@ -8,7 +8,11 @@ import {
8
8
  areAllPlaceTokens2,
9
9
  placeRelation2,
10
10
  sameReading2
11
- } from "./chunks/place-tv86hmps.js";
11
+ } from "./chunks/place-jksxqsqb.js";
12
+ import {
13
+ SHARED_ROW_SENTINELS2,
14
+ sentinelIn2
15
+ } from "./chunks/place-tcgfvemw.js";
12
16
  import {
13
17
  validity
14
18
  } from "./chunks/place-q9kwsmzd.js";
@@ -18,6 +22,66 @@ import { SURNAME_SEPARATOR, lexiconKey, titleCaseNamePart } from "@finbheara/nam
18
22
  import { personName } from "@finbheara/names/normalize";
19
23
 
20
24
  import { placeholderOf } from "@finbheara/names/normalize";
25
+
26
+ var SCHOOL_CELL_OWN_SENTINELS = [
27
+ {
28
+ print: "no school",
29
+ authority: "`No School`: 76 school cells, the dancer entered with no school"
30
+ },
31
+ {
32
+ print: "independent",
33
+ authority: "`Independent`, `independent`, `Independent?`: 5 school cells, no school by the dancer's own description"
34
+ },
35
+ {
36
+ print: "independent dancer",
37
+ authority: "`Independent Dancer`, `Independent dancer`, `Independent Dancer?`: 8 school cells"
38
+ },
39
+ {
40
+ print: "non dancing",
41
+ authority: "`Non-dancing`: 107 school cells, an entry form's option for a non-dancer"
42
+ },
43
+ {
44
+ print: "school not selected",
45
+ match: "prefix",
46
+ authority: "`SCHOOL NOT SELECTED - update your ... profile`: 45 school cells, an entry form's instruction"
47
+ },
48
+ {
49
+ print: "choose one",
50
+ authority: "`-- Choose One --`: 41 school cells, an entry form's unchosen option"
51
+ },
52
+ {
53
+ print: "no school selected",
54
+ match: "prefix",
55
+ authority: "`NO SCHOOL SELECTED - Please change your profile`: 16 school cells, an entry form's instruction"
56
+ },
57
+ {
58
+ print: "no school associations",
59
+ authority: "`No School Associations`: 13 school cells"
60
+ },
61
+ { print: "no lessons yet", authority: "`No lessons yet`: 5 school cells" },
62
+ { print: "non dancer", authority: "`Non-dancer`: 4 school cells" },
63
+ { print: "non dance competitions", authority: "`Non-Dance Competitions`: 3 school cells" },
64
+ {
65
+ print: "not listed",
66
+ match: "prefix",
67
+ authority: "`--Not Listed--`: 2 school cells, an entry form's option"
68
+ },
69
+ { print: "other", authority: "`Other`: 2 school cells, an entry form's option" },
70
+ { print: "not certified", authority: "`Not Certified`: 1 school cell" },
71
+ { print: "n e e d", authority: "`(n e e d ) ____`: 1 school cell, keyboard filler" },
72
+ { print: "none", authority: "`None`: 1 school cell" },
73
+ {
74
+ print: "unknown irish dancing school",
75
+ authority: "`Unknown Irish Dancing School`: 1 school cell"
76
+ },
77
+ { print: "none inactive dancer", authority: "`None - Inactive Dancer`: 1 school cell" }
78
+ ];
79
+ var SCHOOL_CELL_SENTINELS = [
80
+ ...SHARED_ROW_SENTINELS2,
81
+ ...SCHOOL_CELL_OWN_SENTINELS
82
+ ];
83
+ var schoolCellSentinelOf = sentinelIn2(SCHOOL_CELL_SENTINELS);
84
+
21
85
  var SCHOOL_NAME_EXCEPTIONS = [
22
86
  {
23
87
  phrase: "the academy",
@@ -257,7 +321,7 @@ function notASchoolIn(rows) {
257
321
  const text = normalizeForRefusal(print);
258
322
  if (text === "")
259
323
  return;
260
- const placeholder = placeholderOf(text);
324
+ const placeholder = schoolCellSentinelOf(text) ?? placeholderOf(text);
261
325
  if (placeholder !== undefined)
262
326
  return placeholderRow(placeholder);
263
327
  for (const row of rows) {
@@ -2137,8 +2201,11 @@ export {
2137
2201
  DEFAULT_SCHOOL_NAME_CAPACITY,
2138
2202
  DEFAULT_SCHOOL_NAME_READER,
2139
2203
  NOT_A_SCHOOL,
2204
+ SCHOOL_CELL_OWN_SENTINELS,
2205
+ SCHOOL_CELL_SENTINELS,
2140
2206
  SCHOOL_LEVEL_COLUMNS,
2141
2207
  SCHOOL_NAME_EXCEPTIONS,
2208
+ SHARED_ROW_SENTINELS2 as SHARED_ROW_SENTINELS,
2142
2209
  compareSchoolNames,
2143
2210
  compareSchools,
2144
2211
  createSchoolNameReader,
@@ -2152,6 +2219,7 @@ export {
2152
2219
  realWords,
2153
2220
  realWordsInPrintOrder,
2154
2221
  sameInEveryPart,
2222
+ schoolCellSentinelOf,
2155
2223
  schoolColumns,
2156
2224
  schoolCompare,
2157
2225
  schoolEncoder,
@@ -0,0 +1,16 @@
1
+ import { type ParseOrder, type PersonName } from "@finbheara/names/normalize";
2
+ import { type RowSentinel } from "./row-sentinels.ts";
3
+ export { SHARED_ROW_SENTINELS, sentinelIn } from "./row-sentinels.ts";
4
+ export type { RowSentinel } from "./row-sentinels.ts";
5
+ export type PersonRole = "adjudicator" | "dancer" | "teacher";
6
+ export declare const ADJUDICATOR_SENTINELS: readonly RowSentinel[];
7
+ export declare const DANCER_SENTINELS: readonly RowSentinel[];
8
+ export declare const TEACHER_SENTINELS: readonly RowSentinel[];
9
+ export declare const ROLE_SENTINELS: Readonly<Record<PersonRole, readonly RowSentinel[]>>;
10
+ export declare function roleSentinelOf(role: PersonRole, print: string): RowSentinel | undefined;
11
+ export declare function roleName(role: PersonRole, print: string, order?: ParseOrder): PersonName;
12
+ export declare function rolePrintsNoName(role: PersonRole, print: string): boolean;
13
+ export declare const dancerPrintsNoName: (print: string) => boolean;
14
+ export declare const seatName: (print: string) => PersonName;
15
+ export declare const dancerName: (print: string, order?: ParseOrder) => PersonName;
16
+ export declare const teacherName: (print: string, order?: ParseOrder) => PersonName;
@@ -51,6 +51,11 @@ export interface UnreadPlace extends AbstractPlace {
51
51
  readonly arm: "unread";
52
52
  }
53
53
  export type Place = ResolvedPlace | PluralPlaces | AmbiguousPlace | UnreadPlace;
54
+ export interface PlaceWindow {
55
+ readonly p: Place;
56
+ readonly tokens: readonly string[];
57
+ next?: PlaceWindow;
58
+ }
54
59
  export type PlaceRefusals = (print: string) => PlaceRefusal | undefined;
55
60
  export interface PlaceReaderOptions {
56
61
  readonly tree?: readonly PlaceNode[];
@@ -64,6 +69,8 @@ export declare function createPlaceReader(options?: PlaceReaderOptions): {
64
69
  countryCodeOf: (token: string) => string | undefined;
65
70
  areAllPlaceTokens: (tokens: readonly string[], off?: number, declared?: boolean) => boolean;
66
71
  placeFromId: (id: string) => Place;
72
+ placeParts: (print: string) => Place[];
73
+ placeWindows: (text: string, ctx?: string | PlaceContext) => PlaceWindow[];
67
74
  oireachtasOfRegion: (regionId: string | undefined) => string | undefined;
68
75
  regionOfOireachtas: (code: string) => Place;
69
76
  placeStats: () => {
@@ -84,6 +91,8 @@ export declare function isPlaceToken(token: string, cut?: boolean, declared?: bo
84
91
  export declare function countryCodeOf(token: string): string | undefined;
85
92
  export declare function areAllPlaceTokens(tokens: readonly string[], off?: number, declared?: boolean): boolean;
86
93
  export declare function placeFromId(id: string): Place;
94
+ export declare function placeWindows(text: string, ctx?: string | PlaceContext): PlaceWindow[];
95
+ export declare function placeParts(print: string): Place[];
87
96
  export declare function oireachtasOfRegion(regionId: string | undefined): string | undefined;
88
97
  export declare function regionOfOireachtas(code: string): Place;
89
98
  export declare function placeStats(): {
@@ -0,0 +1,4 @@
1
+ import { type NamePlaceholder } from "@finbheara/names/normalize";
2
+ export type RowSentinel = NamePlaceholder;
3
+ export declare const SHARED_ROW_SENTINELS: readonly RowSentinel[];
4
+ export declare function sentinelIn(list: readonly RowSentinel[]): (print: string) => RowSentinel | undefined;
@@ -0,0 +1,4 @@
1
+ import { type RowSentinel } from "./row-sentinels.ts";
2
+ export declare const SCHOOL_CELL_OWN_SENTINELS: readonly RowSentinel[];
3
+ export declare const SCHOOL_CELL_SENTINELS: readonly RowSentinel[];
4
+ export declare const schoolCellSentinelOf: (print: string) => RowSentinel | undefined;
@@ -8,5 +8,8 @@ export { compareSchoolNames, compareSchools } from "./school-identity.ts";
8
8
  export type { IdentityResult, IdentityVerdict } from "./school-identity.ts";
9
9
  export { foldSchoolName, hasSpecificToken, schoolKeyTokens } from "./school-match-key.ts";
10
10
  export { NOT_A_SCHOOL, SCHOOL_NAME_EXCEPTIONS, } from "./school-exception-vocabulary.ts";
11
+ export { SCHOOL_CELL_OWN_SENTINELS, SCHOOL_CELL_SENTINELS, schoolCellSentinelOf, } from "./school-cell-sentinels.ts";
12
+ export { SHARED_ROW_SENTINELS } from "./row-sentinels.ts";
13
+ export type { RowSentinel } from "./row-sentinels.ts";
11
14
  export type { EmptyReason, Validated } from "./validated.ts";
12
15
  export type { NotASchool, RefusalReason, SchoolNameException, } from "./school-exception-vocabulary.ts";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@finbheara/domain",
3
- "version": "0.10.0",
4
- "description": "Places, CLRG regions, school names, ages and dances as they are printed: read, compared and told apart",
3
+ "version": "0.12.0",
4
+ "description": "Places, CLRG regions, school names, ages, dances and a person's print in its role, as they are printed: read, compared and told apart",
5
5
  "keywords": [
6
6
  "places",
7
7
  "regions",
@@ -57,6 +57,10 @@
57
57
  "types": "./dist/types/promotion.d.ts",
58
58
  "default": "./dist/promotion.js"
59
59
  },
60
+ "./person": {
61
+ "types": "./dist/types/person.d.ts",
62
+ "default": "./dist/person.js"
63
+ },
60
64
  "./package.json": "./package.json"
61
65
  },
62
66
  "files": ["dist/*.js", "dist/chunks/*.js", "dist/types/**/*.d.ts", "README.md", "LICENSE"],