@stll/anonymize-wasm 1.4.1 → 1.4.4
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/address-stopwords.mjs +1 -0
- package/dist/common-words-en.mjs +9887 -0
- package/dist/common-words-en.mjs.map +1 -0
- package/dist/legal-form-leading-clauses.mjs +23 -0
- package/dist/legal-form-leading-clauses.mjs.map +1 -0
- package/dist/person-stopwords.mjs +6 -0
- package/dist/wasm.d.mts +43 -5
- package/dist/wasm.mjs +579 -102
- package/dist/wasm.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-words-en.mjs","names":[],"sources":["../../src/data/common-words-en.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/data/legal-form-leading-clauses.json
|
|
2
|
+
var _comment = "Per-language clause text that may precede an organization name before a legal-form suffix. `phrases` are trimmed unconditionally when found inside an over-captured legal-form span. `directPrefixes` are trimmed only when the text before the prefix already looks like prose, so company names such as `Stand By Me LLC` are preserved.";
|
|
3
|
+
var en = {
|
|
4
|
+
"phrases": [
|
|
5
|
+
"by and among",
|
|
6
|
+
"by and between",
|
|
7
|
+
"is between"
|
|
8
|
+
],
|
|
9
|
+
"directPrefixes": [
|
|
10
|
+
"by",
|
|
11
|
+
"among",
|
|
12
|
+
"amongst",
|
|
13
|
+
"between"
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
var legal_form_leading_clauses_default = {
|
|
17
|
+
_comment,
|
|
18
|
+
en
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { _comment, legal_form_leading_clauses_default as default, en };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=legal-form-leading-clauses.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legal-form-leading-clauses.mjs","names":[],"sources":["../../src/data/legal-form-leading-clauses.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -17,6 +17,7 @@ var person_stopwords_default = {
|
|
|
17
17
|
"basic",
|
|
18
18
|
"belgian",
|
|
19
19
|
"borrower",
|
|
20
|
+
"branch",
|
|
20
21
|
"british",
|
|
21
22
|
"bulgarian",
|
|
22
23
|
"buyer",
|
|
@@ -35,6 +36,8 @@ var person_stopwords_default = {
|
|
|
35
36
|
"default",
|
|
36
37
|
"delaware",
|
|
37
38
|
"delivery",
|
|
39
|
+
"department",
|
|
40
|
+
"division",
|
|
38
41
|
"dry",
|
|
39
42
|
"dutch",
|
|
40
43
|
"english",
|
|
@@ -50,6 +53,7 @@ var person_stopwords_default = {
|
|
|
50
53
|
"germany",
|
|
51
54
|
"greek",
|
|
52
55
|
"guarantor",
|
|
56
|
+
"headquarters",
|
|
53
57
|
"hungarian",
|
|
54
58
|
"indiana",
|
|
55
59
|
"interest",
|
|
@@ -80,6 +84,7 @@ var person_stopwords_default = {
|
|
|
80
84
|
"notice",
|
|
81
85
|
"november",
|
|
82
86
|
"october",
|
|
87
|
+
"office",
|
|
83
88
|
"ohio",
|
|
84
89
|
"opportunity",
|
|
85
90
|
"owner",
|
|
@@ -102,6 +107,7 @@ var person_stopwords_default = {
|
|
|
102
107
|
"section",
|
|
103
108
|
"seller",
|
|
104
109
|
"september",
|
|
110
|
+
"subsidiary",
|
|
105
111
|
"slovak",
|
|
106
112
|
"slovenian",
|
|
107
113
|
"spanish",
|
package/dist/wasm.d.mts
CHANGED
|
@@ -269,8 +269,19 @@ type Dictionaries = {
|
|
|
269
269
|
/**
|
|
270
270
|
* Pre-loaded city names, already merged across
|
|
271
271
|
* all desired countries.
|
|
272
|
+
*
|
|
273
|
+
* Prefer `citiesByCountry` when callers also pass
|
|
274
|
+
* `denyListCountries` / `denyListRegions`; merged
|
|
275
|
+
* city arrays cannot be scoped after injection.
|
|
272
276
|
*/
|
|
273
277
|
cities?: readonly string[];
|
|
278
|
+
/**
|
|
279
|
+
* Pre-loaded city names keyed by ISO 3166-1 alpha-2
|
|
280
|
+
* country code. When provided, the deny-list builder
|
|
281
|
+
* applies `denyListCountries` / `denyListRegions`
|
|
282
|
+
* before adding city patterns to the search automaton.
|
|
283
|
+
*/
|
|
284
|
+
citiesByCountry?: Readonly<Record<string, readonly string[]>>;
|
|
274
285
|
};
|
|
275
286
|
type PipelineConfig = {
|
|
276
287
|
threshold: number;
|
|
@@ -290,6 +301,15 @@ type PipelineConfig = {
|
|
|
290
301
|
* deny-list search automaton.
|
|
291
302
|
*/
|
|
292
303
|
enableNameCorpus: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Optional language scope for first-name/surname
|
|
306
|
+
* dictionaries, using the keys present in
|
|
307
|
+
* `dictionaries.firstNames` / `dictionaries.surnames`
|
|
308
|
+
* (for example `["en", "de"]`). When omitted, all
|
|
309
|
+
* injected name languages are used for backward
|
|
310
|
+
* compatibility.
|
|
311
|
+
*/
|
|
312
|
+
nameCorpusLanguages?: string[];
|
|
293
313
|
enableDenyList: boolean;
|
|
294
314
|
denyListCountries?: string[];
|
|
295
315
|
denyListRegions?: string[];
|
|
@@ -367,16 +387,17 @@ declare const CURRENCY_PATTERN_META: Readonly<RegexMeta>;
|
|
|
367
387
|
declare const processRegexMatches: (allMatches: Match[], sliceStart: number, sliceEnd: number, meta_: readonly RegexMeta[]) => Entity[];
|
|
368
388
|
//#endregion
|
|
369
389
|
//#region src/detectors/deny-list.d.ts
|
|
370
|
-
type DenyListConfig = Pick<PipelineConfig, "enableDenyList" | "enableNameCorpus" | "denyListCountries" | "denyListRegions" | "denyListExcludeCategories" | "customDenyList" | "dictionaries">;
|
|
390
|
+
type DenyListConfig = Pick<PipelineConfig, "enableDenyList" | "enableNameCorpus" | "nameCorpusLanguages" | "denyListCountries" | "denyListRegions" | "denyListExcludeCategories" | "customDenyList" | "dictionaries">;
|
|
371
391
|
/**
|
|
372
392
|
* Source tag for each pattern in the automaton.
|
|
373
393
|
* "deny-list" = standard deny list entry
|
|
394
|
+
* "city" = city dictionary entry
|
|
374
395
|
* "custom-deny-list" = caller-owned exact term
|
|
375
396
|
* "first-name" = name corpus first name
|
|
376
397
|
* "surname" = name corpus surname
|
|
377
398
|
* "title" = academic/professional title
|
|
378
399
|
*/
|
|
379
|
-
type PatternSource = "deny-list" | "custom-deny-list" | "first-name" | "surname" | "title";
|
|
400
|
+
type PatternSource = "deny-list" | "city" | "custom-deny-list" | "first-name" | "surname" | "title";
|
|
380
401
|
/**
|
|
381
402
|
* Pre-built deny list data. Constructed once by
|
|
382
403
|
* `buildDenyList`, reused across `processDenyListMatches`
|
|
@@ -414,7 +435,7 @@ declare const buildDenyList: (config: DenyListConfig, ctx?: PipelineContext) =>
|
|
|
414
435
|
* the search instance was built on a different context
|
|
415
436
|
* (e.g. cachedSearch).
|
|
416
437
|
*/
|
|
417
|
-
declare const ensureDenyListData: (ctx?: PipelineContext, dictionaries?: Dictionaries) => Promise<void>;
|
|
438
|
+
declare const ensureDenyListData: (ctx?: PipelineContext, dictionaries?: Dictionaries, nameCorpusLanguages?: readonly string[]) => Promise<void>;
|
|
418
439
|
/**
|
|
419
440
|
* Process deny list matches from the unified search.
|
|
420
441
|
* Receives all matches; filters to the deny list slice
|
|
@@ -510,6 +531,7 @@ type PipelineContext = {
|
|
|
510
531
|
searchKey: string;
|
|
511
532
|
searchPromise: Promise<UnifiedSearchInstance> | null;
|
|
512
533
|
nameCorpus: NameCorpusData | null;
|
|
534
|
+
nameCorpusKey: string;
|
|
513
535
|
nameCorpusPromise: Promise<void> | null;
|
|
514
536
|
stopwords: ReadonlySet<string> | null;
|
|
515
537
|
stopwordsPromise: Promise<ReadonlySet<string>> | null;
|
|
@@ -551,6 +573,22 @@ declare const createPipelineContext: () => PipelineContext;
|
|
|
551
573
|
declare const sanitizeEntities: (entities: Entity[]) => Entity[];
|
|
552
574
|
declare const mergeAndDedup: (...layers: Entity[][]) => Entity[];
|
|
553
575
|
type NerInferenceFn = (fullText: string, labels: string[], threshold: number, signal?: AbortSignal) => Promise<Entity[]>;
|
|
576
|
+
type PipelineSearchOptions = {
|
|
577
|
+
config: PipelineConfig;
|
|
578
|
+
gazetteerEntries?: GazetteerEntry[];
|
|
579
|
+
context?: PipelineContext;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Pre-build and cache the unified search instance for a
|
|
583
|
+
* pipeline configuration. Use the same context in
|
|
584
|
+
* `runPipeline` to reuse the prepared automata without
|
|
585
|
+
* passing `cachedSearch` around manually.
|
|
586
|
+
*/
|
|
587
|
+
declare const preparePipelineSearch: ({
|
|
588
|
+
config,
|
|
589
|
+
gazetteerEntries,
|
|
590
|
+
context
|
|
591
|
+
}: PipelineSearchOptions) => Promise<UnifiedSearchInstance>;
|
|
554
592
|
/**
|
|
555
593
|
* Options for {@link runPipeline}.
|
|
556
594
|
*
|
|
@@ -780,7 +818,7 @@ declare const propagateOrgNames: (entities: Entity[], fullText: string) => Entit
|
|
|
780
818
|
* with per-language first names and surnames. When
|
|
781
819
|
* omitted, only legacy config files are used.
|
|
782
820
|
*/
|
|
783
|
-
declare const initNameCorpus: (ctx?: PipelineContext, dictionaries?: Dictionaries) => Promise<void>;
|
|
821
|
+
declare const initNameCorpus: (ctx?: PipelineContext, dictionaries?: Dictionaries, languages?: readonly string[]) => Promise<void>;
|
|
784
822
|
/**
|
|
785
823
|
* Detect person names by looking up tokens against the
|
|
786
824
|
* name corpus, then chaining adjacent name-like tokens.
|
|
@@ -1062,5 +1100,5 @@ declare const levenshtein: (rawA: string, rawB: string) => number;
|
|
|
1062
1100
|
*/
|
|
1063
1101
|
declare const normalizeForSearch: (text: string) => string;
|
|
1064
1102
|
//#endregion
|
|
1065
|
-
export { type AnonymisationOperator, CURRENCY_PATTERN_META, type CountryCode, type CustomDenyListEntry, type CustomRegexPattern, DATE_PATTERN_META, DEFAULT_ENTITY_LABELS, DEFAULT_OPERATOR_CONFIG, DETECTION_SOURCES, DETECTOR_PRIORITY, type DefinitionPattern, type DenyListCategory, type DenyListData, type DetectionSource, type Dictionaries, type DictionaryMeta, type DocumentZone, type Entity, type EntityResult, type GazetteerData, type GazetteerEntry, type HotwordRule, type NameCorpusData, type NerInferenceFn, OPERATOR_REGISTRY, OPERATOR_TYPES, type OperatorConfig, type OperatorType, type PipelineConfig, type PipelineContext, type PipelineOptions, REGEX_META, REGEX_PATTERNS, REGIONS, type RawInferenceResult, type RedactionResult, type RegexMeta, type RegionId, type ReviewDecision, type ReviewedEntity, type TriggerExtension, type TriggerGroupConfig, type TriggerRule, type TriggerStrategy, type TriggerValidation, type UnifiedResult, type UnifiedSearchInstance, ZONE_SCORE_ADJUSTMENTS, type ZoneSpan, applyHotwordRules, applyZoneAdjustments, boostNearMissEntities, buildDenyList, buildGazetteerPatterns, buildLegalFormPatterns, buildPlaceholderMap, buildStreetTypePatterns, buildTriggerPatterns, buildUnifiedSearch, chunkText, classifyZones, computeChunkOffsets, corefKey, createPipelineContext, deanonymise, decodeSpans, decodeTokenSpans, detectNameCorpus, ensureDenyListData, exportRedactionKey, extractDefinedTerms, filterFalsePositives, findCoreferenceSpans, getCurrencyPatterns, getDatePatterns, initAddressComponents, initHotwordRules, initNameCorpus, initZoneClassifier, levenshtein, mergeAndDedup, mergeChunkEntities, normalizeForSearch, prepareBatch, processAddressSeeds, processDenyListMatches, processGazetteerMatches, processLegalFormMatches, processRegexMatches, processTriggerMatches, propagateOrgNames, redactText, resolveCountries, resolveOperator, runPipeline, runUnifiedSearch, sanitizeEntities, tokenizeText, warmLegalRoleHeads };
|
|
1103
|
+
export { type AnonymisationOperator, CURRENCY_PATTERN_META, type CountryCode, type CustomDenyListEntry, type CustomRegexPattern, DATE_PATTERN_META, DEFAULT_ENTITY_LABELS, DEFAULT_OPERATOR_CONFIG, DETECTION_SOURCES, DETECTOR_PRIORITY, type DefinitionPattern, type DenyListCategory, type DenyListData, type DetectionSource, type Dictionaries, type DictionaryMeta, type DocumentZone, type Entity, type EntityResult, type GazetteerData, type GazetteerEntry, type HotwordRule, type NameCorpusData, type NerInferenceFn, OPERATOR_REGISTRY, OPERATOR_TYPES, type OperatorConfig, type OperatorType, type PipelineConfig, type PipelineContext, type PipelineOptions, type PipelineSearchOptions, REGEX_META, REGEX_PATTERNS, REGIONS, type RawInferenceResult, type RedactionResult, type RegexMeta, type RegionId, type ReviewDecision, type ReviewedEntity, type TriggerExtension, type TriggerGroupConfig, type TriggerRule, type TriggerStrategy, type TriggerValidation, type UnifiedResult, type UnifiedSearchInstance, ZONE_SCORE_ADJUSTMENTS, type ZoneSpan, applyHotwordRules, applyZoneAdjustments, boostNearMissEntities, buildDenyList, buildGazetteerPatterns, buildLegalFormPatterns, buildPlaceholderMap, buildStreetTypePatterns, buildTriggerPatterns, buildUnifiedSearch, chunkText, classifyZones, computeChunkOffsets, corefKey, createPipelineContext, deanonymise, decodeSpans, decodeTokenSpans, detectNameCorpus, ensureDenyListData, exportRedactionKey, extractDefinedTerms, filterFalsePositives, findCoreferenceSpans, getCurrencyPatterns, getDatePatterns, initAddressComponents, initHotwordRules, initNameCorpus, initZoneClassifier, levenshtein, mergeAndDedup, mergeChunkEntities, normalizeForSearch, prepareBatch, preparePipelineSearch, processAddressSeeds, processDenyListMatches, processGazetteerMatches, processLegalFormMatches, processRegexMatches, processTriggerMatches, propagateOrgNames, redactText, resolveCountries, resolveOperator, runPipeline, runUnifiedSearch, sanitizeEntities, tokenizeText, warmLegalRoleHeads };
|
|
1066
1104
|
//# sourceMappingURL=wasm.d.mts.map
|