@tricoteuses/tisseuse 0.19.3 → 0.20.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/dist/{html-EuDDYMr2.js → html-C07GdZ0O.js} +5590 -5532
- package/dist/index.js +38 -38
- package/dist/{resolver-tBQRf8TL.js → resolver-4v_fWVor.js} +93 -73
- package/dist/server-f-legi.js +1 -1
- package/dist/server.js +855 -723
- package/dist/src/lib/extractors/links.d.ts +2 -1
- package/dist/src/lib/extractors/qualified_versions.d.ts +6 -0
- package/dist/src/lib/linkers/html.d.ts +3 -1
- package/dist/src/lib/server/parsed_bills.d.ts +4 -0
- package/dist/src/lib/text_parsers/qualified_versions.d.ts +2 -0
- package/dist/src/lib/text_parsers/transformers.d.ts +2 -0
- package/package.json +1 -1
|
@@ -163,8 +163,9 @@ export declare function extractTextLinks({ canutesDb, context, date, includeInte
|
|
|
163
163
|
state?: TextLinksParserState;
|
|
164
164
|
transformation?: Transformation;
|
|
165
165
|
}): AsyncGenerator<DefinitionOrLink, void>;
|
|
166
|
-
export declare function iterReferenceLinks({ articleDefinitionByNumByTextId: articleDefinitionByNumByTextIdInput, includeInternalArticleLinks, legiResolver, context, date, logIgnoredReferencesTypes, logPartialReferences, originalPositionsFromTransformedIterator, reference, iterationDiagnostics: inputIterationDiagnostics, resolverDiagnostics: inputResolverDiagnostics, state: inputState, }: {
|
|
166
|
+
export declare function iterReferenceLinks({ articleDefinitionByNumByTextId: articleDefinitionByNumByTextIdInput, inOriginalCitation, includeInternalArticleLinks, legiResolver, context, date, logIgnoredReferencesTypes, logPartialReferences, originalPositionsFromTransformedIterator, reference, iterationDiagnostics: inputIterationDiagnostics, resolverDiagnostics: inputResolverDiagnostics, state: inputState, }: {
|
|
167
167
|
articleDefinitionByNumByTextId?: Record<string, Record<string, ArticleDefinition>>;
|
|
168
|
+
inOriginalCitation?: boolean;
|
|
168
169
|
includeInternalArticleLinks?: boolean;
|
|
169
170
|
legiResolver: LegiResolver;
|
|
170
171
|
context: TextParserContext;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { TextAstPosition, TextAstText } from '../text_parsers/ast.js';
|
|
1
2
|
import { FragmentPosition } from '../text_parsers/fragments.js';
|
|
3
|
+
import { TextParserContext } from '../text_parsers/parsers.js';
|
|
2
4
|
/** Positions of enacted-law articles qualifying a version, in the original text. */
|
|
3
5
|
export declare function extractQualifiedVersionLawArticles(sourceText: string): FragmentPosition[];
|
|
6
|
+
/** Source texts qualifying a version do not identify the code being amended. */
|
|
7
|
+
export declare function extractQualifiedVersionSourceTextPositions(sourceText: string): FragmentPosition[];
|
|
8
|
+
/** An enacted source can be linked without becoming the amended text. */
|
|
9
|
+
export declare function isQualifiedVersionProvenanceText(context: TextParserContext, text: TextAstText & TextAstPosition): boolean;
|
|
@@ -2,10 +2,12 @@ import { Sql } from 'postgres';
|
|
|
2
2
|
import { DefinitionOrLink, TextLinksParserState } from '../extractors/links.js';
|
|
3
3
|
import { LegiResolver } from '../legi/resolver.js';
|
|
4
4
|
import { LinkType } from '../links.js';
|
|
5
|
+
import { FragmentPosition } from '../text_parsers/fragments.js';
|
|
5
6
|
import { TextParserContext } from '../text_parsers/parsers.js';
|
|
6
7
|
import { Transformation } from '../text_parsers/transformers.js';
|
|
7
|
-
export declare function addLinksToHtml({ canutesDb, includeInternalArticleLinks, legiResolver: providedLegiResolver, date, html, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, onLink, previousContext, state, }: {
|
|
8
|
+
export declare function addLinksToHtml({ canutesDb, excludedHtmlRanges, includeInternalArticleLinks, legiResolver: providedLegiResolver, date, html, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, onLink, previousContext, state, }: {
|
|
8
9
|
canutesDb?: Sql;
|
|
10
|
+
excludedHtmlRanges?: FragmentPosition[];
|
|
9
11
|
includeInternalArticleLinks?: boolean;
|
|
10
12
|
legiResolver?: LegiResolver;
|
|
11
13
|
date: string;
|
|
@@ -4,6 +4,7 @@ import { ArticleActionEffect, ArticleActionSourceAnnotation } from '../extractor
|
|
|
4
4
|
import { TableOfContents } from '../extractors/table_of_contents.js';
|
|
5
5
|
import { LegiResolver } from '../legi/resolver.js';
|
|
6
6
|
import { LinkType } from '../links.js';
|
|
7
|
+
import { FragmentPosition } from '../text_parsers/fragments.js';
|
|
7
8
|
export type ParsedBillSourceFormat = "assemblee-html" | "akoma-ntoso";
|
|
8
9
|
export type ParsedBillBlockKind = "directive_candidate" | "context" | "noise";
|
|
9
10
|
export type ParsedBillToc = TableOfContents;
|
|
@@ -85,6 +86,8 @@ export type ParsedBillDirective = {
|
|
|
85
86
|
resolution: "explicit" | "fallback";
|
|
86
87
|
};
|
|
87
88
|
internalTargetAmbiguity?: ParsedBillInternalArticleTarget;
|
|
89
|
+
/** Explicitly cited article numbers defined in this bill; external projection is unavailable. */
|
|
90
|
+
internallyCreatedTargetNums?: string[];
|
|
88
91
|
targetIds?: string[];
|
|
89
92
|
qualifiedVersion?: ParsedBillQualifiedVersion;
|
|
90
93
|
};
|
|
@@ -133,6 +136,7 @@ export type ParsedBillDocument = {
|
|
|
133
136
|
annotations?: ParsedBillAnnotation[];
|
|
134
137
|
diagnostics?: ParsedBillDiagnostic[];
|
|
135
138
|
};
|
|
139
|
+
export declare function getStandaloneNumberedPastilleRanges(html: string): FragmentPosition[];
|
|
136
140
|
export declare function parseAssembleeBillRaw(input: string, options: ParseBillRawOptions): Promise<ParsedBillDocument>;
|
|
137
141
|
export declare function linkAssembleeBillRaw(input: string, options: ParseBillRawOptions): Promise<LinkedBillDocument>;
|
|
138
142
|
export declare function renderAkomaNtosoBillRaw(input: string): LinkedBillDocument;
|
|
@@ -4,3 +4,5 @@ import { TextParser } from './parsers.js';
|
|
|
4
4
|
export declare const qualifiedVersionRedaction: TextParser<import('./ast.js').TextAst>;
|
|
5
5
|
/** Parse a version's provenance using the same legal-reference grammar as actions. */
|
|
6
6
|
export declare const qualifiedVersionReference: TextParser<TextAstReference>;
|
|
7
|
+
/** Recognize a law cited as the provenance of a version without treating it as the amended text. */
|
|
8
|
+
export declare const qualifiedVersionLawSource: TextParser<TextAstReference>;
|
|
@@ -31,6 +31,8 @@ export type TransformerLeaf = (text: string) => TransformationLeaf;
|
|
|
31
31
|
export type TransformerNode = (text: string) => TransformationNode;
|
|
32
32
|
export declare const tagRegExp: RegExp;
|
|
33
33
|
export declare function chainTransformers(title: string, transformers: Array<Transformer>): TransformerNode;
|
|
34
|
+
/** Omit source spans from parsing while retaining their original positions. */
|
|
35
|
+
export declare function omitSourceRanges(ranges: FragmentPosition[]): TransformerLeaf;
|
|
34
36
|
/**
|
|
35
37
|
* Creates an iterator that converts transformed (e.g. simplified) positions to original
|
|
36
38
|
* (e.g. HTML) positions
|