eyecite-ts 0.5.0 → 0.6.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 +38 -8
- package/dist/annotate/index.cjs.map +1 -1
- package/dist/annotate/index.d.cts +1 -1
- package/dist/annotate/index.d.mts +1 -1
- package/dist/annotate/index.mjs.map +1 -1
- package/dist/{citation-25ZydLsu.d.mts → citation-BwXdJTA9.d.mts} +177 -12
- package/dist/citation-BwXdJTA9.d.mts.map +1 -0
- package/dist/{citation-Cymq3pJ-.d.cts → citation-By8QXtGC.d.cts} +177 -12
- package/dist/citation-By8QXtGC.d.cts.map +1 -0
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +90 -90
- package/dist/data/index.d.cts.map +1 -1
- package/dist/data/index.d.mts +90 -90
- package/dist/data/index.d.mts.map +1 -1
- package/dist/data/index.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +110 -128
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +110 -128
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/knownCodes-CI-vnoBO.cjs.map +1 -1
- package/dist/knownCodes-MkDSiR1j.mjs.map +1 -1
- package/dist/types-BfYnmSHC.d.mts +115 -0
- package/dist/types-BfYnmSHC.d.mts.map +1 -0
- package/dist/types-C_5aOCZ1.d.cts +115 -0
- package/dist/types-C_5aOCZ1.d.cts.map +1 -0
- package/dist/utils/index.cjs +7 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +122 -0
- package/dist/utils/index.d.cts.map +1 -0
- package/dist/utils/index.d.mts +122 -0
- package/dist/utils/index.d.mts.map +1 -0
- package/dist/utils/index.mjs +7 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +10 -1
- package/dist/citation-25ZydLsu.d.mts.map +0 -1
- package/dist/citation-Cymq3pJ-.d.cts.map +0 -1
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
//#region src/extract/pincite.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Structured pincite information parsed from citation text.
|
|
4
|
+
*/
|
|
5
|
+
interface PinciteInfo {
|
|
6
|
+
/** Primary page number */
|
|
7
|
+
page: number;
|
|
8
|
+
/** End page for ranges: "570-75" → 575 */
|
|
9
|
+
endPage?: number;
|
|
10
|
+
/** Footnote number: "570 n.3" → 3 */
|
|
11
|
+
footnote?: number;
|
|
12
|
+
/** True if this is a page range */
|
|
13
|
+
isRange: boolean;
|
|
14
|
+
/** Original text before parsing */
|
|
15
|
+
raw: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse a pincite string into structured components.
|
|
19
|
+
*
|
|
20
|
+
* Handles simple pages, ranges (with abbreviated end pages),
|
|
21
|
+
* footnote references, and "at" prefixes.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* parsePincite("570") // { page: 570, isRange: false, raw: "570" }
|
|
25
|
+
* parsePincite("570-75") // { page: 570, endPage: 575, isRange: true, raw: "570-75" }
|
|
26
|
+
* parsePincite("570 n.3") // { page: 570, footnote: 3, isRange: false, raw: "570 n.3" }
|
|
27
|
+
*
|
|
28
|
+
* @returns Parsed pincite info, or null if unparseable
|
|
29
|
+
*/
|
|
30
|
+
declare function parsePincite(raw: string): PinciteInfo | null;
|
|
31
|
+
//#endregion
|
|
1
32
|
//#region src/types/span.d.ts
|
|
2
33
|
/**
|
|
3
34
|
* Represents a text span with positions tracked through transformations.
|
|
@@ -43,7 +74,7 @@ interface TransformationMap {
|
|
|
43
74
|
/**
|
|
44
75
|
* Citation type discriminator for type-safe pattern matching.
|
|
45
76
|
*/
|
|
46
|
-
type CitationType = "case" | "statute" | "journal" | "neutral" | "publicLaw" | "federalRegister" | "statutesAtLarge" | "id" | "supra" | "shortFormCase";
|
|
77
|
+
type CitationType = "case" | "statute" | "journal" | "neutral" | "publicLaw" | "federalRegister" | "statutesAtLarge" | "constitutional" | "id" | "supra" | "shortFormCase";
|
|
47
78
|
/**
|
|
48
79
|
* Warning generated during citation parsing.
|
|
49
80
|
*/
|
|
@@ -61,6 +92,11 @@ interface Warning {
|
|
|
61
92
|
context?: string;
|
|
62
93
|
}
|
|
63
94
|
/**
|
|
95
|
+
* Introductory signal word classification for citation support level.
|
|
96
|
+
* Based on Bluebook signal categories (Rule 1.2).
|
|
97
|
+
*/
|
|
98
|
+
type CitationSignal = "see" | "see also" | "see generally" | "cf" | "but see" | "but cf" | "compare" | "accord" | "contra";
|
|
99
|
+
/**
|
|
64
100
|
* Base fields shared by all citation types.
|
|
65
101
|
*/
|
|
66
102
|
interface CitationBase {
|
|
@@ -84,6 +120,75 @@ interface CitationBase {
|
|
|
84
120
|
patternsChecked: number;
|
|
85
121
|
/** Warnings for malformed or ambiguous regions */
|
|
86
122
|
warnings?: Warning[];
|
|
123
|
+
/** Introductory signal word (e.g., "see", "see also", "but see") */
|
|
124
|
+
signal?: CitationSignal;
|
|
125
|
+
/** Group ID for string citations sharing the same proposition */
|
|
126
|
+
stringCitationGroupId?: string;
|
|
127
|
+
/** Position within the string citation group (0-indexed) */
|
|
128
|
+
stringCitationIndex?: number;
|
|
129
|
+
/** Total number of citations in this string citation group */
|
|
130
|
+
stringCitationGroupSize?: number;
|
|
131
|
+
/** Whether this citation appears in a footnote (only populated when detectFootnotes enabled) */
|
|
132
|
+
inFootnote?: boolean;
|
|
133
|
+
/** Footnote number, if applicable (only populated when detectFootnotes enabled) */
|
|
134
|
+
footnoteNumber?: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Court level and jurisdiction inferred from reporter series.
|
|
138
|
+
* Populated independently of the parenthetical-extracted `court` field.
|
|
139
|
+
*/
|
|
140
|
+
interface CourtInference {
|
|
141
|
+
/** Court level classification */
|
|
142
|
+
level: "supreme" | "appellate" | "trial" | "unknown";
|
|
143
|
+
/** Jurisdiction classification */
|
|
144
|
+
jurisdiction: "federal" | "state" | "unknown";
|
|
145
|
+
/** 2-letter state code, only for state-specific reporters */
|
|
146
|
+
state?: string;
|
|
147
|
+
/** Confidence score 0.0-1.0 (1.0 for unambiguous, 0.7 for regional multi-state) */
|
|
148
|
+
confidence: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Signal-word classification for explanatory parentheticals.
|
|
152
|
+
* Based on the leading gerund/verb form in the parenthetical text.
|
|
153
|
+
*/
|
|
154
|
+
type ParentheticalType = "holding" | "finding" | "stating" | "noting" | "explaining" | "quoting" | "citing" | "discussing" | "describing" | "recognizing" | "applying" | "rejecting" | "adopting" | "requiring" | "other";
|
|
155
|
+
/**
|
|
156
|
+
* An extracted explanatory parenthetical from a case citation.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* { text: "holding that X requires Y", type: "holding" }
|
|
161
|
+
* { text: "citing Doe v. City for the same proposition", type: "citing" }
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
interface Parenthetical {
|
|
165
|
+
/** Full text content between the parentheses (excluding parens themselves) */
|
|
166
|
+
text: string;
|
|
167
|
+
/** Signal-word classification based on leading gerund */
|
|
168
|
+
type: ParentheticalType;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Normalized subsequent history signal classification.
|
|
172
|
+
* Maps variant spellings (aff'd, affirmed) to canonical forms.
|
|
173
|
+
*/
|
|
174
|
+
type HistorySignal = "affirmed" | "reversed" | "cert_denied" | "cert_granted" | "overruled" | "vacated" | "remanded" | "modified" | "abrogated" | "superseded" | "disapproved" | "questioned" | "distinguished" | "withdrawn" | "reinstated";
|
|
175
|
+
/**
|
|
176
|
+
* A single subsequent history entry from a case citation.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* { signal: "affirmed", rawSignal: "aff'd", signalSpan: { ... }, order: 0 }
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
interface SubsequentHistoryEntry {
|
|
184
|
+
/** Normalized signal classification */
|
|
185
|
+
signal: HistorySignal;
|
|
186
|
+
/** Raw signal text as it appeared in the document */
|
|
187
|
+
rawSignal: string;
|
|
188
|
+
/** Position of the signal text in the document */
|
|
189
|
+
signalSpan: Span;
|
|
190
|
+
/** Order in the history chain (0-based) */
|
|
191
|
+
order: number;
|
|
87
192
|
}
|
|
88
193
|
/**
|
|
89
194
|
* Full case citation (volume-reporter-page format).
|
|
@@ -98,7 +203,11 @@ interface FullCaseCitation extends CitationBase {
|
|
|
98
203
|
/** Page number — optional for blank page placeholder citations (e.g., "___" or "---") */
|
|
99
204
|
page?: number;
|
|
100
205
|
pincite?: number;
|
|
206
|
+
/** Structured pincite information (page, range, footnote) */
|
|
207
|
+
pinciteInfo?: PinciteInfo;
|
|
101
208
|
court?: string;
|
|
209
|
+
/** Normalized court string: spaces collapsed, trailing period ensured */
|
|
210
|
+
normalizedCourt?: string;
|
|
102
211
|
year?: number;
|
|
103
212
|
/** Normalized reporter abbreviation from reporters-db (e.g., "F.2d" vs "F. 2d") */
|
|
104
213
|
normalizedReporter?: string;
|
|
@@ -116,12 +225,29 @@ interface FullCaseCitation extends CitationBase {
|
|
|
116
225
|
reporter: string;
|
|
117
226
|
page: number;
|
|
118
227
|
}>;
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
228
|
+
/**
|
|
229
|
+
* Explanatory parentheticals following the citation.
|
|
230
|
+
* Only populated when explanatory content is found (not court/year/disposition).
|
|
231
|
+
* @example [{ text: "holding that X requires Y", type: "holding" }]
|
|
232
|
+
*/
|
|
233
|
+
parentheticals?: Parenthetical[];
|
|
234
|
+
/**
|
|
235
|
+
* Subsequent history entries for this citation.
|
|
236
|
+
* Each entry describes a procedural event (affirmed, reversed, etc.).
|
|
237
|
+
* Only populated on the parent (original) citation.
|
|
238
|
+
* @example [{ signal: "affirmed", rawSignal: "aff'd", signalSpan: {...}, order: 0 }]
|
|
239
|
+
*/
|
|
240
|
+
subsequentHistoryEntries?: SubsequentHistoryEntry[];
|
|
241
|
+
/**
|
|
242
|
+
* Back-pointer indicating this citation is a subsequent history citation.
|
|
243
|
+
* `index` is the parent's position in the results array returned by
|
|
244
|
+
* `extractCitations()` — it becomes invalid if the array is filtered or reordered.
|
|
245
|
+
* @example { index: 0, signal: "affirmed" }
|
|
246
|
+
*/
|
|
247
|
+
subsequentHistoryOf?: {
|
|
248
|
+
index: number;
|
|
249
|
+
signal: HistorySignal;
|
|
250
|
+
};
|
|
125
251
|
/**
|
|
126
252
|
* Date information in multiple formats.
|
|
127
253
|
* - iso: ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ)
|
|
@@ -189,6 +315,18 @@ interface FullCaseCitation extends CitationBase {
|
|
|
189
315
|
*/
|
|
190
316
|
proceduralPrefix?: string;
|
|
191
317
|
/**
|
|
318
|
+
* Nominative (historical) reporter volume for early SCOTUS citations.
|
|
319
|
+
* Present only when citation includes a nominative parenthetical, e.g.,
|
|
320
|
+
* `67 U.S. (2 Black) 635` → nominativeVolume: 2
|
|
321
|
+
*/
|
|
322
|
+
nominativeVolume?: number;
|
|
323
|
+
/**
|
|
324
|
+
* Nominative (historical) reporter abbreviation for early SCOTUS citations.
|
|
325
|
+
* Present only when citation includes a nominative parenthetical, e.g.,
|
|
326
|
+
* `67 U.S. (2 Black) 635` → nominativeReporter: "Black"
|
|
327
|
+
*/
|
|
328
|
+
nominativeReporter?: string;
|
|
329
|
+
/**
|
|
192
330
|
* True when page position contains a blank placeholder ("___" or "---").
|
|
193
331
|
* Populated by Phase 5 (Blank Page support).
|
|
194
332
|
* When true, page field will be undefined and confidence reduced to 0.8.
|
|
@@ -200,6 +338,13 @@ interface FullCaseCitation extends CitationBase {
|
|
|
200
338
|
* @example "en banc", "per curiam"
|
|
201
339
|
*/
|
|
202
340
|
disposition?: string;
|
|
341
|
+
/**
|
|
342
|
+
* Court level/jurisdiction inferred from reporter series.
|
|
343
|
+
* Always populated independently of the parenthetical `court` field.
|
|
344
|
+
* Uses a curated static lookup table — does not depend on the reporter DB
|
|
345
|
+
* to preserve tree-shaking of the `eyecite-ts/data` entry point.
|
|
346
|
+
*/
|
|
347
|
+
inferredCourt?: CourtInference;
|
|
203
348
|
}
|
|
204
349
|
/**
|
|
205
350
|
* Statute citation (U.S. Code, state codes, etc.).
|
|
@@ -314,6 +459,26 @@ interface StatutesAtLargeCitation extends CitationBase {
|
|
|
314
459
|
year?: number;
|
|
315
460
|
}
|
|
316
461
|
/**
|
|
462
|
+
* Constitutional citation (U.S. or state constitution).
|
|
463
|
+
*
|
|
464
|
+
* @example "U.S. Const. art. III, § 2"
|
|
465
|
+
* @example "U.S. Const. amend. XIV, § 1"
|
|
466
|
+
* @example "Cal. Const. art. I, § 7"
|
|
467
|
+
*/
|
|
468
|
+
interface ConstitutionalCitation extends CitationBase {
|
|
469
|
+
type: "constitutional";
|
|
470
|
+
/** Jurisdiction code: "US", 2-letter state code, or undefined for bare "Const." */
|
|
471
|
+
jurisdiction?: string;
|
|
472
|
+
/** Article number (parsed from Roman numerals) — mutually exclusive with amendment */
|
|
473
|
+
article?: number;
|
|
474
|
+
/** Amendment number (parsed from Roman numerals) — mutually exclusive with article */
|
|
475
|
+
amendment?: number;
|
|
476
|
+
/** Section identifier (string to handle non-numeric like "3-a") */
|
|
477
|
+
section?: string;
|
|
478
|
+
/** Clause number (always numeric) */
|
|
479
|
+
clause?: number;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
317
482
|
* Id. citation (refers to immediately preceding citation).
|
|
318
483
|
*
|
|
319
484
|
* @example "Id."
|
|
@@ -366,16 +531,16 @@ interface ShortFormCaseCitation extends CitationBase {
|
|
|
366
531
|
* // ...
|
|
367
532
|
* }
|
|
368
533
|
*/
|
|
369
|
-
type Citation = FullCaseCitation | StatuteCitation | JournalCitation | NeutralCitation | PublicLawCitation | FederalRegisterCitation | StatutesAtLargeCitation | IdCitation | SupraCitation | ShortFormCaseCitation;
|
|
534
|
+
type Citation = FullCaseCitation | StatuteCitation | JournalCitation | NeutralCitation | PublicLawCitation | FederalRegisterCitation | StatutesAtLargeCitation | ConstitutionalCitation | IdCitation | SupraCitation | ShortFormCaseCitation;
|
|
370
535
|
/**
|
|
371
536
|
* Citation type discriminators grouped by category.
|
|
372
537
|
*/
|
|
373
|
-
type FullCitationType = "case" | "statute" | "journal" | "neutral" | "publicLaw" | "federalRegister" | "statutesAtLarge";
|
|
538
|
+
type FullCitationType = "case" | "statute" | "journal" | "neutral" | "publicLaw" | "federalRegister" | "statutesAtLarge" | "constitutional";
|
|
374
539
|
type ShortFormCitationType = "id" | "supra" | "shortFormCase";
|
|
375
540
|
/**
|
|
376
541
|
* Union of all full citation types (not short-form references).
|
|
377
542
|
*/
|
|
378
|
-
type FullCitation = FullCaseCitation | StatuteCitation | JournalCitation | NeutralCitation | PublicLawCitation | FederalRegisterCitation | StatutesAtLargeCitation;
|
|
543
|
+
type FullCitation = FullCaseCitation | StatuteCitation | JournalCitation | NeutralCitation | PublicLawCitation | FederalRegisterCitation | StatutesAtLargeCitation | ConstitutionalCitation;
|
|
379
544
|
/**
|
|
380
545
|
* Union of all short-form citation types (Id., supra, short-form case).
|
|
381
546
|
*/
|
|
@@ -398,5 +563,5 @@ type CitationOfType<T extends CitationType> = Extract<Citation, {
|
|
|
398
563
|
*/
|
|
399
564
|
type ExtractorMap = { [K in FullCitationType]: CitationOfType<K> };
|
|
400
565
|
//#endregion
|
|
401
|
-
export {
|
|
402
|
-
//# sourceMappingURL=citation-
|
|
566
|
+
export { PinciteInfo as A, StatuteCitation as C, Warning as D, SupraCitation as E, Span as O, ShortFormCitationType as S, SubsequentHistoryEntry as T, Parenthetical as _, CitationType as a, ShortFormCaseCitation as b, ExtractorMap as c, FullCitation as d, FullCitationType as f, NeutralCitation as g, JournalCitation as h, CitationSignal as i, parsePincite as j, TransformationMap as k, FederalRegisterCitation as l, IdCitation as m, CitationBase as n, ConstitutionalCitation as o, HistorySignal as p, CitationOfType as r, CourtInference as s, Citation as t, FullCaseCitation as u, ParentheticalType as v, StatutesAtLargeCitation as w, ShortFormCitation as x, PublicLawCitation as y };
|
|
567
|
+
//# sourceMappingURL=citation-By8QXtGC.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-By8QXtGC.d.cts","names":[],"sources":["../src/extract/pincite.ts","../src/types/span.ts","../src/types/citation.ts"],"mappings":"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"}
|
package/dist/data/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/data/reporters.ts"],"sourcesContent":["/**\n * Reporter database integration for citation validation\n *\n * This module provides lazy-loadable access to the reporters-db database,\n * containing 1200+ court reporters with variant forms. The library works\n * in degraded mode (pattern-based extraction only) if reporters are not loaded.\n *\n * @example\n * // Degraded mode: extraction works without reporter data\n * const citations = await extract(text)\n *\n * @example\n * // Full mode: load reporters for validation\n * await loadReporters()\n * const citations = await extract(text) // Now with reporter validation\n */\n\n/**\n * Edition entry from reporters-db\n *\n * Represents a specific edition of a reporter with start/end dates.\n */\nexport interface ReporterEdition {\n /** Start date in ISO 8601 format */\n start: string | null\n /** End date in ISO 8601 format (null if ongoing) */\n end: string | null\n}\n\n/**\n * Reporter entry from reporters-db\n *\n * Represents a single court reporter with all metadata needed for\n * citation validation and enrichment.\n *\n * Note: The reporters-db structure has the actual data; this interface\n * represents it flexibly to handle all variations in the JSON.\n */\nexport interface ReporterEntry {\n /** Full reporter name (e.g., \"Federal Reporter\") */\n name: string\n /** Citation type: state, federal, specialty, neutral, state_regional, etc. */\n cite_type: string\n /** Editions keyed by abbreviation (e.g., {\"F.2d\": {...}, \"F.3d\": {...}}) */\n editions: Record<string, ReporterEdition>\n /** Variant forms mapped to canonical form (e.g., {\"F. 2d\": \"F.2d\"}) */\n variations?: Record<string, string | undefined>\n /** MLZ jurisdiction identifiers (optional) */\n mlz_jurisdiction?: string[]\n /** Publisher (optional) */\n publisher?: string\n /** Notes (optional) */\n notes?: string\n}\n\n/**\n * In-memory reporter database with fast O(1) lookup\n *\n * Uses Map-based indexing for case-insensitive abbreviation lookup.\n * All variant forms are indexed to support fuzzy matching.\n */\nexport interface ReportersDatabase {\n /** Fast O(1) lookup by abbreviation (lowercase normalized keys) */\n byAbbreviation: Map<string, ReporterEntry[]>\n /** All reporters (for iteration/filtering) */\n all: ReporterEntry[]\n}\n\n/**\n * Cached database instance (null until loadReporters() called)\n */\nlet cached: ReportersDatabase | null = null\n\n/**\n * Load reporter database asynchronously with lazy loading\n *\n * Dynamic import prevents loading 1200+ reporters until explicitly requested.\n * Result is cached after first load for subsequent calls.\n *\n * @returns Promise resolving to indexed reporter database\n *\n * @example\n * const db = await loadReporters()\n * const reporters = db.byAbbreviation.get('f.2d') // Fast O(1) lookup\n */\nexport async function loadReporters(): Promise<ReportersDatabase> {\n if (cached) return cached\n\n // Dynamic import prevents loading until requested (keeps core bundle small)\n const data = await import(\"../../data/reporters.json\", {\n assert: { type: \"json\" },\n })\n\n const byAbbreviation = new Map<string, ReporterEntry[]>()\n const all: ReporterEntry[] = []\n\n // reporters.json structure: { \"A.\": [...], \"F.2d\": [...], ... }\n const reportersData = (data.default || data) as Record
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/data/reporters.ts"],"sourcesContent":["/**\n * Reporter database integration for citation validation\n *\n * This module provides lazy-loadable access to the reporters-db database,\n * containing 1200+ court reporters with variant forms. The library works\n * in degraded mode (pattern-based extraction only) if reporters are not loaded.\n *\n * @example\n * // Degraded mode: extraction works without reporter data\n * const citations = await extract(text)\n *\n * @example\n * // Full mode: load reporters for validation\n * await loadReporters()\n * const citations = await extract(text) // Now with reporter validation\n */\n\n/**\n * Edition entry from reporters-db\n *\n * Represents a specific edition of a reporter with start/end dates.\n */\nexport interface ReporterEdition {\n /** Start date in ISO 8601 format */\n start: string | null\n /** End date in ISO 8601 format (null if ongoing) */\n end: string | null\n}\n\n/**\n * Reporter entry from reporters-db\n *\n * Represents a single court reporter with all metadata needed for\n * citation validation and enrichment.\n *\n * Note: The reporters-db structure has the actual data; this interface\n * represents it flexibly to handle all variations in the JSON.\n */\nexport interface ReporterEntry {\n /** Full reporter name (e.g., \"Federal Reporter\") */\n name: string\n /** Citation type: state, federal, specialty, neutral, state_regional, etc. */\n cite_type: string\n /** Editions keyed by abbreviation (e.g., {\"F.2d\": {...}, \"F.3d\": {...}}) */\n editions: Record<string, ReporterEdition>\n /** Variant forms mapped to canonical form (e.g., {\"F. 2d\": \"F.2d\"}) */\n variations?: Record<string, string | undefined>\n /** MLZ jurisdiction identifiers (optional) */\n mlz_jurisdiction?: string[]\n /** Publisher (optional) */\n publisher?: string\n /** Notes (optional) */\n notes?: string\n}\n\n/**\n * In-memory reporter database with fast O(1) lookup\n *\n * Uses Map-based indexing for case-insensitive abbreviation lookup.\n * All variant forms are indexed to support fuzzy matching.\n */\nexport interface ReportersDatabase {\n /** Fast O(1) lookup by abbreviation (lowercase normalized keys) */\n byAbbreviation: Map<string, ReporterEntry[]>\n /** All reporters (for iteration/filtering) */\n all: ReporterEntry[]\n}\n\n/**\n * Cached database instance (null until loadReporters() called)\n */\nlet cached: ReportersDatabase | null = null\n\n/**\n * Load reporter database asynchronously with lazy loading\n *\n * Dynamic import prevents loading 1200+ reporters until explicitly requested.\n * Result is cached after first load for subsequent calls.\n *\n * @returns Promise resolving to indexed reporter database\n *\n * @example\n * const db = await loadReporters()\n * const reporters = db.byAbbreviation.get('f.2d') // Fast O(1) lookup\n */\nexport async function loadReporters(): Promise<ReportersDatabase> {\n if (cached) return cached\n\n // Dynamic import prevents loading until requested (keeps core bundle small)\n const data = await import(\"../../data/reporters.json\", {\n assert: { type: \"json\" },\n })\n\n const byAbbreviation = new Map<string, ReporterEntry[]>()\n const all: ReporterEntry[] = []\n\n // reporters.json structure: { \"A.\": [...], \"F.2d\": [...], ... }\n const reportersData = (data.default || data) as Record<string, ReporterEntry[]>\n\n // Build fast lookup index with lowercase normalization\n for (const [_canonicalAbbr, reporters] of Object.entries(reportersData)) {\n for (const reporter of reporters) {\n all.push(reporter)\n\n // Index by all edition abbreviations\n for (const editionAbbr of Object.keys(reporter.editions)) {\n const key = editionAbbr.toLowerCase()\n if (!byAbbreviation.has(key)) {\n byAbbreviation.set(key, [])\n }\n byAbbreviation.get(key)?.push(reporter)\n }\n\n // Index all variations for fuzzy matching\n for (const [variant, _canonical] of Object.entries(reporter.variations || {})) {\n const variantKey = variant.toLowerCase()\n if (!byAbbreviation.has(variantKey)) {\n byAbbreviation.set(variantKey, [])\n }\n byAbbreviation.get(variantKey)?.push(reporter)\n }\n }\n }\n\n cached = {\n byAbbreviation,\n all,\n }\n return cached\n}\n\n/**\n * Get cached reporter database synchronously (degraded mode support)\n *\n * Returns null if reporters not loaded yet. This enables the library to\n * work in degraded mode without reporter validation.\n *\n * @returns Cached database or null if not loaded\n *\n * @example\n * const db = getReportersSync()\n * if (db) {\n * // Full mode: validate citations\n * } else {\n * // Degraded mode: extract without validation\n * }\n */\nexport function getReportersSync(): ReportersDatabase | null {\n return cached\n}\n\n/**\n * Find reporters by abbreviation (case-insensitive)\n *\n * Loads reporter database if not already loaded. Returns all reporters\n * matching the abbreviation (including variant forms).\n *\n * @param abbr - Reporter abbreviation to look up\n * @returns Promise resolving to matching reporters (empty array if none)\n *\n * @example\n * const reporters = await findReportersByAbbreviation('F.2d')\n * // [{ abbreviation: 'F.2d', name: 'Federal Reporter, Second Series', ... }]\n *\n * @example\n * const unknown = await findReportersByAbbreviation('NONEXISTENT')\n * // [] (empty array, not error)\n */\nexport async function findReportersByAbbreviation(abbr: string): Promise<ReporterEntry[]> {\n const db = await loadReporters()\n return db.byAbbreviation.get(abbr.toLowerCase()) ?? []\n}\n"],"mappings":"iHAuEA,IAAI,EAAmC,KAcvC,eAAsB,GAA4C,CAChE,GAAI,EAAQ,OAAO,EAGnB,IAAM,EAAO,MAAM,OAAO,4BAA6B,CACrD,OAAQ,CAAE,KAAM,OAAQ,CACzB,EAEK,EAAiB,IAAI,IACrB,EAAuB,EAAE,CAGzB,EAAiB,EAAK,SAAW,EAGvC,IAAK,GAAM,CAAC,EAAgB,KAAc,OAAO,QAAQ,EAAc,CACrE,IAAK,IAAM,KAAY,EAAW,CAChC,EAAI,KAAK,EAAS,CAGlB,IAAK,IAAM,KAAe,OAAO,KAAK,EAAS,SAAS,CAAE,CACxD,IAAM,EAAM,EAAY,aAAa,CAChC,EAAe,IAAI,EAAI,EAC1B,EAAe,IAAI,EAAK,EAAE,CAAC,CAE7B,EAAe,IAAI,EAAI,EAAE,KAAK,EAAS,CAIzC,IAAK,GAAM,CAAC,EAAS,KAAe,OAAO,QAAQ,EAAS,YAAc,EAAE,CAAC,CAAE,CAC7E,IAAM,EAAa,EAAQ,aAAa,CACnC,EAAe,IAAI,EAAW,EACjC,EAAe,IAAI,EAAY,EAAE,CAAC,CAEpC,EAAe,IAAI,EAAW,EAAE,KAAK,EAAS,EASpD,MAJA,GAAS,CACP,iBACA,MACD,CACM,EAmBT,SAAgB,GAA6C,CAC3D,OAAO,EAoBT,eAAsB,EAA4B,EAAwC,CAExF,OADW,MAAM,GAAe,EACtB,eAAe,IAAI,EAAK,aAAa,CAAC,EAAI,EAAE"}
|
package/dist/data/index.d.cts
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
+
//#region src/data/knownCodes.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Known statutory code registry for abbreviated-code jurisdictions
|
|
4
|
+
*
|
|
5
|
+
* Provides a registry of state statutory codes that use abbreviated
|
|
6
|
+
* citation forms (e.g., "R.C. § 1.01", "MCL 750.83"). Used by the
|
|
7
|
+
* citation extractor to identify and normalize state statute citations.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A single entry in the known codes registry.
|
|
11
|
+
*
|
|
12
|
+
* PA has two entries (Pa.C.S. and P.S.) because it has two distinct
|
|
13
|
+
* code families with separate abbreviation sets.
|
|
14
|
+
*/
|
|
15
|
+
interface CodeEntry {
|
|
16
|
+
/** Two-letter state abbreviation (e.g., "OH", "MI") */
|
|
17
|
+
jurisdiction: string;
|
|
18
|
+
/** Short canonical abbreviation used internally (e.g., "RC", "MCL") */
|
|
19
|
+
abbreviation: string;
|
|
20
|
+
/** All recognized text patterns that identify this code */
|
|
21
|
+
patterns: string[];
|
|
22
|
+
/** Citation family — determines which citation pattern family this belongs to */
|
|
23
|
+
family: "federal" | "named" | "abbreviated" | "chapterAct" | "prose";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Registry of state statutory codes that use abbreviated citation forms.
|
|
27
|
+
*
|
|
28
|
+
* Covers 12 jurisdictions. Pennsylvania has two entries because it
|
|
29
|
+
* maintains two distinct code families (Pa.C.S. and P.S.).
|
|
30
|
+
*
|
|
31
|
+
* Note: Short 2-letter patterns (GS, IC, PS, RC, FS) may produce false positives
|
|
32
|
+
* in non-legal text (e.g., "GS 5" for government service grade). The extraction
|
|
33
|
+
* layer mitigates this via confidence scoring — citations without a § symbol receive
|
|
34
|
+
* lower confidence (0.85 vs 0.95). Consumers should filter by confidence threshold.
|
|
35
|
+
*/
|
|
36
|
+
declare const abbreviatedCodes: CodeEntry[];
|
|
37
|
+
/**
|
|
38
|
+
* Registry of state statutory codes that use named-code citation forms.
|
|
39
|
+
*
|
|
40
|
+
* Named-code jurisdictions identify their code by name in citations (e.g.,
|
|
41
|
+
* "N.Y. Penal Law § 120.05", "Cal. Civ. Proc. Code § 437c"), rather than by
|
|
42
|
+
* a standalone abbreviation. The jurisdiction prefix is handled by the
|
|
43
|
+
* extraction layer; these patterns cover only the code name portion.
|
|
44
|
+
*
|
|
45
|
+
* Ordering note: within each jurisdiction, more specific patterns must come
|
|
46
|
+
* before more general ones (e.g., "Civ. Proc." before "Civ.") so that
|
|
47
|
+
* findNamedCode's longest-match wins correctly.
|
|
48
|
+
*
|
|
49
|
+
* Covers 7 jurisdictions: NY (21 entries), CA (29 entries), TX (29 entries),
|
|
50
|
+
* MD (36 entries), VA (1 entry), AL (1 entry), MA (1 entry).
|
|
51
|
+
*/
|
|
52
|
+
declare const namedCodes: CodeEntry[];
|
|
53
|
+
/**
|
|
54
|
+
* Find a CodeEntry by jurisdiction and code name token.
|
|
55
|
+
*
|
|
56
|
+
* Lookup strategy: for each candidate entry in the given jurisdiction,
|
|
57
|
+
* check whether the normalized codeName matches or starts with any of the
|
|
58
|
+
* entry's patterns (case-insensitive). Returns the entry with the longest
|
|
59
|
+
* matching pattern to prefer more specific codes over general ones
|
|
60
|
+
* (e.g., "Civ. Proc." over "Civ.").
|
|
61
|
+
*
|
|
62
|
+
* @param jurisdiction - Two-letter state abbreviation (e.g., "CA", "NY")
|
|
63
|
+
* @param codeName - The code name token to look up (e.g., "Penal", "Civ. Proc.")
|
|
64
|
+
* @returns Matching CodeEntry, or undefined if not found
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* findNamedCode('NY', 'Penal') // → NY PEN entry
|
|
68
|
+
* findNamedCode('CA', 'Civ. Proc.') // → CA CCP entry (not CA CIV)
|
|
69
|
+
* findNamedCode('MD', 'Crim. Law') // → MD gcr entry
|
|
70
|
+
* findNamedCode('NY', 'Unknown') // → undefined
|
|
71
|
+
*/
|
|
72
|
+
declare function findNamedCode(jurisdiction: string, codeName: string): CodeEntry | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Find a CodeEntry by an abbreviated text token.
|
|
75
|
+
*
|
|
76
|
+
* Lookup order:
|
|
77
|
+
* 1. Exact case-insensitive match against all patterns
|
|
78
|
+
* 2. Prefix match — returns the entry whose pattern is the longest
|
|
79
|
+
* prefix of `abbrevText` (handles tokens like "RCW" inside longer text)
|
|
80
|
+
*
|
|
81
|
+
* @param abbrevText - The abbreviation token to look up
|
|
82
|
+
* @returns Matching CodeEntry, or undefined if not found
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* findAbbreviatedCode('R.C.') // → OH entry
|
|
86
|
+
* findAbbreviatedCode('MCL') // → MI entry
|
|
87
|
+
* findAbbreviatedCode('UNKNOWN') // → undefined
|
|
88
|
+
*/
|
|
89
|
+
declare function findAbbreviatedCode(abbrevText: string): CodeEntry | undefined;
|
|
90
|
+
//#endregion
|
|
1
91
|
//#region src/data/reporters.d.ts
|
|
2
92
|
/**
|
|
3
93
|
* Reporter database integration for citation validation
|
|
@@ -112,95 +202,5 @@ declare function getReportersSync(): ReportersDatabase | null;
|
|
|
112
202
|
*/
|
|
113
203
|
declare function findReportersByAbbreviation(abbr: string): Promise<ReporterEntry[]>;
|
|
114
204
|
//#endregion
|
|
115
|
-
//#region src/data/knownCodes.d.ts
|
|
116
|
-
/**
|
|
117
|
-
* Known statutory code registry for abbreviated-code jurisdictions
|
|
118
|
-
*
|
|
119
|
-
* Provides a registry of state statutory codes that use abbreviated
|
|
120
|
-
* citation forms (e.g., "R.C. § 1.01", "MCL 750.83"). Used by the
|
|
121
|
-
* citation extractor to identify and normalize state statute citations.
|
|
122
|
-
*/
|
|
123
|
-
/**
|
|
124
|
-
* A single entry in the known codes registry.
|
|
125
|
-
*
|
|
126
|
-
* PA has two entries (Pa.C.S. and P.S.) because it has two distinct
|
|
127
|
-
* code families with separate abbreviation sets.
|
|
128
|
-
*/
|
|
129
|
-
interface CodeEntry {
|
|
130
|
-
/** Two-letter state abbreviation (e.g., "OH", "MI") */
|
|
131
|
-
jurisdiction: string;
|
|
132
|
-
/** Short canonical abbreviation used internally (e.g., "RC", "MCL") */
|
|
133
|
-
abbreviation: string;
|
|
134
|
-
/** All recognized text patterns that identify this code */
|
|
135
|
-
patterns: string[];
|
|
136
|
-
/** Citation family — determines which citation pattern family this belongs to */
|
|
137
|
-
family: "federal" | "named" | "abbreviated" | "chapterAct" | "prose";
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Registry of state statutory codes that use abbreviated citation forms.
|
|
141
|
-
*
|
|
142
|
-
* Covers 12 jurisdictions. Pennsylvania has two entries because it
|
|
143
|
-
* maintains two distinct code families (Pa.C.S. and P.S.).
|
|
144
|
-
*
|
|
145
|
-
* Note: Short 2-letter patterns (GS, IC, PS, RC, FS) may produce false positives
|
|
146
|
-
* in non-legal text (e.g., "GS 5" for government service grade). The extraction
|
|
147
|
-
* layer mitigates this via confidence scoring — citations without a § symbol receive
|
|
148
|
-
* lower confidence (0.85 vs 0.95). Consumers should filter by confidence threshold.
|
|
149
|
-
*/
|
|
150
|
-
declare const abbreviatedCodes: CodeEntry[];
|
|
151
|
-
/**
|
|
152
|
-
* Registry of state statutory codes that use named-code citation forms.
|
|
153
|
-
*
|
|
154
|
-
* Named-code jurisdictions identify their code by name in citations (e.g.,
|
|
155
|
-
* "N.Y. Penal Law § 120.05", "Cal. Civ. Proc. Code § 437c"), rather than by
|
|
156
|
-
* a standalone abbreviation. The jurisdiction prefix is handled by the
|
|
157
|
-
* extraction layer; these patterns cover only the code name portion.
|
|
158
|
-
*
|
|
159
|
-
* Ordering note: within each jurisdiction, more specific patterns must come
|
|
160
|
-
* before more general ones (e.g., "Civ. Proc." before "Civ.") so that
|
|
161
|
-
* findNamedCode's longest-match wins correctly.
|
|
162
|
-
*
|
|
163
|
-
* Covers 7 jurisdictions: NY (21 entries), CA (29 entries), TX (29 entries),
|
|
164
|
-
* MD (36 entries), VA (1 entry), AL (1 entry), MA (1 entry).
|
|
165
|
-
*/
|
|
166
|
-
declare const namedCodes: CodeEntry[];
|
|
167
|
-
/**
|
|
168
|
-
* Find a CodeEntry by jurisdiction and code name token.
|
|
169
|
-
*
|
|
170
|
-
* Lookup strategy: for each candidate entry in the given jurisdiction,
|
|
171
|
-
* check whether the normalized codeName matches or starts with any of the
|
|
172
|
-
* entry's patterns (case-insensitive). Returns the entry with the longest
|
|
173
|
-
* matching pattern to prefer more specific codes over general ones
|
|
174
|
-
* (e.g., "Civ. Proc." over "Civ.").
|
|
175
|
-
*
|
|
176
|
-
* @param jurisdiction - Two-letter state abbreviation (e.g., "CA", "NY")
|
|
177
|
-
* @param codeName - The code name token to look up (e.g., "Penal", "Civ. Proc.")
|
|
178
|
-
* @returns Matching CodeEntry, or undefined if not found
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* findNamedCode('NY', 'Penal') // → NY PEN entry
|
|
182
|
-
* findNamedCode('CA', 'Civ. Proc.') // → CA CCP entry (not CA CIV)
|
|
183
|
-
* findNamedCode('MD', 'Crim. Law') // → MD gcr entry
|
|
184
|
-
* findNamedCode('NY', 'Unknown') // → undefined
|
|
185
|
-
*/
|
|
186
|
-
declare function findNamedCode(jurisdiction: string, codeName: string): CodeEntry | undefined;
|
|
187
|
-
/**
|
|
188
|
-
* Find a CodeEntry by an abbreviated text token.
|
|
189
|
-
*
|
|
190
|
-
* Lookup order:
|
|
191
|
-
* 1. Exact case-insensitive match against all patterns
|
|
192
|
-
* 2. Prefix match — returns the entry whose pattern is the longest
|
|
193
|
-
* prefix of `abbrevText` (handles tokens like "RCW" inside longer text)
|
|
194
|
-
*
|
|
195
|
-
* @param abbrevText - The abbreviation token to look up
|
|
196
|
-
* @returns Matching CodeEntry, or undefined if not found
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* findAbbreviatedCode('R.C.') // → OH entry
|
|
200
|
-
* findAbbreviatedCode('MCL') // → MI entry
|
|
201
|
-
* findAbbreviatedCode('UNKNOWN') // → undefined
|
|
202
|
-
*/
|
|
203
|
-
declare function findAbbreviatedCode(abbrevText: string): CodeEntry | undefined;
|
|
204
|
-
//#endregion
|
|
205
205
|
export { CodeEntry, ReporterEdition, ReporterEntry, ReportersDatabase, abbreviatedCodes, findAbbreviatedCode, findNamedCode, findReportersByAbbreviation, getReportersSync, loadReporters, namedCodes };
|
|
206
206
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/data/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/data/knownCodes.ts","../../src/data/reporters.ts"],"mappings":";;AAcA;;;;;;;;;;AAsBA;;UAtBiB,SAAA;EAsBc;EApB7B,YAAA;EAqIF;EAnIE,YAAA;;EAEA,QAAA;EAiIuB;EA/HvB,MAAA;AAAA;;;;;;;;AAs6BF;;;;cAx5Ba,gBAAA,EAAkB,SAAA;;;;ACd/B;;;;;AAgBA;;;;;;;cD+Ga,UAAA,EAAY,SAAA;;;;;;;;;;;;;ACxFzB;;;;;;;iBDi0BgB,aAAA,CAAc,YAAA,UAAsB,QAAA,WAAmB,SAAA;;;;;;;;ACzyBvE;;;;;AA8DA;;;;iBDyyBgB,mBAAA,CAAoB,UAAA,WAAqB,SAAA;;;;AA96BzD;;;;;;;;;;AAsBA;;;;;AAiHA;;;;;AAAA,UC/HiB,eAAA;EDw2BD;ECt2Bd,KAAA;EDs2BqE;ECp2BrE,GAAA;AAAA;;;;ADk6BF;;;;;;UCt5BiB,aAAA;;EAEf,IAAA;EAlBe;EAoBf,SAAA;EApBe;EAsBf,QAAA,EAAU,MAAA,SAAe,eAAA;EAN3B;EAQE,UAAA,GAAa,MAAA;;EAEb,gBAAA;;EAEA,SAAA;;EAEA,KAAA;AAAA;;;;;;;UASe,iBAAA;;EAEf,cAAA,EAAgB,GAAA,SAAY,aAAA;;EAE5B,GAAA,EAAK,aAAA;AAAA;;;;;;;;;;;;;iBAoBe,aAAA,CAAA,GAAiB,OAAA,CAAQ,iBAAA;;AAA/C;;;;;AA8DA;;;;;AAqBA;;;;;iBArBgB,gBAAA,CAAA,GAAoB,iBAAA;;;;;;;;;;;;;;;;;;iBAqBd,2BAAA,CAA4B,IAAA,WAAe,OAAA,CAAQ,aAAA"}
|