@tricoteuses/tisseuse 0.17.3 → 0.19.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.
@@ -0,0 +1,5 @@
1
+ export declare function assembleeDocumentDate(data: {
2
+ cycleDeVie: {
3
+ chrono: Record<string, unknown>;
4
+ };
5
+ }): string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -32,6 +32,11 @@ export interface ArticlePortionItem {
32
32
  index?: number;
33
33
  num?: string;
34
34
  label?: string;
35
+ abrogation?: {
36
+ htmlStart: number;
37
+ htmlStop: number;
38
+ text: string;
39
+ };
35
40
  children: ArticlePortionNode[];
36
41
  }
37
42
  export interface ArticlePortionAlinea {
@@ -85,4 +90,10 @@ export declare function getTableUnitNoteRanges(html: string): Array<{
85
90
  }>;
86
91
  export declare function buildArticlePortionTreeFromHtml(html: string): ArticlePortionArticle;
87
92
  export declare function extractPortionSelectors(reference: TextAstReference): PortionSelector[];
93
+ export type LegalPhraseTextBounds = {
94
+ start: number;
95
+ stop: number;
96
+ text: string;
97
+ };
98
+ export declare function getLegalPhraseTextBounds(text: string): LegalPhraseTextBounds[];
88
99
  export declare function resolvePortionSelector(article: ArticlePortionArticle, selector: PortionSelector): ArticlePortionMatch | null;
@@ -7,7 +7,7 @@ export { extractBillDefinitions } from './extractors/definitions.js';
7
7
  export { extractActionDirectivesFromHtml, extractActionDirectiveAstsFromText, extractActionDirectivesFromText, resolveActionDirectivesFromHtml, resolveActionDirectivesFromText, type ActionCitation, type ActionDirective, type ActionOperation, type ActionReplacement, type ActionTableTarget, type ResolvedActionDirective, } from './extractors/action_directives.js';
8
8
  export { extractTextLinks, iterReferenceLinks, type ArticleDefinition, type ArticleExternalLink, type ArticleInternalLink, type ArticleLink, type DefinitionOrLink, type DivisionExternalLink, type DivisionLink, type ExtractedLinkDb, type TextEuropeanLink, type TextExternalLink, type TextLink, type TextLinksParserState, } from './extractors/links.js';
9
9
  export { extractCitationReferences, extractReferences, extractReferencesWithOriginalTransformations, getExtractedReferences, getExtractedReferencesWithOriginalTransformations, } from './extractors/references.js';
10
- export { buildArticlePortionTreeFromHtml, extractPortionSelectors, getTableUnitNoteRanges, isArticlePortionStructuralStart, parseArticleSubdivisionMarker, resolvePortionSelector, type ArticlePortionArticle, type ArticlePortionDivision, type ArticlePortionItem, type ArticlePortionAlinea, type ArticlePortionPhrase, type ArticlePortionMatch, type ArticlePortionNode, type ArticleSubdivisionMarker, type PortionSelector, type PortionSelectorStep, } from './extractors/article_portions.js';
10
+ export { buildArticlePortionTreeFromHtml, extractPortionSelectors, getLegalPhraseTextBounds, getTableUnitNoteRanges, isArticlePortionStructuralStart, parseArticleSubdivisionMarker, resolvePortionSelector, type ArticlePortionArticle, type ArticlePortionDivision, type ArticlePortionItem, type ArticlePortionAlinea, type ArticlePortionPhrase, type ArticlePortionMatch, type ArticlePortionNode, type ArticleSubdivisionMarker, type PortionSelector, type PortionSelectorStep, } from './extractors/article_portions.js';
11
11
  export { addPositionsToTableOfContentsItems, getExtractedTableOfContentsFromTextBill, getTableOfContentsItems, walkTableOfContents, type TableOfContents, type TableOfContentsArticle, type TableOfContentsArticlePositioned, type TableOfContentsDivision, type TableOfContentsDivisionPositioned, type TableOfContentsItem, type TableOfContentsItemPositioned, type TableOfContentsPositioned, } from './extractors/table_of_contents.js';
12
12
  export { jsonReplacer } from './json.js';
13
13
  export { LegiResolver, type LegiArticleInfo, type LegiSectionInfo, type PreloadActiveArticlesByTextIdsOptions, type PreloadTextTitlesInfosOptions, type PreloadTextTitlesInfosProgress, } from './legi/resolver.js';
@@ -23,6 +23,7 @@ export { linkTypes, citedArticleNumFromTextCitation, urlFromArticleVersionsId, u
23
23
  export { getOrLoadDocument, getOrLoadDocumentsByDossierParlementaireUid, getOrLoadDossierParlementaire, } from './loaders/assemblee.js';
24
24
  export { extendLoadedArticle, getOrLoadArticle, getOrLoadJo, getOrLoadSectionTa, getOrLoadSectionsTa, getOrLoadTextelr, getOrLoadTextekali, getOrLoadTexteslr, getOrLoadTextesVersions, getOrLoadTexteVersion, loadArticles, type ArticleExtension, type JorfArticleExtended, type KaliArticleExtended, type LegiArticleExtended, } from './loaders/legifrance.js';
25
25
  export { action } from './text_parsers/actions.js';
26
+ export { findBoundaryPositionCue } from './text_parsers/action_position_cues.js';
26
27
  export { actionDirective } from './text_parsers/action_directives.js';
27
28
  export { article, articles, definitionArticleDansCitation, definitionArticleDansProjetOuPropositionLoi, designationArticle, extractArticleDefinitionsFromCitation, listeArticles, nomArticle, normalizeBillArticleNumber, parseArticleNumber, parseBillArticleLabel, type ArticleDefinitionInCitation, nomSpecialArticle, type BillArticleLabel, } from './text_parsers/articles.js';
28
29
  export { actionTargets, compoundReferencesSeparators, divisionTypes, europeanLawNatures, frenchLawNatures, internationalLawNatures, isTextAstAtomicReference, isTextAstDivision, isTextAstPortion, lawNatures, localizationAdverbs, portionTypes, type ActionTarget, type CompoundReferencesSeparator, type DivisionType, type EuropeanLawNature, type FrenchLawNature, type InternationalLawNature, type LawNature, type LocalizationAdverb, type PortionType, type TextAst, type TextAstAction, type TextAstActionDirective, type TextAstActionDirectiveOperation, type TextAstActionTargetScope, type TextAstApplicabilityClause, type TextAstArticle, type TextAstAtomicReference, type TextAstBoundedInterval, type TextAstCitation, type TextAstCompoundReference, type TextAstConseilConstitutionnelDecision, type TextAstCountedInterval, type TextAstDivision, type TextAstEnumeration, type TextAstExclusion, type TextAstIncompleteHeader, type TextAstLocalization, type TextAstModificationBlock, type TextAstModificationItem, type TextAstNumber, type TextAstParentChild, type TextAstPortion, type TextAstPosition, type TextAstReference, type TextAstReferenceAndAction, type TextAstText, type TextAstTextIdentification, type TextAstTextInfos, type TextInfosByWordsTree, type TextInfosByWordsTreeNode, } from './text_parsers/ast.js';
@@ -1,6 +1,8 @@
1
1
  import { TextInfosByWordsTree } from '../text_parsers/ast.js';
2
2
  export type TextTitlesInfoRow = {
3
3
  cid: string;
4
+ dateDebut?: string | null;
5
+ dateFin?: string | null;
4
6
  dateTexte: string | null;
5
7
  id: string;
6
8
  nature: string;
@@ -8,6 +10,10 @@ export type TextTitlesInfoRow = {
8
10
  title: string;
9
11
  };
10
12
  export type TextTitlesInfos = {
13
+ codeTitleVersionsByCid?: Record<string, Array<{
14
+ debut: string;
15
+ fin: string;
16
+ }>>;
11
17
  textCidByOtherTitleWordsTree: TextInfosByWordsTree;
12
18
  textCidByTitleRestWordsTree: TextInfosByWordsTree;
13
19
  textInfosByCid: Record<string, [nature: string, title: string]>;
@@ -15,7 +21,7 @@ export type TextTitlesInfos = {
15
21
  textsCidsByNatureAndNum: Record<string, Record<string, string | string[]>>;
16
22
  };
17
23
  export declare const textTitlesInfosParserCacheKey = "current";
18
- export declare const textTitlesInfosParserCacheFormatVersion = 1;
24
+ export declare const textTitlesInfosParserCacheFormatVersion = 2;
19
25
  export type BuildTextTitlesInfosProgress = {
20
26
  count?: number;
21
27
  phase: string;
@@ -1,6 +1,6 @@
1
1
  export declare const ACTION_VERB_RE: RegExp;
2
2
  export declare function normalizeActionText(text: string): string;
3
- export declare function hasActionRedactionIntro(normalizedActionScope: string, normalizedText?: string): boolean;
3
+ export declare function hasActionRedactionIntro(normalizedActionScope: string, normalizedText?: string, actionScope?: string): boolean;
4
4
  export declare function hasAfterCue(normalizedActionScope: string): boolean;
5
5
  export declare function hasBeforeCue(normalizedActionScope: string): boolean;
6
6
  export declare function hasReestablishAction(normalizedActionScope: string): boolean;
@@ -1,3 +1,4 @@
1
+ import { TextParser } from './parsers.js';
1
2
  export type BillArticleLabel = {
2
3
  label: string;
3
4
  num?: string;
@@ -17,7 +18,7 @@ export declare function parseBillArticleLabel(text: string): BillArticleLabel |
17
18
  /**
18
19
  * Nom spécifique d’un article, par exemple « liminaire »
19
20
  */
20
- export declare const nomSpecialArticle: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
21
+ export declare const nomSpecialArticle: TextParser<import('./ast.js').TextAst>;
21
22
  /**
22
23
  * Type d'un article, issu :
23
24
  * - issu d’une loi organique (L.O.),
@@ -28,11 +29,11 @@ export declare const nomSpecialArticle: import('./parsers.js').TextParser<import
28
29
  * Une étoile à la suite mentionne un décret pris en
29
30
  * Conseil des ministres, par exemple « L.O. » ou « D*. »
30
31
  */
31
- export declare const typeArticle: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
32
+ export declare const typeArticle: TextParser<import('./ast.js').TextAst>;
32
33
  /**
33
34
  * Numéro générique d’article, par exemple « L.O 113-1 » ou « L328-1 A bis-0 » ou « préliminaire »
34
35
  */
35
- export declare const nomArticle: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
36
+ export declare const nomArticle: TextParser<import('./ast.js').TextAst>;
36
37
  /**
37
38
  * Numéro d’article, utilisé lors de sa définition,
38
39
  * par exemple « L.O 113-1 » ou « L328-1 A bis-0 » ou « préliminaire »
@@ -41,7 +42,7 @@ export declare const nomArticle: import('./parsers.js').TextParser<import('./ast
41
42
  * « Art. 235 ter XB - I. - 1. Il est institué une taxe […]
42
43
  * le numéro est 235 ter XB et I. et 1. sont des numéros de portions.
43
44
  */
44
- export declare const nomArticleDefinition: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
45
+ export declare const nomArticleDefinition: TextParser<import('./ast.js').TextAst>;
45
46
  /**
46
47
  * Numéro d’article à l'intérieur d'un projet ou d'une proposition de loi
47
48
  *
@@ -52,36 +53,30 @@ export declare const nomArticleDefinition: import('./parsers.js').TextParser<imp
52
53
  * Cette règle reste distincte de nomArticle : les références aux articles
53
54
  * de codes peuvent avoir un préfixe et des séparateurs absents des PJL/PPL.
54
55
  */
55
- export declare const nomArticleProjetOuPropositionLoi: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
56
+ export declare const nomArticleProjetOuPropositionLoi: TextParser<import('./ast.js').TextAst>;
56
57
  /**
57
58
  * Déclaration d'un article au sein d'une citation dans un projet
58
59
  * ou une proposition de loi
59
60
  * Exemple : « Art. L. 322‑66. - blablabla… en début de ligne
60
61
  */
61
- export declare const definitionArticleDansCitation: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
62
+ export declare const definitionArticleDansCitation: TextParser<import('./ast.js').TextAst>;
62
63
  export declare function extractArticleDefinitionsFromCitation(text: string): ArticleDefinitionInCitation[];
63
64
  /**
64
65
  * Déclaration d'un article dans un projet ou une proposition de loi
65
66
  * Exemple : « Article 2 » en début de ligne
66
67
  */
67
- export declare const definitionArticleDansProjetOuPropositionLoi: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
68
- /**
69
- * Désignation d’un article, de façon absolue (avec son numero ou nom) ou relative (précédent, suivant, …)
70
- */
71
- export declare const designationArticle: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
72
- export declare const listeArticles1Internal: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
73
- /**
74
- * Liste d’articles, comprenant au minimum deux articles
75
- */
76
- export declare const listeArticles: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
77
- export declare const articles2Internal: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
78
- export declare const articles1Internal: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
68
+ export declare const definitionArticleDansProjetOuPropositionLoi: TextParser<import('./ast.js').TextAst>;
69
+ export declare const designationArticle: TextParser<import('./ast.js').TextAst>;
70
+ export declare const listeArticles1Internal: TextParser<import('./ast.js').TextAst>;
71
+ export declare const listeArticles: TextParser<import('./ast.js').TextAst>;
72
+ export declare const articles2Internal: TextParser<import('./ast.js').TextAst>;
73
+ export declare const articles1Internal: TextParser<import('./ast.js').TextAst>;
79
74
  /**
80
75
  * Règle principale pour la reconnaissance d’une liste d’articles
81
76
  */
82
- export declare const articles: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
83
- export declare const article1Internal: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
77
+ export declare const articles: TextParser<import('./ast.js').TextAst>;
78
+ export declare const article1Internal: TextParser<import('./ast.js').TextAst>;
84
79
  /**
85
80
  * Règle principale pour la reconnaissance d’un seul article
86
81
  */
87
- export declare const article: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
82
+ export declare const article: TextParser<import('./ast.js').TextAst>;
@@ -167,6 +167,8 @@ export type TextAstText = {
167
167
  * Légifrance CID of the text.
168
168
  */
169
169
  cid?: string;
170
+ /** Candidate code CIDs for a title shared by historical code editions. */
171
+ candidateCids?: string[];
170
172
  nature: LawNature;
171
173
  legislation?: "international" | "UE";
172
174
  ofTheSaid?: boolean;
@@ -21,6 +21,7 @@ export declare const unePortion: TextParser<import('./ast.js').TextAst>;
21
21
  * ou "phrases 1, 2 et 3".
22
22
  */
23
23
  export declare const quelquesPortionsNumerotees: TextParser<import('./ast.js').TextAst>;
24
+ export declare const quelquesPortionsOrdinales: TextParser<import('./ast.js').TextAst>;
24
25
  export declare const numeroPortionOuUnePortion: TextParser<import('./ast.js').TextAst>;
25
26
  export declare const plusieursPortions: TextParser<import('./ast.js').TextAst>;
26
27
  /**
@@ -1,6 +1,7 @@
1
1
  export declare const introPluriel: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
2
2
  export declare const introSingulier: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
3
3
  export declare const liaisonPluriel: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
4
+ export declare const liaisonSingulierApresEspace: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
4
5
  export declare const liaisonSingulier: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
5
6
  export declare const ditPluriel: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
6
7
  export declare const ditSingulier: import('./parsers.js').TextParser<import('./ast.js').TextAst>;
@@ -1,4 +1,6 @@
1
1
  export declare function setTextTitlesInfos(textTitlesInfos: unknown): void;
2
+ /** Keep the successive titles of one CID together when ranking code editions. */
3
+ export declare function rankCodeTitleCids(cids: string[], date: string): string[];
2
4
  /**
3
5
  * Nature d’un texte français, par exemple « code » ou « loi organique »
4
6
  *
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.17.3",
4
+ "version": "0.19.0",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",