@tricoteuses/tisseuse 0.14.19 → 0.15.1
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 +13 -9
- package/dist/{html-BmJb9-6k.js → html-D5hxZhPd.js} +2580 -2481
- package/dist/index.js +1 -1
- package/dist/server.js +898 -668
- package/dist/src/lib/extractors/action_directives.d.ts +2 -0
- package/dist/src/lib/extractors/article_action_effects.d.ts +17 -0
- package/dist/src/lib/extractors/article_action_effects.test.d.ts +1 -0
- package/dist/src/lib/extractors/article_action_effects_long.test.d.ts +1 -0
- package/dist/src/lib/extractors/article_action_targets.d.ts +11 -0
- package/dist/src/lib/extractors/article_action_targets.test.d.ts +1 -0
- package/dist/src/lib/server/parsed_bills.d.ts +7 -1
- package/dist/src/lib/text_parsers/articles.d.ts +4 -2
- package/package.json +1 -1
|
@@ -38,6 +38,7 @@ export type ActionOperation = (ActionOperationTarget & {
|
|
|
38
38
|
targetText: string;
|
|
39
39
|
insertText: string;
|
|
40
40
|
insertLayout?: ActionInsertLayout;
|
|
41
|
+
occurrenceIndex?: number;
|
|
41
42
|
citation?: ActionCitation;
|
|
42
43
|
tableTarget?: ActionTableTarget;
|
|
43
44
|
}) | (ActionOperationTarget & {
|
|
@@ -77,6 +78,7 @@ export type ResolvedActionDirective = (ActionDirectiveCommon & {
|
|
|
77
78
|
targetText: string;
|
|
78
79
|
insertText: string;
|
|
79
80
|
insertLayout?: ActionInsertLayout;
|
|
81
|
+
occurrenceIndex?: number;
|
|
80
82
|
citation?: ActionCitation;
|
|
81
83
|
tableTarget?: ActionTableTarget;
|
|
82
84
|
}) | (ActionDirectiveCommon & {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ResolvedActionDirective } from './action_directives.js';
|
|
2
|
+
import { FragmentPosition } from '../text_parsers/fragments.js';
|
|
3
|
+
export type ArticleActionSourceAnnotation = {
|
|
4
|
+
/** Offsets in the original block text, before parser simplification. */
|
|
5
|
+
sourceText: string;
|
|
6
|
+
referencePosition: FragmentPosition;
|
|
7
|
+
actionPosition: FragmentPosition;
|
|
8
|
+
};
|
|
9
|
+
export type ArticleActionEffect = {
|
|
10
|
+
targetId: string;
|
|
11
|
+
directive: ResolvedActionDirective;
|
|
12
|
+
sourceAnnotation: ArticleActionSourceAnnotation;
|
|
13
|
+
};
|
|
14
|
+
/** Source ranges for distinct operations on the same article, from the grammar. */
|
|
15
|
+
export declare function extractActionOperationSourceAnnotations(sourceText: string, operationCount: number): ArticleActionSourceAnnotation[] | null;
|
|
16
|
+
/** Resolve linked article targets only when the grammar accounts for every link. */
|
|
17
|
+
export declare function extractArticleActionEffects(sourceText: string, targetIds: string[]): ArticleActionEffect[] | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextAstArticle, TextAstReference } from '../text_parsers/ast.js';
|
|
2
|
+
export type ArticleActionTarget = {
|
|
3
|
+
article: TextAstArticle;
|
|
4
|
+
reference: TextAstReference;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Split a parsed reference at article boundaries, keeping the portion tree
|
|
8
|
+
* attached to each article. A portion enumeration *inside* an article is
|
|
9
|
+
* deliberately kept together: it describes several edits to one article.
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractArticleActionTargets(reference: TextAstReference): ArticleActionTarget[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Sql } from 'postgres';
|
|
2
2
|
import { ResolvedActionDirective } from '../extractors/action_directives.js';
|
|
3
|
+
import { ArticleActionEffect, ArticleActionSourceAnnotation } from '../extractors/article_action_effects.js';
|
|
3
4
|
import { TableOfContents } from '../extractors/table_of_contents.js';
|
|
4
5
|
import { LegiResolver } from '../legi/resolver.js';
|
|
5
6
|
import { LinkType } from '../links.js';
|
|
6
7
|
export type ParsedBillSourceFormat = "assemblee-html" | "akoma-ntoso";
|
|
7
8
|
export type ParsedBillBlockKind = "directive_candidate" | "context" | "noise";
|
|
8
9
|
export type ParsedBillToc = TableOfContents;
|
|
10
|
+
export type ParsedBillDiagnosticCode = "nested_french_quote_in_redaction" | "assemblee_toc_article_order_mismatch" | "article_toc_number_gap" | "article_toc_out_of_order" | "article_toc_duplicate_number" | "article_toc_missing_anchor" | "article_toc_source_heading_mismatch";
|
|
9
11
|
export type ParsedBillDiagnostic = {
|
|
10
|
-
code:
|
|
12
|
+
code: ParsedBillDiagnosticCode;
|
|
11
13
|
message: string;
|
|
12
14
|
details?: unknown;
|
|
13
15
|
};
|
|
@@ -66,6 +68,10 @@ export type ParsedBillDirective = {
|
|
|
66
68
|
stop: number;
|
|
67
69
|
};
|
|
68
70
|
directive: ResolvedActionDirective;
|
|
71
|
+
/** Per-article effects when the source modifies several linked articles. */
|
|
72
|
+
effects?: ArticleActionEffect[];
|
|
73
|
+
/** Grammar positions of separate operations modifying the same article. */
|
|
74
|
+
sourceAnnotations?: ArticleActionSourceAnnotation[];
|
|
69
75
|
createdArticle?: ParsedBillInternalArticleTarget;
|
|
70
76
|
createdArticles?: ParsedBillInternalArticleTarget[];
|
|
71
77
|
internalTarget?: ParsedBillInternalArticleTarget & {
|
|
@@ -47,8 +47,10 @@ export declare const nomArticleDefinition: import('./parsers.js').TextParser<imp
|
|
|
47
47
|
*
|
|
48
48
|
* Dans un projet (ou une proposition) de loi initial, un numéro d'article
|
|
49
49
|
* est un simple nombre ou un nom spécial.
|
|
50
|
-
* Dans les versions suivantes, le numéro d'article
|
|
51
|
-
*
|
|
50
|
+
* Dans les versions suivantes, le numéro d'article peut aussi être suivi
|
|
51
|
+
* d'une lettre (article 1 A) ou d'un adverbe latin et de lettres (3 bis AA).
|
|
52
|
+
* Cette règle reste distincte de nomArticle : les références aux articles
|
|
53
|
+
* de codes peuvent avoir un préfixe et des séparateurs absents des PJL/PPL.
|
|
52
54
|
*/
|
|
53
55
|
export declare const nomArticleProjetOuPropositionLoi: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
|
|
54
56
|
/**
|