/** * A stemma proposed from the copies alone: which versions there are, * lost ones included, how they derive from each other, and which * readings each inserts and deletes. */ import { Edition } from "../model/Edition.js"; import { Millimeters } from "../model/Quantity.js"; import { CopyCollation, Recoding } from "./readings.js"; import { PresenceMatrix } from "./presence.js"; import { Costs, Scored, Support } from "./search.js"; import { KeptApart, SharedText } from "./texts.js"; /** * How near a reading of the same kind on the other side of the root * makes a reading on the less refined side a moved one, where nothing * else is said. Hits up to about this distance are more than chance; a * wider window agrees with the edition of WM 225 more often, but largely * by convention. * @category Filiation */ export declare const defaultMovedWithin: import("../index.js").Quantity<"mm">; /** * What a proposal is computed with. Every value has a default, the one * the edition of WM 225 is reproduced with. * @category Filiation */ export interface FiliationOptions { /** The copies whose features are collated; by default every copy with features of its punching. */ copies?: readonly string[]; /** What the search counts against a stemma (`defaultCosts`). */ costs?: Partial; /** * How near a reading of the same kind on the other side of the root * makes a reading on the less refined side a moved one (`defaultMovedWithin`). */ movedWithin?: Millimeters; /** How far beyond its text, or the edge of a tear, a copy cannot say what it lacks (3 mm). */ margin?: Millimeters; /** * Whether the editor's decisions hold (yes): the edits the editor * wrote hold their versions to what they insert and delete, and * copies the edition gives one version carry one text. */ pin?: boolean; /** * How many readings two copies of one system may differ in and still * be taken to carry the same text (`defaultSameText`). Below zero, * only what the edition states is taken for one text. */ sameText?: number; /** How many runners-up to report (5). */ alternatives?: number; } /** * A version the proposal posits. * @category Filiation */ export interface ProposedVersion { /** A name within the proposal: the versions are numbered from the root down. */ id: string; /** The copies carrying the version at first hand; none for a lost state. */ copies: string[]; /** The system the version is coded for, by its identifier. */ system: string; /** The version it derives from, by its name within the proposal. */ parent?: string; /** The version of the edition it stands for, where one does. */ version?: string; /** The collated readings the version inserts. */ inserts: string[]; /** The collated readings the version deletes. */ deletes: string[]; /** The held commands that stand for a latched pair, among what the version inserts and deletes. */ recodings: Recoding[]; /** The readings the version holds that a copy carrying it lacks. */ deviations: { copy: string; reading: string; }[]; /** The edits the editor wrote on `version` that the proposal keeps as they are. */ pinned: string[]; } /** * Why an edit the editor wrote is not kept. * @category Filiation */ export type Unpinned = { edit: string; version: string; reason: 'version-gone' | 'reading-gone' | 'contradicts-copies'; }; /** * A stemma proposed from the copies, with what it rests on: the * collation, the presence of every reading in every copy, the cost of * the best stemma and of the runners-up, and the margin by which the * copies decide each of its groupings. * @category Filiation */ export interface StemmaProposal { copies: string[]; /** The copies grouped by the text they carry, each group one version of the stemma. */ texts: SharedText[]; /** The closest copies of one system that were kept apart, closest first. */ apart: KeptApart[]; sameText: number; costs: Costs; movedWithin: Millimeters; margin: Millimeters; collation: CopyCollation; matrix: PresenceMatrix; /** From the root down. */ versions: ProposedVersion[]; /** The stemma in the notation `Scored` uses, the copies by siglum. */ notation: string; cost: number; /** How many admissible stemmata were scored. */ scored: number; alternatives: Scored[]; supports: Support[]; /** The readings the stemma lets arise more than once, with the versions inserting them. */ conflicts: { reading: string; versions: string[]; }[]; /** The readings on the less refined side of the root taken for the base text, as moved or cleaned up by the other side. */ baseText: string[]; /** By collated reading, the symbol of the edition it stands for, where one does. */ symbols: Record; unpinned: Unpinned[]; } /** * Proposes a stemma from the copies. * * The copies are collated all at once (`collateCopies`), and every * reading becomes a character that each copy has, lacks or cannot speak * to (`presenceIn`). Every stemma of the copies that the systems admit, * up to seven copies, is scored by what it has to let arise and be lost * (`Costs`), and the least costly is taken, ties going to fewer lost * states. On it, each reading arises in the latest version all copies * carrying it descend from, and is deleted where a branch lacks it. A * reading only the less refined side of the root carries is taken for * the base text where the other side has it moved or cleaned up. * * Where the edition has versions already, a version of the proposal * that a copy carries at first hand stands for the version that copy * carries in the edition, and a lost one for the version inserting most * of the same readings. An edit the editor wrote on such a version, one * a collation would not have written, holds the version to what it * inserts and deletes, unless the copies cannot be read so. * @category Filiation */ export declare const proposeStemma: (edition: Edition, options?: FiliationOptions) => StemmaProposal;