linked-rolls 0.50.0 → 0.52.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 +10 -0
- package/lib/constraints.d.ts +4 -3
- package/lib/constraints.js +28 -3
- package/lib/reservations.js +1 -1
- package/lib/sigla.d.ts +19 -14
- package/lib/sigla.js +28 -7
- package/lib/witnesses.d.ts +7 -0
- package/lib/witnesses.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,6 +80,16 @@ sigla off the stemma as it stands, so a label never outlives the
|
|
|
80
80
|
arrangement it describes, and nothing should cite one without saying
|
|
81
81
|
which state of the edition it belongs to.
|
|
82
82
|
|
|
83
|
+
Handed an `EditionView`, which knows the copies as well, `siglaOf`
|
|
84
|
+
lowercases the versions no copy's features carry at first hand, as
|
|
85
|
+
editions mark a state nothing surviving shows: r3 stands to R3 as a
|
|
86
|
+
reconstructed state stands to a witnessed one. A version reached only
|
|
87
|
+
through the versions derived from it is lowercased, and so is one a
|
|
88
|
+
copy does no more than state it carries, since a statement gives no
|
|
89
|
+
readings. `attestedVersions` reports the same fact on its own. Handed
|
|
90
|
+
the versions alone, `siglaOf` cannot tell and leaves every siglum in
|
|
91
|
+
capitals.
|
|
92
|
+
|
|
83
93
|
## The tolerance a derivation was collated at
|
|
84
94
|
|
|
85
95
|
`collationTolerance` on a derivation is the window two readings of one
|
package/lib/constraints.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EditionView } from "./EditionView.js";
|
|
|
2
2
|
export type ConstraintProblem = {
|
|
3
3
|
version: string;
|
|
4
4
|
symbol: string;
|
|
5
|
-
problem: 'alignment-reference-missing' | 'before-reference-missing' | 'after-reference-missing' | 'placed-relative-to-itself' | 'placed-several-ways' | 'partner-missing' | 'paired-with-itself' | 'in-several-pairs' | 'pair-placed-on-both-sides' | 'type-not-on-the-bar' | 'carrier-on-another-track' | 'copies-disagree-on-the-paper';
|
|
5
|
+
problem: 'alignment-reference-missing' | 'before-reference-missing' | 'after-reference-missing' | 'placed-relative-to-itself' | 'placed-several-ways' | 'partner-missing' | 'paired-with-itself' | 'in-several-pairs' | 'pair-placed-on-both-sides' | 'type-not-on-the-bar' | 'carrier-on-another-track' | 'copies-disagree-on-the-paper' | 'strike-bites-nothing';
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Where the edition cannot hold as stated, version by version: a
|
|
@@ -10,7 +10,8 @@ export type ConstraintProblem = {
|
|
|
10
10
|
* placed relative to itself or in several ways at once, one claimed by
|
|
11
11
|
* several pairs, a pair whose members are both placed and so cannot
|
|
12
12
|
* keep their distance and follow their references at once, an
|
|
13
|
-
* expression the version's own bar cannot read,
|
|
14
|
-
*
|
|
13
|
+
* expression the version's own bar cannot read, a carrier sitting on a
|
|
14
|
+
* track that does not say what its symbol says, and a strike that takes
|
|
15
|
+
* nothing out.
|
|
15
16
|
*/
|
|
16
17
|
export declare const constraintProblems: (view: EditionView) => ConstraintProblem[];
|
package/lib/constraints.js
CHANGED
|
@@ -3,6 +3,7 @@ import { isCommand, pairsAmong, placementsOf } from "./Symbol.js";
|
|
|
3
3
|
import { keyOf } from "./TrackerBar.js";
|
|
4
4
|
import { trackerBarOf } from "./systems/index.js";
|
|
5
5
|
import { barOf } from "./RollCopy.js";
|
|
6
|
+
import { deletedBy, insertedBy } from "./Version.js";
|
|
6
7
|
const missingReference = {
|
|
7
8
|
alignedWith: 'alignment-reference-missing',
|
|
8
9
|
before: 'before-reference-missing',
|
|
@@ -100,14 +101,37 @@ const carriersOffTheirMeaning = (view, version, commands) => {
|
|
|
100
101
|
const paperDisagreed = (view, version) => view.speedScalesIn(version).length > 1
|
|
101
102
|
? [{ version: version.id, symbol: version.id, problem: 'copies-disagree-on-the-paper' }]
|
|
102
103
|
: [];
|
|
104
|
+
/**
|
|
105
|
+
* A version's strikes that take nothing out of its text: each deleted
|
|
106
|
+
* symbol has to be one the parent hands down, or one the version put
|
|
107
|
+
* there itself, or the strike says nothing.
|
|
108
|
+
*
|
|
109
|
+
* It is the check for what happens when a symbol two versions shared is
|
|
110
|
+
* parted in two. The strike still names a symbol that exists, so
|
|
111
|
+
* nothing dangles and nothing looks wrong, but the reading it meant to
|
|
112
|
+
* reject has passed to the symbol standing in its place and comes back
|
|
113
|
+
* into the text unstruck. Nothing else in the edition shows it: the
|
|
114
|
+
* counts move, and only by a handful.
|
|
115
|
+
*/
|
|
116
|
+
const strikesBitingNothing = (view, version) => {
|
|
117
|
+
const parent = view.predecessorOf(version.id);
|
|
118
|
+
const reachable = new Set([
|
|
119
|
+
...(parent ? view.snapshot(parent.id).map(symbol => symbol.id) : []),
|
|
120
|
+
...insertedBy(version).map(symbol => symbol.id)
|
|
121
|
+
]);
|
|
122
|
+
return deletedBy(version)
|
|
123
|
+
.filter(id => !reachable.has(id))
|
|
124
|
+
.map(id => ({ version: version.id, symbol: id, problem: 'strike-bites-nothing' }));
|
|
125
|
+
};
|
|
103
126
|
/**
|
|
104
127
|
* Where the edition cannot hold as stated, version by version: a
|
|
105
128
|
* placement or pairing reference absent from the version, a command
|
|
106
129
|
* placed relative to itself or in several ways at once, one claimed by
|
|
107
130
|
* several pairs, a pair whose members are both placed and so cannot
|
|
108
131
|
* keep their distance and follow their references at once, an
|
|
109
|
-
* expression the version's own bar cannot read,
|
|
110
|
-
*
|
|
132
|
+
* expression the version's own bar cannot read, a carrier sitting on a
|
|
133
|
+
* track that does not say what its symbol says, and a strike that takes
|
|
134
|
+
* nothing out.
|
|
111
135
|
*/
|
|
112
136
|
export const constraintProblems = (view) => view.edition.versions.flatMap(version => {
|
|
113
137
|
const snapshot = view.snapshot(version.id);
|
|
@@ -116,6 +140,7 @@ export const constraintProblems = (view) => view.edition.versions.flatMap(versio
|
|
|
116
140
|
...problemsIn(version.id, commands),
|
|
117
141
|
...typesNotOnTheBar(version, snapshot),
|
|
118
142
|
...carriersOffTheirMeaning(view, version.id, commands),
|
|
119
|
-
...paperDisagreed(view, version)
|
|
143
|
+
...paperDisagreed(view, version),
|
|
144
|
+
...strikesBitingNothing(view, version)
|
|
120
145
|
];
|
|
121
146
|
});
|
package/lib/reservations.js
CHANGED
|
@@ -125,7 +125,7 @@ const witnessedAtFirstHand = (view, version) => {
|
|
|
125
125
|
const carriers = witnessesOf(view, version.id).filter(({ by }) => by === 'carriers');
|
|
126
126
|
return carriers.length > 0 && carriers.every(({ through }) => through !== undefined) ? {
|
|
127
127
|
type: 'no-direct-witness',
|
|
128
|
-
note: 'No copy carries it at first hand;
|
|
128
|
+
note: 'No copy carries it at first hand; its text is a reconstruction from the versions derived from it.'
|
|
129
129
|
} : undefined;
|
|
130
130
|
};
|
|
131
131
|
const versionChecks = [textStated, witnessedByFeatures, witnessedAtFirstHand];
|
package/lib/sigla.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { Edition } from './Edition.js';
|
|
2
|
+
import { EditionView } from './EditionView.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
4
|
+
* What the sigla are read off: the versions alone, or a view, which knows
|
|
5
|
+
* the copies as well and so can tell which versions a witness shows.
|
|
6
|
+
*/
|
|
7
|
+
export type Stemma = Pick<Edition, 'versions'> | EditionView;
|
|
8
|
+
/**
|
|
9
|
+
* The siglum of every version, as the stemma stands: where it sits
|
|
10
|
+
* (`alongTheStemma`) and, given a view, whether any copy shows it.
|
|
11
|
+
*
|
|
12
|
+
* A version no copy's features carry at first hand is inferred, whether
|
|
13
|
+
* it is reached only through the versions derived from it or a copy does
|
|
14
|
+
* no more than state that it carries it. Its siglum is lowercased, so
|
|
15
|
+
* that r3 stands to R3 as a reconstructed state stands to a witnessed
|
|
16
|
+
* one. Handed the versions alone, the sigla cannot tell and stay in
|
|
17
|
+
* capitals throughout.
|
|
9
18
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ends and the children hang off it as branches. So a siglum says where a
|
|
13
|
-
* version sits in this stemma, and it is computed anew when the stemma
|
|
14
|
-
* changes. Nothing should cite one without saying which state it belongs
|
|
15
|
-
* to.
|
|
19
|
+
* A siglum is computed anew when the stemma or the copies change, so
|
|
20
|
+
* nothing should cite one without saying which state it belongs to.
|
|
16
21
|
*/
|
|
17
|
-
export declare const siglaOf: (
|
|
22
|
+
export declare const siglaOf: (stemma: Stemma) => ReadonlyMap<string, string>;
|
|
18
23
|
/** The siglum of one version as the stemma stands, or nothing where the edition holds no such version. */
|
|
19
|
-
export declare const siglumOf: (
|
|
24
|
+
export declare const siglumOf: (stemma: Stemma, versionId: string) => string | undefined;
|
package/lib/sigla.js
CHANGED
|
@@ -2,6 +2,7 @@ import { idOf } from './Assumption.js';
|
|
|
2
2
|
import { systemIdOf } from './TrackerBar.js';
|
|
3
3
|
import { trackerBarOf } from './systems/index.js';
|
|
4
4
|
import { principalDerivationOf } from './Version.js';
|
|
5
|
+
import { attestedVersions } from './witnesses.js';
|
|
5
6
|
/** The letter the versions of a system are labelled with. */
|
|
6
7
|
const letters = new Map([
|
|
7
8
|
['welte-t100', 'R'],
|
|
@@ -27,13 +28,9 @@ const letterOf = (version) => {
|
|
|
27
28
|
*
|
|
28
29
|
* The main line runs through the child that has descendants of its own;
|
|
29
30
|
* where several have, the one with the most, and where none has, the line
|
|
30
|
-
* ends and the children hang off it as branches.
|
|
31
|
-
* version sits in this stemma, and it is computed anew when the stemma
|
|
32
|
-
* changes. Nothing should cite one without saying which state it belongs
|
|
33
|
-
* to.
|
|
31
|
+
* ends and the children hang off it as branches.
|
|
34
32
|
*/
|
|
35
|
-
|
|
36
|
-
const versions = edition.versions;
|
|
33
|
+
const alongTheStemma = (versions) => {
|
|
37
34
|
const byId = new Map(versions.map(version => [version.id, version]));
|
|
38
35
|
const parentOf = (version) => {
|
|
39
36
|
const principal = principalDerivationOf(version);
|
|
@@ -94,5 +91,29 @@ export const siglaOf = (edition) => {
|
|
|
94
91
|
}
|
|
95
92
|
return sigla;
|
|
96
93
|
};
|
|
94
|
+
const isView = (stemma) => !('versions' in stemma);
|
|
95
|
+
/**
|
|
96
|
+
* The sigla with the inferred versions in lowercase, as editions mark a
|
|
97
|
+
* state nothing surviving shows. The letter still names the system and
|
|
98
|
+
* the number still counts the generation.
|
|
99
|
+
*/
|
|
100
|
+
const marking = (sigla, attested) => new Map([...sigla].map(([id, siglum]) => [id, attested.has(id) ? siglum : siglum.toLowerCase()]));
|
|
101
|
+
/**
|
|
102
|
+
* The siglum of every version, as the stemma stands: where it sits
|
|
103
|
+
* (`alongTheStemma`) and, given a view, whether any copy shows it.
|
|
104
|
+
*
|
|
105
|
+
* A version no copy's features carry at first hand is inferred, whether
|
|
106
|
+
* it is reached only through the versions derived from it or a copy does
|
|
107
|
+
* no more than state that it carries it. Its siglum is lowercased, so
|
|
108
|
+
* that r3 stands to R3 as a reconstructed state stands to a witnessed
|
|
109
|
+
* one. Handed the versions alone, the sigla cannot tell and stay in
|
|
110
|
+
* capitals throughout.
|
|
111
|
+
*
|
|
112
|
+
* A siglum is computed anew when the stemma or the copies change, so
|
|
113
|
+
* nothing should cite one without saying which state it belongs to.
|
|
114
|
+
*/
|
|
115
|
+
export const siglaOf = (stemma) => isView(stemma)
|
|
116
|
+
? marking(alongTheStemma(stemma.edition.versions), attestedVersions(stemma))
|
|
117
|
+
: alongTheStemma(stemma.versions);
|
|
97
118
|
/** The siglum of one version as the stemma stands, or nothing where the edition holds no such version. */
|
|
98
|
-
export const siglumOf = (
|
|
119
|
+
export const siglumOf = (stemma, versionId) => siglaOf(stemma).get(versionId);
|
package/lib/witnesses.d.ts
CHANGED
|
@@ -19,6 +19,13 @@ export interface Witness {
|
|
|
19
19
|
/** The belief a statement rests on, where it states one. */
|
|
20
20
|
belief?: Belief;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The versions a copy's features carry at first hand: for every copy,
|
|
24
|
+
* the latest state it bears. A version left out is reached only through
|
|
25
|
+
* the versions derived from it, or is attested by statement alone, and
|
|
26
|
+
* its text is a reconstruction rather than a reading.
|
|
27
|
+
*/
|
|
28
|
+
export declare const attestedVersions: (view: EditionView) => ReadonlySet<string>;
|
|
22
29
|
/**
|
|
23
30
|
* The copies that bear witness to the version: those whose features carry
|
|
24
31
|
* a symbol the version's own edits insert, and those that state they carry
|
package/lib/witnesses.js
CHANGED
|
@@ -28,6 +28,13 @@ const carriersIn = (view) => {
|
|
|
28
28
|
.map(carriage => [carriage.copy, carriage.version]))
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The versions a copy's features carry at first hand: for every copy,
|
|
33
|
+
* the latest state it bears. A version left out is reached only through
|
|
34
|
+
* the versions derived from it, or is attested by statement alone, and
|
|
35
|
+
* its text is a reconstruction rather than a reading.
|
|
36
|
+
*/
|
|
37
|
+
export const attestedVersions = (view) => new Set(carriersIn(view).latestOf.values());
|
|
31
38
|
const witnessesIn = (carriers, view, versionId) => {
|
|
32
39
|
const carrying = carriers.copiesOf.get(versionId) ?? [];
|
|
33
40
|
const byCarriers = carrying.map((copy) => {
|
package/package.json
CHANGED