eyecite-ts 0.8.4 → 0.10.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 +1 -2
- package/dist/annotate/index.d.cts +1 -1
- package/dist/annotate/index.d.mts +1 -1
- package/dist/{citation-Cp0M8pGK.d.cts → citation-CCExUh08.d.mts} +144 -2
- package/dist/citation-CCExUh08.d.mts.map +1 -0
- package/dist/{citation-GF9_w_kw.d.mts → citation-DEZNY4qH.d.cts} +144 -2
- package/dist/citation-DEZNY4qH.d.cts.map +1 -0
- package/dist/data/index.cjs +1 -1
- package/dist/data/index.d.cts +29 -15
- package/dist/data/index.d.cts.map +1 -1
- package/dist/data/index.d.mts +29 -15
- package/dist/data/index.d.mts.map +1 -1
- package/dist/data/index.mjs +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 +13 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +13 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/knownCodes-D_EXxDqq.cjs +2 -0
- package/dist/knownCodes-D_EXxDqq.cjs.map +1 -0
- package/dist/knownCodes-WUweUwCB.mjs +2 -0
- package/dist/knownCodes-WUweUwCB.mjs.map +1 -0
- package/dist/{types-BCj-F1CQ.d.mts → types-6BYsuJiz.d.mts} +2 -8
- package/dist/types-6BYsuJiz.d.mts.map +1 -0
- package/dist/{types-DsYwn8kp.d.cts → types-Q1_sllNN.d.cts} +2 -8
- package/dist/types-Q1_sllNN.d.cts.map +1 -0
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.mts +2 -2
- package/package.json +1 -1
- package/dist/citation-Cp0M8pGK.d.cts.map +0 -1
- package/dist/citation-GF9_w_kw.d.mts.map +0 -1
- package/dist/knownCodes-DBWj7s2T.cjs +0 -2
- package/dist/knownCodes-DBWj7s2T.cjs.map +0 -1
- package/dist/knownCodes-DTkb3Uw9.mjs +0 -2
- package/dist/knownCodes-DTkb3Uw9.mjs.map +0 -1
- package/dist/types-BCj-F1CQ.d.mts.map +0 -1
- package/dist/types-DsYwn8kp.d.cts.map +0 -1
package/README.md
CHANGED
|
@@ -313,7 +313,6 @@ const resolved = resolveCitations(citations, text, {
|
|
|
313
313
|
| `paragraphBoundaryPattern` | `RegExp` | `/\n\n+/` | Pattern to detect paragraphs |
|
|
314
314
|
| `fuzzyPartyMatching` | `boolean` | `true` | Enable fuzzy party name matching for supra |
|
|
315
315
|
| `partyMatchThreshold` | `number` | `0.8` | Similarity threshold (0-1) for fuzzy matching |
|
|
316
|
-
| `allowNestedResolution` | `boolean` | `false` | Allow Id. to resolve to other short-form citations |
|
|
317
316
|
| `reportUnresolved` | `boolean` | `true` | Report failure reasons for unresolved citations |
|
|
318
317
|
|
|
319
318
|
### Resolution Examples
|
|
@@ -347,7 +346,7 @@ const citations = extractCitations(text, { resolve: true })
|
|
|
347
346
|
```typescript
|
|
348
347
|
const text = 'Id. at 100.' // Orphan Id. with no preceding citation
|
|
349
348
|
const citations = extractCitations(text, { resolve: true })
|
|
350
|
-
// citations[0].resolution.failureReason === 'No preceding
|
|
349
|
+
// citations[0].resolution.failureReason === 'No preceding citation found'
|
|
351
350
|
```
|
|
352
351
|
|
|
353
352
|
## Citation Annotation
|
|
@@ -107,6 +107,130 @@ interface TransformationMap {
|
|
|
107
107
|
/** Compressed segment-based clean→original mapping for O(log k) lookup */
|
|
108
108
|
cleanToOriginalSegments?: SegmentMap;
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Build a Span for a regex capture group using match.indices (ES2022 `d` flag).
|
|
112
|
+
*
|
|
113
|
+
* Requires the regex to have the `d` flag so match.indices is populated.
|
|
114
|
+
* The indices are relative to the token text — tokenCleanStart translates
|
|
115
|
+
* them to document-level clean-text positions, then resolveOriginalSpan
|
|
116
|
+
* maps to original positions via TransformationMap.
|
|
117
|
+
*
|
|
118
|
+
* @param tokenCleanStart - The token's cleanStart position in the document
|
|
119
|
+
* @param indices - match.indices[n] for the capture group: [start, end]
|
|
120
|
+
* @param map - TransformationMap for clean→original resolution
|
|
121
|
+
* @returns Span with both clean and original coordinates
|
|
122
|
+
*/
|
|
123
|
+
declare function spanFromGroupIndex(tokenCleanStart: number, indices: [number, number], map: TransformationMap): Span;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/types/componentSpans.d.ts
|
|
126
|
+
/**
|
|
127
|
+
* Component spans for case citations (type: "case").
|
|
128
|
+
*
|
|
129
|
+
* Containment: when both `metadataParenthetical` and `court`/`year` are present,
|
|
130
|
+
* `court` and `year` are sub-ranges within `metadataParenthetical`. Consumers
|
|
131
|
+
* rendering highlights should use either the parent or child spans, not both.
|
|
132
|
+
*/
|
|
133
|
+
interface CaseComponentSpans {
|
|
134
|
+
caseName?: Span;
|
|
135
|
+
plaintiff?: Span;
|
|
136
|
+
defendant?: Span;
|
|
137
|
+
volume?: Span;
|
|
138
|
+
reporter?: Span;
|
|
139
|
+
page?: Span;
|
|
140
|
+
pincite?: Span;
|
|
141
|
+
court?: Span;
|
|
142
|
+
year?: Span;
|
|
143
|
+
signal?: Span;
|
|
144
|
+
metadataParenthetical?: Span;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Component spans for statute citations (type: "statute").
|
|
148
|
+
*
|
|
149
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
150
|
+
* populated for case citations.
|
|
151
|
+
*/
|
|
152
|
+
interface StatuteComponentSpans {
|
|
153
|
+
title?: Span;
|
|
154
|
+
code?: Span;
|
|
155
|
+
section?: Span;
|
|
156
|
+
subsection?: Span;
|
|
157
|
+
signal?: Span;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Component spans for constitutional citations (type: "constitutional").
|
|
161
|
+
*
|
|
162
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
163
|
+
* populated for case citations.
|
|
164
|
+
*/
|
|
165
|
+
interface ConstitutionalComponentSpans {
|
|
166
|
+
jurisdiction?: Span;
|
|
167
|
+
article?: Span;
|
|
168
|
+
amendment?: Span;
|
|
169
|
+
section?: Span;
|
|
170
|
+
clause?: Span;
|
|
171
|
+
signal?: Span;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Component spans for journal citations (type: "journal").
|
|
175
|
+
*
|
|
176
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
177
|
+
* populated for case citations.
|
|
178
|
+
*/
|
|
179
|
+
interface JournalComponentSpans {
|
|
180
|
+
volume?: Span;
|
|
181
|
+
journal?: Span;
|
|
182
|
+
page?: Span;
|
|
183
|
+
pincite?: Span;
|
|
184
|
+
year?: Span;
|
|
185
|
+
signal?: Span;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Component spans for neutral citations (type: "neutral").
|
|
189
|
+
*
|
|
190
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
191
|
+
* populated for case citations.
|
|
192
|
+
*/
|
|
193
|
+
interface NeutralComponentSpans {
|
|
194
|
+
year?: Span;
|
|
195
|
+
court?: Span;
|
|
196
|
+
documentNumber?: Span;
|
|
197
|
+
signal?: Span;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Component spans for public law citations (type: "publicLaw").
|
|
201
|
+
*
|
|
202
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
203
|
+
* populated for case citations.
|
|
204
|
+
*/
|
|
205
|
+
interface PublicLawComponentSpans {
|
|
206
|
+
congress?: Span;
|
|
207
|
+
lawNumber?: Span;
|
|
208
|
+
signal?: Span;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Component spans for federal register citations (type: "federalRegister").
|
|
212
|
+
*
|
|
213
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
214
|
+
* populated for case citations.
|
|
215
|
+
*/
|
|
216
|
+
interface FederalRegisterComponentSpans {
|
|
217
|
+
volume?: Span;
|
|
218
|
+
page?: Span;
|
|
219
|
+
year?: Span;
|
|
220
|
+
signal?: Span;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Component spans for statutes at large citations (type: "statutesAtLarge").
|
|
224
|
+
*
|
|
225
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
226
|
+
* populated for case citations.
|
|
227
|
+
*/
|
|
228
|
+
interface StatutesAtLargeComponentSpans {
|
|
229
|
+
volume?: Span;
|
|
230
|
+
page?: Span;
|
|
231
|
+
year?: Span;
|
|
232
|
+
signal?: Span;
|
|
233
|
+
}
|
|
110
234
|
//#endregion
|
|
111
235
|
//#region src/types/citation.d.ts
|
|
112
236
|
/**
|
|
@@ -204,6 +328,8 @@ interface Parenthetical {
|
|
|
204
328
|
text: string;
|
|
205
329
|
/** Signal-word classification based on leading gerund */
|
|
206
330
|
type: ParentheticalType;
|
|
331
|
+
/** Position of full parenthetical block including delimiters */
|
|
332
|
+
span?: Span;
|
|
207
333
|
}
|
|
208
334
|
/**
|
|
209
335
|
* Normalized subsequent history signal classification.
|
|
@@ -383,6 +509,8 @@ interface FullCaseCitation extends CitationBase {
|
|
|
383
509
|
* to preserve tree-shaking of the `eyecite-ts/data` entry point.
|
|
384
510
|
*/
|
|
385
511
|
inferredCourt?: CourtInference;
|
|
512
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
513
|
+
spans?: CaseComponentSpans;
|
|
386
514
|
}
|
|
387
515
|
/**
|
|
388
516
|
* Statute citation (U.S. Code, state codes, etc.).
|
|
@@ -407,6 +535,8 @@ interface StatuteCitation extends CitationBase {
|
|
|
407
535
|
pincite?: string;
|
|
408
536
|
/** True when "et seq." follows the citation */
|
|
409
537
|
hasEtSeq?: boolean;
|
|
538
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
539
|
+
spans?: StatuteComponentSpans;
|
|
410
540
|
}
|
|
411
541
|
/**
|
|
412
542
|
* Journal citation (law review, legal periodical).
|
|
@@ -434,6 +564,8 @@ interface JournalCitation extends CitationBase {
|
|
|
434
564
|
pincite?: number;
|
|
435
565
|
/** Publication year */
|
|
436
566
|
year?: number;
|
|
567
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
568
|
+
spans?: JournalComponentSpans;
|
|
437
569
|
}
|
|
438
570
|
/**
|
|
439
571
|
* Neutral citation (vendor-neutral format).
|
|
@@ -451,6 +583,8 @@ interface NeutralCitation extends CitationBase {
|
|
|
451
583
|
court: string;
|
|
452
584
|
/** Document number */
|
|
453
585
|
documentNumber: string;
|
|
586
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
587
|
+
spans?: NeutralComponentSpans;
|
|
454
588
|
}
|
|
455
589
|
/**
|
|
456
590
|
* Public law citation (federal legislation).
|
|
@@ -468,6 +602,8 @@ interface PublicLawCitation extends CitationBase {
|
|
|
468
602
|
lawNumber: number;
|
|
469
603
|
/** Optional bill title extracted from nearby text */
|
|
470
604
|
title?: string;
|
|
605
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
606
|
+
spans?: PublicLawComponentSpans;
|
|
471
607
|
}
|
|
472
608
|
/**
|
|
473
609
|
* Federal Register citation.
|
|
@@ -485,6 +621,8 @@ interface FederalRegisterCitation extends CitationBase {
|
|
|
485
621
|
page: number;
|
|
486
622
|
/** Publication year (if extracted) */
|
|
487
623
|
year?: number;
|
|
624
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
625
|
+
spans?: FederalRegisterComponentSpans;
|
|
488
626
|
}
|
|
489
627
|
/** Citation to the Statutes at Large (session law compilation) */
|
|
490
628
|
interface StatutesAtLargeCitation extends CitationBase {
|
|
@@ -495,6 +633,8 @@ interface StatutesAtLargeCitation extends CitationBase {
|
|
|
495
633
|
page: number;
|
|
496
634
|
/** Publication year (if extracted) */
|
|
497
635
|
year?: number;
|
|
636
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
637
|
+
spans?: StatutesAtLargeComponentSpans;
|
|
498
638
|
}
|
|
499
639
|
/**
|
|
500
640
|
* Constitutional citation (U.S. or state constitution).
|
|
@@ -515,6 +655,8 @@ interface ConstitutionalCitation extends CitationBase {
|
|
|
515
655
|
section?: string;
|
|
516
656
|
/** Clause number (always numeric) */
|
|
517
657
|
clause?: number;
|
|
658
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
659
|
+
spans?: ConstitutionalComponentSpans;
|
|
518
660
|
}
|
|
519
661
|
/**
|
|
520
662
|
* Id. citation (refers to immediately preceding citation).
|
|
@@ -601,5 +743,5 @@ type CitationOfType<T extends CitationType> = Extract<Citation, {
|
|
|
601
743
|
*/
|
|
602
744
|
type ExtractorMap = { [K in FullCitationType]: CitationOfType<K> };
|
|
603
745
|
//#endregion
|
|
604
|
-
export {
|
|
605
|
-
//# sourceMappingURL=citation-
|
|
746
|
+
export { FederalRegisterComponentSpans as A, parsePincite as B, StatuteCitation as C, Warning as D, SupraCitation as E, StatutesAtLargeComponentSpans as F, Span as I, TransformationMap as L, NeutralComponentSpans as M, PublicLawComponentSpans as N, CaseComponentSpans as O, StatuteComponentSpans as P, spanFromGroupIndex as R, 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, JournalComponentSpans as j, ConstitutionalComponentSpans 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, PinciteInfo as z };
|
|
747
|
+
//# sourceMappingURL=citation-CCExUh08.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-CCExUh08.d.mts","names":[],"sources":["../src/extract/pincite.ts","../src/clean/segmentMap.ts","../src/types/span.ts","../src/types/componentSpans.ts","../src/types/citation.ts"],"mappings":";;AAGA;;UAAiB,WAAA;EAAA;EAEf,IAAA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ACA,MAAA;EACA,QAAA;EACA,IAAA;EACA,OAAA;AAAA;;;;AAhKF;;;;;;;;;;;;;;KAoLY,QAAA,GACR,gBAAA,GACA,eAAA,GACA,eAAA,GACA,eAAA,GACA,iBAAA,GACA,uBAAA,GACA,uBAAA,GACA,sBAAA,GACA,UAAA,GACA,aAAA,GACA,qBAAA;;;;KAKQ,gBAAA;AAAA,KASA,qBAAA;;;;KAKA,YAAA,GACR,gBAAA,GACA,eAAA,GACA,eAAA,GACA,eAAA,GACA,iBAAA,GACA,uBAAA,GACA,uBAAA,GACA,sBAAA;;;;KAKQ,iBAAA,GAAoB,UAAA,GAAa,aAAA,GAAgB,qBAAA;;;;AA3K7D;;;;;;KAsLY,cAAA,WAAyB,YAAA,IAAgB,OAAA,CAAQ,QAAA;EAAY,IAAA,EAAM,CAAA;AAAA;;;;;KAMnE,YAAA,WACJ,gBAAA,GAAmB,cAAA,CAAe,CAAA"}
|
|
@@ -107,6 +107,130 @@ interface TransformationMap {
|
|
|
107
107
|
/** Compressed segment-based clean→original mapping for O(log k) lookup */
|
|
108
108
|
cleanToOriginalSegments?: SegmentMap;
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Build a Span for a regex capture group using match.indices (ES2022 `d` flag).
|
|
112
|
+
*
|
|
113
|
+
* Requires the regex to have the `d` flag so match.indices is populated.
|
|
114
|
+
* The indices are relative to the token text — tokenCleanStart translates
|
|
115
|
+
* them to document-level clean-text positions, then resolveOriginalSpan
|
|
116
|
+
* maps to original positions via TransformationMap.
|
|
117
|
+
*
|
|
118
|
+
* @param tokenCleanStart - The token's cleanStart position in the document
|
|
119
|
+
* @param indices - match.indices[n] for the capture group: [start, end]
|
|
120
|
+
* @param map - TransformationMap for clean→original resolution
|
|
121
|
+
* @returns Span with both clean and original coordinates
|
|
122
|
+
*/
|
|
123
|
+
declare function spanFromGroupIndex(tokenCleanStart: number, indices: [number, number], map: TransformationMap): Span;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/types/componentSpans.d.ts
|
|
126
|
+
/**
|
|
127
|
+
* Component spans for case citations (type: "case").
|
|
128
|
+
*
|
|
129
|
+
* Containment: when both `metadataParenthetical` and `court`/`year` are present,
|
|
130
|
+
* `court` and `year` are sub-ranges within `metadataParenthetical`. Consumers
|
|
131
|
+
* rendering highlights should use either the parent or child spans, not both.
|
|
132
|
+
*/
|
|
133
|
+
interface CaseComponentSpans {
|
|
134
|
+
caseName?: Span;
|
|
135
|
+
plaintiff?: Span;
|
|
136
|
+
defendant?: Span;
|
|
137
|
+
volume?: Span;
|
|
138
|
+
reporter?: Span;
|
|
139
|
+
page?: Span;
|
|
140
|
+
pincite?: Span;
|
|
141
|
+
court?: Span;
|
|
142
|
+
year?: Span;
|
|
143
|
+
signal?: Span;
|
|
144
|
+
metadataParenthetical?: Span;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Component spans for statute citations (type: "statute").
|
|
148
|
+
*
|
|
149
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
150
|
+
* populated for case citations.
|
|
151
|
+
*/
|
|
152
|
+
interface StatuteComponentSpans {
|
|
153
|
+
title?: Span;
|
|
154
|
+
code?: Span;
|
|
155
|
+
section?: Span;
|
|
156
|
+
subsection?: Span;
|
|
157
|
+
signal?: Span;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Component spans for constitutional citations (type: "constitutional").
|
|
161
|
+
*
|
|
162
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
163
|
+
* populated for case citations.
|
|
164
|
+
*/
|
|
165
|
+
interface ConstitutionalComponentSpans {
|
|
166
|
+
jurisdiction?: Span;
|
|
167
|
+
article?: Span;
|
|
168
|
+
amendment?: Span;
|
|
169
|
+
section?: Span;
|
|
170
|
+
clause?: Span;
|
|
171
|
+
signal?: Span;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Component spans for journal citations (type: "journal").
|
|
175
|
+
*
|
|
176
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
177
|
+
* populated for case citations.
|
|
178
|
+
*/
|
|
179
|
+
interface JournalComponentSpans {
|
|
180
|
+
volume?: Span;
|
|
181
|
+
journal?: Span;
|
|
182
|
+
page?: Span;
|
|
183
|
+
pincite?: Span;
|
|
184
|
+
year?: Span;
|
|
185
|
+
signal?: Span;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Component spans for neutral citations (type: "neutral").
|
|
189
|
+
*
|
|
190
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
191
|
+
* populated for case citations.
|
|
192
|
+
*/
|
|
193
|
+
interface NeutralComponentSpans {
|
|
194
|
+
year?: Span;
|
|
195
|
+
court?: Span;
|
|
196
|
+
documentNumber?: Span;
|
|
197
|
+
signal?: Span;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Component spans for public law citations (type: "publicLaw").
|
|
201
|
+
*
|
|
202
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
203
|
+
* populated for case citations.
|
|
204
|
+
*/
|
|
205
|
+
interface PublicLawComponentSpans {
|
|
206
|
+
congress?: Span;
|
|
207
|
+
lawNumber?: Span;
|
|
208
|
+
signal?: Span;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Component spans for federal register citations (type: "federalRegister").
|
|
212
|
+
*
|
|
213
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
214
|
+
* populated for case citations.
|
|
215
|
+
*/
|
|
216
|
+
interface FederalRegisterComponentSpans {
|
|
217
|
+
volume?: Span;
|
|
218
|
+
page?: Span;
|
|
219
|
+
year?: Span;
|
|
220
|
+
signal?: Span;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Component spans for statutes at large citations (type: "statutesAtLarge").
|
|
224
|
+
*
|
|
225
|
+
* Note: `signal` is included for future extensibility but is currently only
|
|
226
|
+
* populated for case citations.
|
|
227
|
+
*/
|
|
228
|
+
interface StatutesAtLargeComponentSpans {
|
|
229
|
+
volume?: Span;
|
|
230
|
+
page?: Span;
|
|
231
|
+
year?: Span;
|
|
232
|
+
signal?: Span;
|
|
233
|
+
}
|
|
110
234
|
//#endregion
|
|
111
235
|
//#region src/types/citation.d.ts
|
|
112
236
|
/**
|
|
@@ -204,6 +328,8 @@ interface Parenthetical {
|
|
|
204
328
|
text: string;
|
|
205
329
|
/** Signal-word classification based on leading gerund */
|
|
206
330
|
type: ParentheticalType;
|
|
331
|
+
/** Position of full parenthetical block including delimiters */
|
|
332
|
+
span?: Span;
|
|
207
333
|
}
|
|
208
334
|
/**
|
|
209
335
|
* Normalized subsequent history signal classification.
|
|
@@ -383,6 +509,8 @@ interface FullCaseCitation extends CitationBase {
|
|
|
383
509
|
* to preserve tree-shaking of the `eyecite-ts/data` entry point.
|
|
384
510
|
*/
|
|
385
511
|
inferredCourt?: CourtInference;
|
|
512
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
513
|
+
spans?: CaseComponentSpans;
|
|
386
514
|
}
|
|
387
515
|
/**
|
|
388
516
|
* Statute citation (U.S. Code, state codes, etc.).
|
|
@@ -407,6 +535,8 @@ interface StatuteCitation extends CitationBase {
|
|
|
407
535
|
pincite?: string;
|
|
408
536
|
/** True when "et seq." follows the citation */
|
|
409
537
|
hasEtSeq?: boolean;
|
|
538
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
539
|
+
spans?: StatuteComponentSpans;
|
|
410
540
|
}
|
|
411
541
|
/**
|
|
412
542
|
* Journal citation (law review, legal periodical).
|
|
@@ -434,6 +564,8 @@ interface JournalCitation extends CitationBase {
|
|
|
434
564
|
pincite?: number;
|
|
435
565
|
/** Publication year */
|
|
436
566
|
year?: number;
|
|
567
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
568
|
+
spans?: JournalComponentSpans;
|
|
437
569
|
}
|
|
438
570
|
/**
|
|
439
571
|
* Neutral citation (vendor-neutral format).
|
|
@@ -451,6 +583,8 @@ interface NeutralCitation extends CitationBase {
|
|
|
451
583
|
court: string;
|
|
452
584
|
/** Document number */
|
|
453
585
|
documentNumber: string;
|
|
586
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
587
|
+
spans?: NeutralComponentSpans;
|
|
454
588
|
}
|
|
455
589
|
/**
|
|
456
590
|
* Public law citation (federal legislation).
|
|
@@ -468,6 +602,8 @@ interface PublicLawCitation extends CitationBase {
|
|
|
468
602
|
lawNumber: number;
|
|
469
603
|
/** Optional bill title extracted from nearby text */
|
|
470
604
|
title?: string;
|
|
605
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
606
|
+
spans?: PublicLawComponentSpans;
|
|
471
607
|
}
|
|
472
608
|
/**
|
|
473
609
|
* Federal Register citation.
|
|
@@ -485,6 +621,8 @@ interface FederalRegisterCitation extends CitationBase {
|
|
|
485
621
|
page: number;
|
|
486
622
|
/** Publication year (if extracted) */
|
|
487
623
|
year?: number;
|
|
624
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
625
|
+
spans?: FederalRegisterComponentSpans;
|
|
488
626
|
}
|
|
489
627
|
/** Citation to the Statutes at Large (session law compilation) */
|
|
490
628
|
interface StatutesAtLargeCitation extends CitationBase {
|
|
@@ -495,6 +633,8 @@ interface StatutesAtLargeCitation extends CitationBase {
|
|
|
495
633
|
page: number;
|
|
496
634
|
/** Publication year (if extracted) */
|
|
497
635
|
year?: number;
|
|
636
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
637
|
+
spans?: StatutesAtLargeComponentSpans;
|
|
498
638
|
}
|
|
499
639
|
/**
|
|
500
640
|
* Constitutional citation (U.S. or state constitution).
|
|
@@ -515,6 +655,8 @@ interface ConstitutionalCitation extends CitationBase {
|
|
|
515
655
|
section?: string;
|
|
516
656
|
/** Clause number (always numeric) */
|
|
517
657
|
clause?: number;
|
|
658
|
+
/** Precise text positions for each parsed component of this citation. */
|
|
659
|
+
spans?: ConstitutionalComponentSpans;
|
|
518
660
|
}
|
|
519
661
|
/**
|
|
520
662
|
* Id. citation (refers to immediately preceding citation).
|
|
@@ -601,5 +743,5 @@ type CitationOfType<T extends CitationType> = Extract<Citation, {
|
|
|
601
743
|
*/
|
|
602
744
|
type ExtractorMap = { [K in FullCitationType]: CitationOfType<K> };
|
|
603
745
|
//#endregion
|
|
604
|
-
export {
|
|
605
|
-
//# sourceMappingURL=citation-
|
|
746
|
+
export { FederalRegisterComponentSpans as A, parsePincite as B, StatuteCitation as C, Warning as D, SupraCitation as E, StatutesAtLargeComponentSpans as F, Span as I, TransformationMap as L, NeutralComponentSpans as M, PublicLawComponentSpans as N, CaseComponentSpans as O, StatuteComponentSpans as P, spanFromGroupIndex as R, 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, JournalComponentSpans as j, ConstitutionalComponentSpans 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, PinciteInfo as z };
|
|
747
|
+
//# sourceMappingURL=citation-DEZNY4qH.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-DEZNY4qH.d.cts","names":[],"sources":["../src/extract/pincite.ts","../src/clean/segmentMap.ts","../src/types/span.ts","../src/types/componentSpans.ts","../src/types/citation.ts"],"mappings":";;AAGA;;UAAiB,WAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;;EAEA,QAAA;;EAEA,OAAA;EAsBF;EApBE,GAAA;AAAA;;;;;;ACLF;;;;;;;;iBDyBgB,YAAA,CAAa,GAAA,WAAc,WAAA;;;;AA9B3C;;;;;;UCKiB,OAAA;;EAEf,QAAA;;EAEA,OAAA;EDqBF;ECnBE,GAAA;AAAA;AAAA,cAGW,UAAA;EAAA,SACF,QAAA,WAAmB,OAAA;EAE5B,WAAA,CAAY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,GACA,eAAA,GACA,eAAA,GACA,eAAA,GACA,iBAAA,GACA,uBAAA,GACA,uBAAA,GACA,sBAAA;;;;KAKQ,iBAAA,GAAoB,UAAA,GAAa,aAAA,GAAgB,qBAAA;;;;AA3K7D;;;;;;KAsLY,cAAA,WAAyB,YAAA,IAAgB,OAAA,CAAQ,QAAA;EAAY,IAAA,EAAM,CAAA;AAAA;;;;;KAMnE,YAAA,WACJ,gBAAA,GAAmB,cAAA,CAAe,CAAA"}
|
package/dist/data/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../knownCodes-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../knownCodes-D_EXxDqq.cjs`);async function t(){let t=e.s();if(t)return t;let n=await import(`../../data/reporters.json`,{assert:{type:`json`}}),r=new Map,i=[],a=n.default||n;for(let[e,t]of Object.entries(a))for(let e of t){i.push(e);for(let t of Object.keys(e.editions)){let n=t.toLowerCase();r.has(n)||r.set(n,[]),r.get(n)?.push(e)}for(let[t,n]of Object.entries(e.variations||{})){let n=t.toLowerCase();r.has(n)||r.set(n,[]),r.get(n)?.push(e)}}let o={byAbbreviation:r,all:i};return e.c(o),o}function n(){return e.s()}async function r(e){return(await t()).byAbbreviation.get(e.toLowerCase())??[]}exports.abbreviatedCodes=e.t,exports.findAbbreviatedCode=e.n,exports.findNamedCode=e.r,exports.findReportersByAbbreviation=r,exports.getReportersSync=n,exports.loadReporters=t,exports.namedCodes=e.i,exports.stateStatuteEntries=e.o;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/data/index.d.cts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
//#region src/data/knownCodes.d.ts
|
|
2
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
3
|
* A single entry in the known codes registry.
|
|
11
4
|
*
|
|
12
5
|
* PA has two entries (Pa.C.S. and P.S.) because it has two distinct
|
|
@@ -24,14 +17,12 @@ interface CodeEntry {
|
|
|
24
17
|
}
|
|
25
18
|
/**
|
|
26
19
|
* Registry of state statutory codes that use abbreviated citation forms.
|
|
20
|
+
* Derived from stateStatuteEntries — the single source of truth.
|
|
27
21
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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.
|
|
22
|
+
* Note: Short 2-letter patterns (AS, GS, IC, OS, PS, RC, FS, WS) may produce
|
|
23
|
+
* false positives in non-legal text. The extraction layer mitigates this via
|
|
24
|
+
* confidence scoring — citations without a § symbol receive lower confidence
|
|
25
|
+
* (0.85 vs 0.95). Consumers should filter by confidence threshold.
|
|
35
26
|
*/
|
|
36
27
|
declare const abbreviatedCodes: CodeEntry[];
|
|
37
28
|
/**
|
|
@@ -202,5 +193,28 @@ declare function getReportersSync(): ReportersDatabase | null;
|
|
|
202
193
|
*/
|
|
203
194
|
declare function findReportersByAbbreviation(abbr: string): Promise<ReporterEntry[]>;
|
|
204
195
|
//#endregion
|
|
205
|
-
|
|
196
|
+
//#region src/data/stateStatutes.d.ts
|
|
197
|
+
/**
|
|
198
|
+
* State statute abbreviation table — single source of truth for the
|
|
199
|
+
* abbreviated-code tokenizer pattern and the knownCodes lookup registry.
|
|
200
|
+
*/
|
|
201
|
+
interface StateStatuteEntry {
|
|
202
|
+
/** Two-letter jurisdiction code (e.g., "AK", "AZ") */
|
|
203
|
+
jurisdiction: string;
|
|
204
|
+
/** All recognized abbreviation forms — used for lookup by findAbbreviatedCode */
|
|
205
|
+
abbreviations: string[];
|
|
206
|
+
/**
|
|
207
|
+
* Regex fragment for tokenizer alternation. If omitted, auto-generated
|
|
208
|
+
* from abbreviations via escapeForRegex. Provide explicitly when the
|
|
209
|
+
* pattern needs optional components (e.g., "Stat(?:utes)?").
|
|
210
|
+
*/
|
|
211
|
+
regexFragment?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Abbreviations are ordered longest-first within each entry. The last element
|
|
215
|
+
* is used as the canonical short abbreviation in knownCodes.ts.
|
|
216
|
+
*/
|
|
217
|
+
declare const stateStatuteEntries: StateStatuteEntry[];
|
|
218
|
+
//#endregion
|
|
219
|
+
export { CodeEntry, ReporterEdition, ReporterEntry, ReportersDatabase, type StateStatuteEntry, abbreviatedCodes, findAbbreviatedCode, findNamedCode, findReportersByAbbreviation, getReportersSync, loadReporters, namedCodes, stateStatuteEntries };
|
|
206
220
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/data/knownCodes.ts","../../src/data/reporters.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/data/knownCodes.ts","../../src/data/reporters.ts","../../src/data/stateStatutes.ts"],"mappings":";;AAgBA;;;;;UAAiB,SAAA;;EAEf,YAAA;;EAEA,YAAA;EAgBF;EAdE,QAAA;;EAEA,MAAA;AAAA;AAkCF;;;;;AAyuBA;;;;AAzuBA,cAtBa,gBAAA,EAAkB,SAAA;;;;;AA6zB/B;;;;;;;;AC30BA;;;cDoCa,UAAA,EAAY,SAAA;;ACpBzB;;;;;;;;;;;;;;;;;;iBD6vBgB,aAAA,CAAc,YAAA,UAAsB,QAAA,WAAmB,SAAA;;ACtuBvE;;;;;;;;;;;;;;;iBDoyBgB,mBAAA,CAAoB,UAAA,WAAqB,SAAA;;;;AAj1BzD;;;;;;;;;;AAoBA;;;;;AAsBA;;;;;AAAA,UCpCiB,eAAA;ED6wBD;EC3wBd,KAAA;ED2wBqE;ECzwBrE,GAAA;AAAA;;;;ADu0BF;;;;;;UC3zBiB,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;;;;;AA6DA;;;;;AAqBA;;;;;iBArBgB,gBAAA,CAAA,GAAoB,iBAAA;;;;;;;AC7IpC;;;;;;;;;AA6EA;;iBDqFsB,2BAAA,CAA4B,IAAA,WAAe,OAAA,CAAQ,aAAA;;;;ADvJzE;;;UEXiB,iBAAA;;EAEf,YAAA;;EAEA,aAAA;;;AF2BF;;;EErBE,aAAA;AAAA;ADOF;;;;AAAA,cC4Da,mBAAA,EAAqB,iBAAA"}
|
package/dist/data/index.d.mts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
//#region src/data/knownCodes.d.ts
|
|
2
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
3
|
* A single entry in the known codes registry.
|
|
11
4
|
*
|
|
12
5
|
* PA has two entries (Pa.C.S. and P.S.) because it has two distinct
|
|
@@ -24,14 +17,12 @@ interface CodeEntry {
|
|
|
24
17
|
}
|
|
25
18
|
/**
|
|
26
19
|
* Registry of state statutory codes that use abbreviated citation forms.
|
|
20
|
+
* Derived from stateStatuteEntries — the single source of truth.
|
|
27
21
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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.
|
|
22
|
+
* Note: Short 2-letter patterns (AS, GS, IC, OS, PS, RC, FS, WS) may produce
|
|
23
|
+
* false positives in non-legal text. The extraction layer mitigates this via
|
|
24
|
+
* confidence scoring — citations without a § symbol receive lower confidence
|
|
25
|
+
* (0.85 vs 0.95). Consumers should filter by confidence threshold.
|
|
35
26
|
*/
|
|
36
27
|
declare const abbreviatedCodes: CodeEntry[];
|
|
37
28
|
/**
|
|
@@ -202,5 +193,28 @@ declare function getReportersSync(): ReportersDatabase | null;
|
|
|
202
193
|
*/
|
|
203
194
|
declare function findReportersByAbbreviation(abbr: string): Promise<ReporterEntry[]>;
|
|
204
195
|
//#endregion
|
|
205
|
-
|
|
196
|
+
//#region src/data/stateStatutes.d.ts
|
|
197
|
+
/**
|
|
198
|
+
* State statute abbreviation table — single source of truth for the
|
|
199
|
+
* abbreviated-code tokenizer pattern and the knownCodes lookup registry.
|
|
200
|
+
*/
|
|
201
|
+
interface StateStatuteEntry {
|
|
202
|
+
/** Two-letter jurisdiction code (e.g., "AK", "AZ") */
|
|
203
|
+
jurisdiction: string;
|
|
204
|
+
/** All recognized abbreviation forms — used for lookup by findAbbreviatedCode */
|
|
205
|
+
abbreviations: string[];
|
|
206
|
+
/**
|
|
207
|
+
* Regex fragment for tokenizer alternation. If omitted, auto-generated
|
|
208
|
+
* from abbreviations via escapeForRegex. Provide explicitly when the
|
|
209
|
+
* pattern needs optional components (e.g., "Stat(?:utes)?").
|
|
210
|
+
*/
|
|
211
|
+
regexFragment?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Abbreviations are ordered longest-first within each entry. The last element
|
|
215
|
+
* is used as the canonical short abbreviation in knownCodes.ts.
|
|
216
|
+
*/
|
|
217
|
+
declare const stateStatuteEntries: StateStatuteEntry[];
|
|
218
|
+
//#endregion
|
|
219
|
+
export { CodeEntry, ReporterEdition, ReporterEntry, ReportersDatabase, type StateStatuteEntry, abbreviatedCodes, findAbbreviatedCode, findNamedCode, findReportersByAbbreviation, getReportersSync, loadReporters, namedCodes, stateStatuteEntries };
|
|
206
220
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/data/knownCodes.ts","../../src/data/reporters.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/data/knownCodes.ts","../../src/data/reporters.ts","../../src/data/stateStatutes.ts"],"mappings":";;AAgBA;;;;;UAAiB,SAAA;;EAEf,YAAA;;EAEA,YAAA;EAgBF;EAdE,QAAA;;EAEA,MAAA;AAAA;AAkCF;;;;;AAyuBA;;;;AAzuBA,cAtBa,gBAAA,EAAkB,SAAA;;;;;AA6zB/B;;;;;;;;AC30BA;;;cDoCa,UAAA,EAAY,SAAA;;ACpBzB;;;;;;;;;;;;;;;;;;iBD6vBgB,aAAA,CAAc,YAAA,UAAsB,QAAA,WAAmB,SAAA;;ACtuBvE;;;;;;;;;;;;;;;iBDoyBgB,mBAAA,CAAoB,UAAA,WAAqB,SAAA;;;;AAj1BzD;;;;;;;;;;AAoBA;;;;;AAsBA;;;;;AAAA,UCpCiB,eAAA;ED6wBD;EC3wBd,KAAA;ED2wBqE;ECzwBrE,GAAA;AAAA;;;;ADu0BF;;;;;;UC3zBiB,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;;;;;AA6DA;;;;;AAqBA;;;;;iBArBgB,gBAAA,CAAA,GAAoB,iBAAA;;;;;;;AC7IpC;;;;;;;;;AA6EA;;iBDqFsB,2BAAA,CAA4B,IAAA,WAAe,OAAA,CAAQ,aAAA;;;;ADvJzE;;;UEXiB,iBAAA;;EAEf,YAAA;;EAEA,aAAA;;;AF2BF;;;EErBE,aAAA;AAAA;ADOF;;;;AAAA,cC4Da,mBAAA,EAAqB,iBAAA"}
|
package/dist/data/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as e,i as t,n,o as r,r as i,s as a,t as o}from"../knownCodes-WUweUwCB.mjs";async function s(){let t=a();if(t)return t;let n=await import(`../../data/reporters.json`,{assert:{type:`json`}}),r=new Map,i=[],o=n.default||n;for(let[e,t]of Object.entries(o))for(let e of t){i.push(e);for(let t of Object.keys(e.editions)){let n=t.toLowerCase();r.has(n)||r.set(n,[]),r.get(n)?.push(e)}for(let[t,n]of Object.entries(e.variations||{})){let n=t.toLowerCase();r.has(n)||r.set(n,[]),r.get(n)?.push(e)}}let s={byAbbreviation:r,all:i};return e(s),s}function c(){return a()}async function l(e){return(await s()).byAbbreviation.get(e.toLowerCase())??[]}export{o as abbreviatedCodes,n as findAbbreviatedCode,i as findNamedCode,l as findReportersByAbbreviation,c as getReportersSync,s as loadReporters,t as namedCodes,r as stateStatuteEntries};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|