@tricoteuses/tisseuse 0.14.17 → 0.14.19
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 +5 -3
- package/dist/{html-Bto5izwe.js → html-BmJb9-6k.js} +1996 -1924
- package/dist/index.js +135 -135
- package/dist/server.js +635 -635
- package/dist/src/lib/extractors/quoted_text.d.ts +3 -1
- package/dist/src/lib/index.d.ts +1 -1
- package/dist/src/lib/text_parsers/citations.d.ts +21 -4
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { FrenchCitationParseOptions } from '../text_parsers/citations.js';
|
|
1
2
|
import { FragmentPosition } from '../text_parsers/fragments.js';
|
|
2
3
|
export type QuotedTextInfo = {
|
|
4
|
+
closed?: boolean;
|
|
3
5
|
text: string;
|
|
4
6
|
start: number;
|
|
5
7
|
end: number;
|
|
@@ -9,7 +11,7 @@ export type QuoteRange = {
|
|
|
9
11
|
end: number;
|
|
10
12
|
};
|
|
11
13
|
export declare function normalizeQuotedText(text: string): string;
|
|
12
|
-
export declare function extractQuotedTextInfos(text: string): QuotedTextInfo[];
|
|
14
|
+
export declare function extractQuotedTextInfos(text: string, options?: FrenchCitationParseOptions): QuotedTextInfo[];
|
|
13
15
|
export declare function stripQuotedTextSegments(text: string, quotedInfos: Pick<QuotedTextInfo, "start" | "end">[]): string;
|
|
14
16
|
export declare function getQuoteRanges(text: string): QuoteRange[];
|
|
15
17
|
export declare function isInsideRanges(position: FragmentPosition | undefined, ranges: Array<{
|
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { action } from './text_parsers/actions.js';
|
|
|
26
26
|
export { actionDirective } from './text_parsers/action_directives.js';
|
|
27
27
|
export { article, articles, definitionArticleDansCitation, definitionArticleDansProjetOuPropositionLoi, designationArticle, extractArticleDefinitionsFromCitation, listeArticles, nomArticle, normalizeBillArticleNumber, parseArticleNumber, parseBillArticleLabel, type ArticleDefinitionInCitation, nomSpecialArticle, type BillArticleLabel, } from './text_parsers/articles.js';
|
|
28
28
|
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';
|
|
29
|
-
export { citation, citationToText, citationLigne, citationSimple, } from './text_parsers/citations.js';
|
|
29
|
+
export { citation, citationToText, citationLigne, citationSimple, extractFrenchCitations, parseFrenchCitationAt, type FrenchCitationParseOptions, type ParsedFrenchCitation, } from './text_parsers/citations.js';
|
|
30
30
|
export { date, duDate } from './text_parsers/dates.js';
|
|
31
31
|
export { referenceDoctrinale, referenceDoctrinaleArticleAvantSource, referenceDoctrinaleArticlesAvantSource, referenceDoctrinaleSourceAvantArticle, } from './text_parsers/doctrinal_references.js';
|
|
32
32
|
export { definitionDivision, designationDivision, division, divisions, natureDivisionSingulier, numeroDivision, } from './text_parsers/divisions.js';
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextAstCitation } from './ast.js';
|
|
2
2
|
import { TextParserContext, TextParser } from './parsers.js';
|
|
3
3
|
import { TransformationLeaf } from './transformers.js';
|
|
4
4
|
type TextAstPositionRange = TextAstCitation["position"];
|
|
5
5
|
export declare function createTextAstCitation(contentPosition: TextAstPositionRange, position?: TextAstPositionRange): TextAstCitation;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export type FrenchCitationParseOptions = {
|
|
7
|
+
allowClosingQuoteAsOpening?: boolean;
|
|
8
|
+
allowUnclosed?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type ParsedFrenchCitation = {
|
|
11
|
+
closed: boolean;
|
|
12
|
+
content: Array<{
|
|
13
|
+
start: number;
|
|
14
|
+
stop: number;
|
|
15
|
+
}>;
|
|
16
|
+
position: {
|
|
17
|
+
start: number;
|
|
18
|
+
stop: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const citationLigne: TextParser<import('./ast.js').TextAst>;
|
|
22
|
+
export declare const citationSimple: TextParser<import('./ast.js').TextAst>;
|
|
23
|
+
export declare function parseFrenchCitationAt(input: string, start: number, { allowClosingQuoteAsOpening, allowUnclosed, }?: FrenchCitationParseOptions): ParsedFrenchCitation | undefined;
|
|
24
|
+
export declare function extractFrenchCitations(input: string, options?: FrenchCitationParseOptions): ParsedFrenchCitation[];
|
|
25
|
+
export declare const citation: TextParser<TextAstCitation>;
|
|
9
26
|
export declare function convertCitationToText(context: TextParserContext, citation: TextAstCitation): TransformationLeaf;
|
|
10
27
|
export declare function citationToText(sourceText: string, citation: TextAstCitation): string;
|
|
11
28
|
export {};
|