@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.
@@ -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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tricoteuses/tisseuse",
3
3
  "description": "Find links in/to French legislative documents",
4
- "version": "0.19.3",
4
+ "version": "0.20.0",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",