@stll/anonymize-wasm 1.4.9 → 1.4.10
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/names-nw-excluded-allcaps.mjs +112 -0
- package/dist/names-nw-excluded-allcaps.mjs.map +1 -0
- package/dist/wasm.d.mts +34 -5
- package/dist/wasm.mjs +718 -246
- package/dist/wasm.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
//#region src/data/names-nw-excluded-allcaps.json
|
|
2
|
+
var _comment = "English all-caps words/acronyms excluded from Japanese Hepburn matches";
|
|
3
|
+
var words = [
|
|
4
|
+
"ADD",
|
|
5
|
+
"ALL",
|
|
6
|
+
"AND",
|
|
7
|
+
"ANY",
|
|
8
|
+
"API",
|
|
9
|
+
"APP",
|
|
10
|
+
"APR",
|
|
11
|
+
"ARE",
|
|
12
|
+
"AS",
|
|
13
|
+
"AT",
|
|
14
|
+
"AUG",
|
|
15
|
+
"BIZ",
|
|
16
|
+
"BUT",
|
|
17
|
+
"BY",
|
|
18
|
+
"CAN",
|
|
19
|
+
"COM",
|
|
20
|
+
"CSS",
|
|
21
|
+
"CSV",
|
|
22
|
+
"DEC",
|
|
23
|
+
"DEL",
|
|
24
|
+
"DOC",
|
|
25
|
+
"EDU",
|
|
26
|
+
"END",
|
|
27
|
+
"EUR",
|
|
28
|
+
"FEB",
|
|
29
|
+
"FOR",
|
|
30
|
+
"FRI",
|
|
31
|
+
"GBP",
|
|
32
|
+
"GET",
|
|
33
|
+
"GMT",
|
|
34
|
+
"GOV",
|
|
35
|
+
"HAD",
|
|
36
|
+
"HE",
|
|
37
|
+
"HH",
|
|
38
|
+
"HAS",
|
|
39
|
+
"HTML",
|
|
40
|
+
"ID",
|
|
41
|
+
"IF",
|
|
42
|
+
"IN",
|
|
43
|
+
"INC",
|
|
44
|
+
"INFO",
|
|
45
|
+
"INT",
|
|
46
|
+
"ISO",
|
|
47
|
+
"ITS",
|
|
48
|
+
"JAN",
|
|
49
|
+
"JUL",
|
|
50
|
+
"JUN",
|
|
51
|
+
"KEY",
|
|
52
|
+
"LLC",
|
|
53
|
+
"LTD",
|
|
54
|
+
"MAR",
|
|
55
|
+
"MAY",
|
|
56
|
+
"MIL",
|
|
57
|
+
"MON",
|
|
58
|
+
"NAME",
|
|
59
|
+
"NET",
|
|
60
|
+
"NEW",
|
|
61
|
+
"NO",
|
|
62
|
+
"NOT",
|
|
63
|
+
"NOV",
|
|
64
|
+
"OCT",
|
|
65
|
+
"OF",
|
|
66
|
+
"ON",
|
|
67
|
+
"ONE",
|
|
68
|
+
"OR",
|
|
69
|
+
"ORG",
|
|
70
|
+
"OUT",
|
|
71
|
+
"PDF",
|
|
72
|
+
"POST",
|
|
73
|
+
"PUT",
|
|
74
|
+
"RFC",
|
|
75
|
+
"RUN",
|
|
76
|
+
"SAT",
|
|
77
|
+
"SEE",
|
|
78
|
+
"SEP",
|
|
79
|
+
"SET",
|
|
80
|
+
"SQL",
|
|
81
|
+
"SUN",
|
|
82
|
+
"TAR",
|
|
83
|
+
"THE",
|
|
84
|
+
"THU",
|
|
85
|
+
"TO",
|
|
86
|
+
"TUE",
|
|
87
|
+
"TWO",
|
|
88
|
+
"TXT",
|
|
89
|
+
"UID",
|
|
90
|
+
"URI",
|
|
91
|
+
"URL",
|
|
92
|
+
"USA",
|
|
93
|
+
"USD",
|
|
94
|
+
"UTC",
|
|
95
|
+
"VAL",
|
|
96
|
+
"VAT",
|
|
97
|
+
"WAS",
|
|
98
|
+
"WED",
|
|
99
|
+
"WERE",
|
|
100
|
+
"XLS",
|
|
101
|
+
"XML",
|
|
102
|
+
"YES",
|
|
103
|
+
"ZIP"
|
|
104
|
+
];
|
|
105
|
+
var names_nw_excluded_allcaps_default = {
|
|
106
|
+
_comment,
|
|
107
|
+
words
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { _comment, names_nw_excluded_allcaps_default as default, words };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=names-nw-excluded-allcaps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names-nw-excluded-allcaps.mjs","names":[],"sources":["../../src/data/names-nw-excluded-allcaps.json"],"sourcesContent":[""],"mappings":""}
|
package/dist/wasm.d.mts
CHANGED
|
@@ -280,6 +280,13 @@ type Dictionaries = {
|
|
|
280
280
|
* Merged with legacy config names at init time.
|
|
281
281
|
*/
|
|
282
282
|
surnames?: Readonly<Record<string, readonly string[]>>;
|
|
283
|
+
/**
|
|
284
|
+
* Non-Western name tokens per locale code
|
|
285
|
+
* (e.g., "in", "ar", "ja-latn", "ko", "zh-latn",
|
|
286
|
+
* "th", "vi", "fil", "id"). Merged with bundled
|
|
287
|
+
* names-nw-*.json data at init time.
|
|
288
|
+
*/
|
|
289
|
+
nonWesternNames?: Readonly<Record<string, readonly string[]>>;
|
|
283
290
|
/**
|
|
284
291
|
* Pre-loaded deny-list dictionaries keyed by
|
|
285
292
|
* dictionary ID (e.g., "courts/CZ", "banks/DE").
|
|
@@ -570,11 +577,20 @@ type NameCorpusData = {
|
|
|
570
577
|
firstNames: ReadonlySet<string>;
|
|
571
578
|
surnames: ReadonlySet<string>;
|
|
572
579
|
titleTokens: ReadonlySet<string>;
|
|
573
|
-
|
|
580
|
+
/** Abbreviation-style titles whose trailing dot is
|
|
581
|
+
* part of the title, not a sentence boundary.
|
|
582
|
+
* Contains the lowercase, dot-stripped form
|
|
583
|
+
* (e.g., "dr", "smt", "atty"). */
|
|
584
|
+
titleAbbreviations: ReadonlySet<string>;
|
|
585
|
+
excludedWords: ReadonlySet<string>; /** Non-Western name tokens merged across all locales. */
|
|
586
|
+
nonWesternNames: ReadonlySet<string>; /** All-caps acronyms excluded from name detection. */
|
|
587
|
+
excludedAllCaps: ReadonlySet<string>; /** Raw arrays exposed for deny-list AC integration. */
|
|
574
588
|
firstNamesList: readonly string[];
|
|
575
589
|
surnamesList: readonly string[];
|
|
576
590
|
titlesList: readonly string[];
|
|
577
591
|
excludedList: readonly string[];
|
|
592
|
+
nonWesternNamesList: readonly string[];
|
|
593
|
+
excludedAllCapsList: readonly string[];
|
|
578
594
|
};
|
|
579
595
|
/**
|
|
580
596
|
* All cached state for a single pipeline run (or
|
|
@@ -856,6 +872,7 @@ declare const findCoreferenceSpans: (fullText: string, terms: DefinedTerm[], _ct
|
|
|
856
872
|
declare const propagateOrgNames: (entities: Entity[], fullText: string) => Entity[];
|
|
857
873
|
//#endregion
|
|
858
874
|
//#region src/detectors/names.d.ts
|
|
875
|
+
declare const getNameCorpusNonWesternNames: (ctx?: PipelineContext) => readonly string[];
|
|
859
876
|
/**
|
|
860
877
|
* Load name corpus data from injected dictionaries
|
|
861
878
|
* and legacy config files. Merges all sources.
|
|
@@ -869,14 +886,18 @@ declare const propagateOrgNames: (entities: Entity[], fullText: string) => Entit
|
|
|
869
886
|
* omitted, only legacy config files are used.
|
|
870
887
|
*/
|
|
871
888
|
declare const initNameCorpus: (ctx?: PipelineContext, dictionaries?: Dictionaries, languages?: readonly string[]) => Promise<void>;
|
|
889
|
+
type NameCorpusDetectionOptions = {
|
|
890
|
+
mode?: "full" | "supplemental";
|
|
891
|
+
};
|
|
872
892
|
/**
|
|
873
893
|
* Detect person names by looking up tokens against the
|
|
874
894
|
* name corpus, then chaining adjacent name-like tokens.
|
|
895
|
+
* Handles both Western and non-Western name patterns.
|
|
875
896
|
*
|
|
876
897
|
* Requires initNameCorpus() to have been called first.
|
|
877
898
|
* If not initialized, returns an empty array.
|
|
878
899
|
*
|
|
879
|
-
* Scoring:
|
|
900
|
+
* Scoring (Western):
|
|
880
901
|
* TITLE + NAME/SURNAME → 0.95
|
|
881
902
|
* NAME + NAME/SURNAME → 0.9
|
|
882
903
|
* SURNAME + NAME/SURNAME → 0.9
|
|
@@ -884,8 +905,16 @@ declare const initNameCorpus: (ctx?: PipelineContext, dictionaries?: Dictionarie
|
|
|
884
905
|
* ABBREVIATION + NAME → 0.7
|
|
885
906
|
* Standalone NAME → 0.5 (low confidence)
|
|
886
907
|
* Standalone SURNAME → skip (too ambiguous)
|
|
887
|
-
|
|
888
|
-
|
|
908
|
+
*
|
|
909
|
+
* Scoring (non-Western, when chain contains nonWestern tokens):
|
|
910
|
+
* TITLE + (nonWestern|CAPITALIZED) → 0.95
|
|
911
|
+
* JA_SUFFIX + (CAPITALIZED|nonWestern) → 0.9
|
|
912
|
+
* ARABIC_CONNECTOR + nonWestern → 0.9
|
|
913
|
+
* 2+ nonWestern tokens → 0.9
|
|
914
|
+
* nonWestern + (CAPITALIZED|ABBREVIATION) → 0.9
|
|
915
|
+
* Standalone nonWestern mid-sentence → 0.5
|
|
916
|
+
*/
|
|
917
|
+
declare const detectNameCorpus: (fullText: string, ctx?: PipelineContext, options?: NameCorpusDetectionOptions) => Entity[];
|
|
889
918
|
//#endregion
|
|
890
919
|
//#region src/unified-search.d.ts
|
|
891
920
|
type UnifiedResult = {
|
|
@@ -1150,5 +1179,5 @@ declare const levenshtein: (rawA: string, rawB: string) => number;
|
|
|
1150
1179
|
*/
|
|
1151
1180
|
declare const normalizeForSearch: (text: string) => string;
|
|
1152
1181
|
//#endregion
|
|
1153
|
-
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 };
|
|
1182
|
+
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, getNameCorpusNonWesternNames, 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 };
|
|
1154
1183
|
//# sourceMappingURL=wasm.d.mts.map
|