@stll/anonymize 1.4.11 → 2.0.0-alpha.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/ATTRIBUTION.md +70 -0
- package/README.md +86 -48
- package/dist/address-boundaries.mjs +2 -0
- package/dist/address-jurisdiction-prefixes.mjs +16 -0
- package/dist/address-jurisdiction-prefixes.mjs.map +1 -0
- package/dist/address-stop-keywords.mjs +12 -1
- package/dist/address-stopwords.mjs +2 -0
- package/dist/address-unit-abbreviations.mjs +15 -0
- package/dist/address-unit-abbreviations.mjs.map +1 -0
- package/dist/allow-list.mjs +1 -0
- package/dist/clause-noun-heads.mjs +5 -1
- package/dist/constants.mjs +1 -0
- package/dist/constants.mjs.map +1 -1
- package/dist/constants2.d.mts +1 -1
- package/dist/coreference-org-determiners.mjs +19 -0
- package/dist/coreference-org-determiners.mjs.map +1 -0
- package/dist/defined-term-heads.mjs +15 -0
- package/dist/defined-term-heads.mjs.map +1 -0
- package/dist/false-positive-shapes.mjs +36 -0
- package/dist/false-positive-shapes.mjs.map +1 -0
- package/dist/index.d.mts +3 -1167
- package/dist/index.mjs +3 -16079
- package/dist/index.mjs.map +1 -1
- package/dist/legal-role-heads.cs.mjs +6 -0
- package/dist/native-node.d.mts +124 -0
- package/dist/native-node.mjs +3 -0
- package/dist/native-node2.d.mts +3 -0
- package/dist/native-node2.mjs +13353 -0
- package/dist/native-node2.mjs.map +1 -0
- package/dist/native.d.mts +1158 -0
- package/dist/native.mjs +230 -0
- package/dist/native.mjs.map +1 -0
- package/dist/native2.d.mts +2 -0
- package/dist/organization-unit-heads.mjs +20 -0
- package/dist/organization-unit-heads.mjs.map +1 -0
- package/dist/person-stopwords.mjs +205 -199
- package/dist/signing-clauses.mjs +33 -9
- package/index.cjs +3 -0
- package/native-pipeline.cs.stlanonpkg +0 -0
- package/native-pipeline.de.stlanonpkg +0 -0
- package/native-pipeline.en.stlanonpkg +0 -0
- package/native-pipeline.stlanonpkg +0 -0
- package/package.json +42 -8
- package/scripts/build-native-pipeline-package.mjs +225 -0
- package/dist/address-prepositions.mjs +0 -182
- package/dist/address-prepositions.mjs.map +0 -1
package/dist/native.mjs
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
//#region src/native.ts
|
|
2
|
+
var PreparedNativeAnonymizer = class {
|
|
3
|
+
#prepared;
|
|
4
|
+
constructor(prepared) {
|
|
5
|
+
this.#prepared = prepared;
|
|
6
|
+
}
|
|
7
|
+
prepareDiagnosticsJson() {
|
|
8
|
+
return this.#prepared.prepareDiagnosticsJson?.() ?? null;
|
|
9
|
+
}
|
|
10
|
+
prepare_diagnostics_json() {
|
|
11
|
+
return this.prepareDiagnosticsJson();
|
|
12
|
+
}
|
|
13
|
+
warmLazyRegex() {
|
|
14
|
+
if (this.#prepared.warmLazyRegex) {
|
|
15
|
+
this.#prepared.warmLazyRegex();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
this.#prepared.warm_lazy_regex?.();
|
|
19
|
+
}
|
|
20
|
+
warm_lazy_regex() {
|
|
21
|
+
this.warmLazyRegex();
|
|
22
|
+
}
|
|
23
|
+
warmLazyRegexDiagnosticsJson() {
|
|
24
|
+
if (this.#prepared.warmLazyRegexDiagnosticsJson) return this.#prepared.warmLazyRegexDiagnosticsJson();
|
|
25
|
+
return this.#prepared.warm_lazy_regex_diagnostics_json?.() ?? null;
|
|
26
|
+
}
|
|
27
|
+
warm_lazy_regex_diagnostics_json() {
|
|
28
|
+
return this.warmLazyRegexDiagnosticsJson();
|
|
29
|
+
}
|
|
30
|
+
redactStaticEntities(fullText, operators) {
|
|
31
|
+
return toNativeStaticRedactionResult(this.#prepared.redactStaticEntities(fullText, toBindingOperatorConfig(operators)));
|
|
32
|
+
}
|
|
33
|
+
redact_text(fullText, operators) {
|
|
34
|
+
return this.redactStaticEntities(fullText, operators);
|
|
35
|
+
}
|
|
36
|
+
redact_text_json(fullText, operators) {
|
|
37
|
+
const bindingOperators = toBindingOperatorConfig(operators);
|
|
38
|
+
if (this.#prepared.redactStaticEntitiesJson) return this.#prepared.redactStaticEntitiesJson(fullText, bindingOperators);
|
|
39
|
+
return JSON.stringify(toBindingStaticRedactionResult(toNativeStaticRedactionResult(this.#prepared.redactStaticEntities(fullText, bindingOperators))));
|
|
40
|
+
}
|
|
41
|
+
redactTextJson(fullText, operators) {
|
|
42
|
+
return this.redact_text_json(fullText, operators);
|
|
43
|
+
}
|
|
44
|
+
redactTextStreamJson(fullText, onEvent, operators) {
|
|
45
|
+
if (!this.#prepared.redactStaticEntitiesResultStreamJson) return null;
|
|
46
|
+
return this.#prepared.redactStaticEntitiesResultStreamJson(fullText, toBindingOperatorConfig(operators), onEvent);
|
|
47
|
+
}
|
|
48
|
+
redact_text_stream_json(fullText, onEvent, operators) {
|
|
49
|
+
return this.redactTextStreamJson(fullText, onEvent, operators);
|
|
50
|
+
}
|
|
51
|
+
redactStaticEntitiesDiagnosticsJson(fullText, operators) {
|
|
52
|
+
if (!this.#prepared.redactStaticEntitiesDiagnosticsJson) return null;
|
|
53
|
+
return this.#prepared.redactStaticEntitiesDiagnosticsJson(fullText, toBindingOperatorConfig(operators));
|
|
54
|
+
}
|
|
55
|
+
diagnostics_json(fullText, operators) {
|
|
56
|
+
return this.redactStaticEntitiesDiagnosticsJson(fullText, operators);
|
|
57
|
+
}
|
|
58
|
+
diagnosticsStreamJson(fullText, onBatch, operators) {
|
|
59
|
+
if (!this.#prepared.redactStaticEntitiesDiagnosticsStreamJson) return null;
|
|
60
|
+
return this.#prepared.redactStaticEntitiesDiagnosticsStreamJson(fullText, toBindingOperatorConfig(operators), onBatch);
|
|
61
|
+
}
|
|
62
|
+
diagnostics_stream_json(fullText, onBatch, operators) {
|
|
63
|
+
return this.diagnosticsStreamJson(fullText, onBatch, operators);
|
|
64
|
+
}
|
|
65
|
+
redactStaticEntitiesSummaryDiagnosticsJson(fullText, operators) {
|
|
66
|
+
if (!this.#prepared.redactStaticEntitiesSummaryDiagnosticsJson) return null;
|
|
67
|
+
return this.#prepared.redactStaticEntitiesSummaryDiagnosticsJson(fullText, toBindingOperatorConfig(operators));
|
|
68
|
+
}
|
|
69
|
+
summary_diagnostics_json(fullText, operators) {
|
|
70
|
+
return this.redactStaticEntitiesSummaryDiagnosticsJson(fullText, operators);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var PreparedNativePipeline = class {
|
|
74
|
+
#anonymizer;
|
|
75
|
+
constructor(anonymizer) {
|
|
76
|
+
this.#anonymizer = anonymizer;
|
|
77
|
+
}
|
|
78
|
+
prepareDiagnosticsJson() {
|
|
79
|
+
return this.#anonymizer.prepareDiagnosticsJson();
|
|
80
|
+
}
|
|
81
|
+
prepare_diagnostics_json() {
|
|
82
|
+
return this.prepareDiagnosticsJson();
|
|
83
|
+
}
|
|
84
|
+
warmLazyRegex() {
|
|
85
|
+
this.#anonymizer.warmLazyRegex();
|
|
86
|
+
}
|
|
87
|
+
warm_lazy_regex() {
|
|
88
|
+
this.warmLazyRegex();
|
|
89
|
+
}
|
|
90
|
+
warmLazyRegexDiagnosticsJson() {
|
|
91
|
+
return this.#anonymizer.warmLazyRegexDiagnosticsJson();
|
|
92
|
+
}
|
|
93
|
+
warm_lazy_regex_diagnostics_json() {
|
|
94
|
+
return this.warmLazyRegexDiagnosticsJson();
|
|
95
|
+
}
|
|
96
|
+
redactText(fullText, operators) {
|
|
97
|
+
return this.#anonymizer.redactStaticEntities(fullText, operators);
|
|
98
|
+
}
|
|
99
|
+
redact_text(fullText, operators) {
|
|
100
|
+
return this.redactText(fullText, operators);
|
|
101
|
+
}
|
|
102
|
+
redact_text_json(fullText, operators) {
|
|
103
|
+
return this.#anonymizer.redact_text_json(fullText, operators);
|
|
104
|
+
}
|
|
105
|
+
redactTextJson(fullText, operators) {
|
|
106
|
+
return this.redact_text_json(fullText, operators);
|
|
107
|
+
}
|
|
108
|
+
redactTextStreamJson(fullText, onEvent, operators) {
|
|
109
|
+
return this.#anonymizer.redactTextStreamJson(fullText, onEvent, operators);
|
|
110
|
+
}
|
|
111
|
+
redact_text_stream_json(fullText, onEvent, operators) {
|
|
112
|
+
return this.redactTextStreamJson(fullText, onEvent, operators);
|
|
113
|
+
}
|
|
114
|
+
redactTextDiagnosticsJson(fullText, operators) {
|
|
115
|
+
return this.#anonymizer.redactStaticEntitiesDiagnosticsJson(fullText, operators);
|
|
116
|
+
}
|
|
117
|
+
diagnostics_json(fullText, operators) {
|
|
118
|
+
return this.redactTextDiagnosticsJson(fullText, operators);
|
|
119
|
+
}
|
|
120
|
+
diagnosticsStreamJson(fullText, onBatch, operators) {
|
|
121
|
+
return this.#anonymizer.diagnosticsStreamJson(fullText, onBatch, operators);
|
|
122
|
+
}
|
|
123
|
+
diagnostics_stream_json(fullText, onBatch, operators) {
|
|
124
|
+
return this.diagnosticsStreamJson(fullText, onBatch, operators);
|
|
125
|
+
}
|
|
126
|
+
redactTextSummaryDiagnosticsJson(fullText, operators) {
|
|
127
|
+
return this.#anonymizer.redactStaticEntitiesSummaryDiagnosticsJson(fullText, operators);
|
|
128
|
+
}
|
|
129
|
+
summary_diagnostics_json(fullText, operators) {
|
|
130
|
+
return this.redactTextSummaryDiagnosticsJson(fullText, operators);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const encodeNativeSearchConfig = (config) => new TextEncoder().encode(JSON.stringify(config));
|
|
134
|
+
const encodeNativeSearchConfigInput = (config) => {
|
|
135
|
+
if (typeof config === "string") return new TextEncoder().encode(config);
|
|
136
|
+
if (config instanceof Uint8Array) return config;
|
|
137
|
+
return encodeNativeSearchConfig(config);
|
|
138
|
+
};
|
|
139
|
+
const getNativeBindingVersion = (binding) => binding.nativePackageVersion();
|
|
140
|
+
const native_package_version = getNativeBindingVersion;
|
|
141
|
+
const normalize_for_search = ({ binding, text }) => binding.normalizeForSearch(text);
|
|
142
|
+
const assertNativeBindingVersion = ({ binding, expectedVersion }) => {
|
|
143
|
+
const actualVersion = getNativeBindingVersion(binding);
|
|
144
|
+
if (actualVersion !== expectedVersion) throw new Error(`Native anonymize binding version ${actualVersion} does not match ${expectedVersion}`);
|
|
145
|
+
};
|
|
146
|
+
const prepareNativeSearchPackage = ({ binding, config, compressed = false }) => {
|
|
147
|
+
const configBytes = encodeNativeSearchConfig(config);
|
|
148
|
+
return compressed ? binding.prepareStaticSearchCompressedPackageBytes(configBytes) : binding.prepareStaticSearchPackageBytes(configBytes);
|
|
149
|
+
};
|
|
150
|
+
const prepare_search_package = ({ binding, config, compressed = false }) => {
|
|
151
|
+
const configBytes = encodeNativeSearchConfigInput(config);
|
|
152
|
+
return compressed ? binding.prepareStaticSearchCompressedPackageBytes(configBytes) : binding.prepareStaticSearchPackageBytes(configBytes);
|
|
153
|
+
};
|
|
154
|
+
const createNativeAnonymizerFromConfig = ({ binding, config }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfig(config)));
|
|
155
|
+
const createNativeAnonymizerFromPackage = ({ binding, packageBytes }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromPreparedPackageBytes(packageBytes));
|
|
156
|
+
const load_prepared_package = ({ binding, packageBytes }) => createNativeAnonymizerFromPackage({
|
|
157
|
+
binding,
|
|
158
|
+
packageBytes
|
|
159
|
+
});
|
|
160
|
+
const redact_text_json = ({ binding, config, fullText, operators }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfigInput(config))).redact_text_json(fullText, operators);
|
|
161
|
+
const redact_text = ({ binding, config, fullText, operators }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfigInput(config))).redact_text(fullText, operators);
|
|
162
|
+
const redact_text_stream_json = ({ binding, config, fullText, operators, onEvent }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfigInput(config))).redact_text_stream_json(fullText, onEvent, operators);
|
|
163
|
+
const diagnostics_json = ({ binding, config, fullText, operators }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfigInput(config))).diagnostics_json(fullText, operators);
|
|
164
|
+
const diagnostics_stream_json = ({ binding, config, fullText, operators, onBatch }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfigInput(config))).diagnostics_stream_json(fullText, onBatch, operators);
|
|
165
|
+
const summary_diagnostics_json = ({ binding, config, fullText, operators }) => new PreparedNativeAnonymizer(binding.NativePreparedSearch.fromConfigJsonBytes(encodeNativeSearchConfigInput(config))).summary_diagnostics_json(fullText, operators);
|
|
166
|
+
const createNativePipelineFromPackage = ({ binding, packageBytes }) => new PreparedNativePipeline(createNativeAnonymizerFromPackage({
|
|
167
|
+
binding,
|
|
168
|
+
packageBytes
|
|
169
|
+
}));
|
|
170
|
+
const PreparedSearch = PreparedNativeAnonymizer;
|
|
171
|
+
const PreparedAnonymizer = PreparedNativeAnonymizer;
|
|
172
|
+
const toBindingOperatorConfig = (config) => {
|
|
173
|
+
if (!config) return;
|
|
174
|
+
const bindingConfig = {};
|
|
175
|
+
if (config.operators !== void 0) bindingConfig.operators = config.operators;
|
|
176
|
+
if (config.redactString !== void 0) bindingConfig.redactString = config.redactString;
|
|
177
|
+
return bindingConfig;
|
|
178
|
+
};
|
|
179
|
+
const toNativeStaticRedactionResult = (result) => ({
|
|
180
|
+
resolvedEntities: result.resolvedEntities.map(toNativePipelineEntity),
|
|
181
|
+
redaction: toNativeRedactionResult(result.redaction)
|
|
182
|
+
});
|
|
183
|
+
const toBindingStaticRedactionResult = (result) => ({
|
|
184
|
+
resolved_entities: result.resolvedEntities.map(toBindingPipelineEntity),
|
|
185
|
+
redaction: {
|
|
186
|
+
redacted_text: result.redaction.redactedText,
|
|
187
|
+
redaction_map: [...result.redaction.redactionMap.entries()].map(([placeholder, original]) => ({
|
|
188
|
+
placeholder,
|
|
189
|
+
original
|
|
190
|
+
})),
|
|
191
|
+
operator_map: [...result.redaction.operatorMap.entries()].map(([placeholder, operator]) => ({
|
|
192
|
+
placeholder,
|
|
193
|
+
operator
|
|
194
|
+
})),
|
|
195
|
+
entity_count: result.redaction.entityCount
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
const toNativePipelineEntity = (entity) => ({
|
|
199
|
+
start: entity.start,
|
|
200
|
+
end: entity.end,
|
|
201
|
+
label: entity.label,
|
|
202
|
+
text: entity.text,
|
|
203
|
+
score: entity.score,
|
|
204
|
+
source: entity.source,
|
|
205
|
+
...entity.sourceDetail ? { sourceDetail: entity.sourceDetail } : {}
|
|
206
|
+
});
|
|
207
|
+
const toBindingPipelineEntity = ({ sourceDetail, ...entity }) => ({
|
|
208
|
+
...entity,
|
|
209
|
+
source_detail: sourceDetail ?? null
|
|
210
|
+
});
|
|
211
|
+
const toNativeRedactionResult = (result) => ({
|
|
212
|
+
redactedText: result.redactedText,
|
|
213
|
+
redactionMap: toRedactionMap(result.redactionMap),
|
|
214
|
+
operatorMap: toOperatorMap(result.operatorMap),
|
|
215
|
+
entityCount: result.entityCount
|
|
216
|
+
});
|
|
217
|
+
const toRedactionMap = (entries) => {
|
|
218
|
+
const map = /* @__PURE__ */ new Map();
|
|
219
|
+
for (const entry of entries) map.set(entry.placeholder, entry.original);
|
|
220
|
+
return map;
|
|
221
|
+
};
|
|
222
|
+
const toOperatorMap = (entries) => {
|
|
223
|
+
const map = /* @__PURE__ */ new Map();
|
|
224
|
+
for (const entry of entries) map.set(entry.placeholder, entry.operator);
|
|
225
|
+
return map;
|
|
226
|
+
};
|
|
227
|
+
//#endregion
|
|
228
|
+
export { PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedSearch, assertNativeBindingVersion, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromPackage, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, getNativeBindingVersion, load_prepared_package, native_package_version, normalize_for_search, prepareNativeSearchPackage, prepare_search_package, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
229
|
+
|
|
230
|
+
//# sourceMappingURL=native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.mjs","names":["#prepared","#anonymizer"],"sources":["../src/native.ts"],"sourcesContent":["import type { NativePreparedSearchConfig } from \"./build-unified-search\";\nimport type { OperatorType } from \"./types\";\n\ntype NativeBindingOperatorConfig = {\n operators?: Record<string, OperatorType>;\n redactString?: string;\n};\n\nexport type NativeDiagnosticsBatchCallback = (diagnosticsJson: string) => void;\nexport type NativeResultEventCallback = (eventJson: string) => void;\n\ntype NativeBindingRedactionEntry = {\n placeholder: string;\n original: string;\n};\n\ntype NativeBindingOperatorEntry = {\n placeholder: string;\n operator: OperatorType;\n};\n\ntype NativeBindingPipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n sourceDetail?: string | null;\n};\n\ntype NativeBindingRedactionResult = {\n redactedText: string;\n redactionMap: NativeBindingRedactionEntry[];\n operatorMap: NativeBindingOperatorEntry[];\n entityCount: number;\n};\n\ntype NativeBindingStaticRedactionResult = {\n resolvedEntities: NativeBindingPipelineEntity[];\n redaction: NativeBindingRedactionResult;\n};\n\ntype CanonicalPipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n source_detail?: string | null;\n};\n\ntype CanonicalStaticRedactionResult = {\n resolved_entities: CanonicalPipelineEntity[];\n redaction: {\n redacted_text: string;\n redaction_map: NativeBindingRedactionEntry[];\n operator_map: NativeBindingOperatorEntry[];\n entity_count: number;\n };\n};\n\nexport type NativePreparedSearchBinding = {\n prepareDiagnosticsJson?: () => string;\n warmLazyRegex?: () => void;\n warm_lazy_regex?: () => void;\n warmLazyRegexDiagnosticsJson?: () => string;\n warm_lazy_regex_diagnostics_json?: () => string;\n redactStaticEntities: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => NativeBindingStaticRedactionResult;\n redactStaticEntitiesJson?: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesResultStreamJson?: (\n fullText: string,\n operators: NativeBindingOperatorConfig | undefined,\n onEvent: NativeResultEventCallback,\n ) => string;\n redactStaticEntitiesDiagnosticsJson?: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesDiagnosticsStreamJson?: (\n fullText: string,\n operators: NativeBindingOperatorConfig | undefined,\n onBatch: NativeDiagnosticsBatchCallback,\n ) => string;\n redactStaticEntitiesSummaryDiagnosticsJson?: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n};\n\nexport type NativeAnonymizeBinding = {\n normalizeForSearch: (text: string) => string;\n nativePackageVersion: () => string;\n NativePreparedSearch: {\n fromConfigJsonBytes: (\n configJson: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromPreparedPackageBytes: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromPreparedPackageBytesWithoutCache?: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromTrustedPreparedPackageBytes?: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromTrustedPreparedPackageBytesWithoutCache?: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n };\n prepareStaticSearchPackageBytes: (configJson: Uint8Array) => Uint8Array;\n prepareStaticSearchCompressedPackageBytes: (\n configJson: Uint8Array,\n ) => Uint8Array;\n};\n\nexport type NativeOperatorConfig = {\n operators?: Record<string, OperatorType>;\n redactString?: string;\n};\n\nexport type NativePipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n sourceDetail?: string;\n};\n\nexport type NativeRedactionResult = {\n redactedText: string;\n redactionMap: Map<string, string>;\n operatorMap: Map<string, OperatorType>;\n entityCount: number;\n};\n\nexport type NativeStaticRedactionResult = {\n resolvedEntities: NativePipelineEntity[];\n redaction: NativeRedactionResult;\n};\n\nexport type NativeSearchPackageOptions = {\n binding: NativeAnonymizeBinding;\n config: NativePreparedSearchConfig;\n compressed?: boolean;\n};\n\nexport type NativeSearchPackageInput =\n | NativePreparedSearchConfig\n | string\n | Uint8Array;\n\nexport type SharedNativeSearchPackageOptions = {\n binding: NativeAnonymizeBinding;\n config: NativeSearchPackageInput;\n compressed?: boolean;\n};\n\nexport type SharedNativePreparedPackageOptions = {\n binding: NativeAnonymizeBinding;\n packageBytes: Uint8Array;\n};\n\nexport type SharedNativeRedactTextJsonOptions = {\n binding: NativeAnonymizeBinding;\n config: NativeSearchPackageInput;\n fullText: string;\n operators?: NativeOperatorConfig;\n};\n\nexport type SharedNativeRedactTextOptions = SharedNativeRedactTextJsonOptions;\n\nexport type SharedNativeDiagnosticsJsonOptions =\n SharedNativeRedactTextJsonOptions;\n\nexport type SharedNativeDiagnosticsStreamJsonOptions =\n SharedNativeRedactTextJsonOptions & {\n onBatch: NativeDiagnosticsBatchCallback;\n };\n\nexport type SharedNativeRedactTextStreamJsonOptions =\n SharedNativeRedactTextJsonOptions & {\n onEvent: NativeResultEventCallback;\n };\n\nexport type NativeNormalizeOptions = {\n binding: NativeAnonymizeBinding;\n text: string;\n};\n\nexport type NativeAnonymizerFromConfigOptions = {\n binding: NativeAnonymizeBinding;\n config: NativePreparedSearchConfig;\n};\n\nexport type NativeAnonymizerFromPackageOptions = {\n binding: NativeAnonymizeBinding;\n packageBytes: Uint8Array;\n};\n\nexport type NativePipelineFromPackageOptions =\n NativeAnonymizerFromPackageOptions;\n\nexport type NativeBindingVersionOptions = {\n binding: NativeAnonymizeBinding;\n expectedVersion: string;\n};\n\nexport class PreparedNativeAnonymizer {\n readonly #prepared: NativePreparedSearchBinding;\n\n constructor(prepared: NativePreparedSearchBinding) {\n this.#prepared = prepared;\n }\n\n prepareDiagnosticsJson(): string | null {\n return this.#prepared.prepareDiagnosticsJson?.() ?? null;\n }\n\n prepare_diagnostics_json(): string | null {\n return this.prepareDiagnosticsJson();\n }\n\n warmLazyRegex(): void {\n if (this.#prepared.warmLazyRegex) {\n this.#prepared.warmLazyRegex();\n return;\n }\n this.#prepared.warm_lazy_regex?.();\n }\n\n warm_lazy_regex(): void {\n this.warmLazyRegex();\n }\n\n warmLazyRegexDiagnosticsJson(): string | null {\n if (this.#prepared.warmLazyRegexDiagnosticsJson) {\n return this.#prepared.warmLazyRegexDiagnosticsJson();\n }\n return this.#prepared.warm_lazy_regex_diagnostics_json?.() ?? null;\n }\n\n warm_lazy_regex_diagnostics_json(): string | null {\n return this.warmLazyRegexDiagnosticsJson();\n }\n\n redactStaticEntities(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return toNativeStaticRedactionResult(\n this.#prepared.redactStaticEntities(\n fullText,\n toBindingOperatorConfig(operators),\n ),\n );\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntities(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n const bindingOperators = toBindingOperatorConfig(operators);\n if (this.#prepared.redactStaticEntitiesJson) {\n return this.#prepared.redactStaticEntitiesJson(\n fullText,\n bindingOperators,\n );\n }\n return JSON.stringify(\n toBindingStaticRedactionResult(\n toNativeStaticRedactionResult(\n this.#prepared.redactStaticEntities(fullText, bindingOperators),\n ),\n ),\n );\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redactTextStreamJson(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n if (!this.#prepared.redactStaticEntitiesResultStreamJson) {\n return null;\n }\n return this.#prepared.redactStaticEntitiesResultStreamJson(\n fullText,\n toBindingOperatorConfig(operators),\n onEvent,\n );\n }\n\n redact_text_stream_json(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redactStaticEntitiesDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n if (!this.#prepared.redactStaticEntitiesDiagnosticsJson) {\n return null;\n }\n return this.#prepared.redactStaticEntitiesDiagnosticsJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.redactStaticEntitiesDiagnosticsJson(fullText, operators);\n }\n\n diagnosticsStreamJson(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n if (!this.#prepared.redactStaticEntitiesDiagnosticsStreamJson) {\n return null;\n }\n return this.#prepared.redactStaticEntitiesDiagnosticsStreamJson(\n fullText,\n toBindingOperatorConfig(operators),\n onBatch,\n );\n }\n\n diagnostics_stream_json(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n redactStaticEntitiesSummaryDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n if (!this.#prepared.redactStaticEntitiesSummaryDiagnosticsJson) {\n return null;\n }\n return this.#prepared.redactStaticEntitiesSummaryDiagnosticsJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n summary_diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.redactStaticEntitiesSummaryDiagnosticsJson(fullText, operators);\n }\n}\n\nexport class PreparedNativePipeline {\n readonly #anonymizer: PreparedNativeAnonymizer;\n\n constructor(anonymizer: PreparedNativeAnonymizer) {\n this.#anonymizer = anonymizer;\n }\n\n prepareDiagnosticsJson(): string | null {\n return this.#anonymizer.prepareDiagnosticsJson();\n }\n\n prepare_diagnostics_json(): string | null {\n return this.prepareDiagnosticsJson();\n }\n\n warmLazyRegex(): void {\n this.#anonymizer.warmLazyRegex();\n }\n\n warm_lazy_regex(): void {\n this.warmLazyRegex();\n }\n\n warmLazyRegexDiagnosticsJson(): string | null {\n return this.#anonymizer.warmLazyRegexDiagnosticsJson();\n }\n\n warm_lazy_regex_diagnostics_json(): string | null {\n return this.warmLazyRegexDiagnosticsJson();\n }\n\n redactText(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.#anonymizer.redactStaticEntities(fullText, operators);\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactText(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.#anonymizer.redact_text_json(fullText, operators);\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redactTextStreamJson(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.#anonymizer.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redact_text_stream_json(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redactTextDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.#anonymizer.redactStaticEntitiesDiagnosticsJson(\n fullText,\n operators,\n );\n }\n\n diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.redactTextDiagnosticsJson(fullText, operators);\n }\n\n diagnosticsStreamJson(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.#anonymizer.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n diagnostics_stream_json(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n redactTextSummaryDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.#anonymizer.redactStaticEntitiesSummaryDiagnosticsJson(\n fullText,\n operators,\n );\n }\n\n summary_diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string | null {\n return this.redactTextSummaryDiagnosticsJson(fullText, operators);\n }\n}\n\nexport const encodeNativeSearchConfig = (\n config: NativePreparedSearchConfig,\n): Uint8Array => new TextEncoder().encode(JSON.stringify(config));\n\nexport const encodeNativeSearchConfigInput = (\n config: NativeSearchPackageInput,\n): Uint8Array => {\n if (typeof config === \"string\") {\n return new TextEncoder().encode(config);\n }\n if (config instanceof Uint8Array) {\n return config;\n }\n return encodeNativeSearchConfig(config);\n};\n\nexport const getNativeBindingVersion = (\n binding: NativeAnonymizeBinding,\n): string => binding.nativePackageVersion();\n\nexport const native_package_version = getNativeBindingVersion;\n\nexport const normalize_for_search = ({\n binding,\n text,\n}: NativeNormalizeOptions): string => binding.normalizeForSearch(text);\n\nexport const assertNativeBindingVersion = ({\n binding,\n expectedVersion,\n}: NativeBindingVersionOptions): void => {\n const actualVersion = getNativeBindingVersion(binding);\n if (actualVersion !== expectedVersion) {\n throw new Error(\n `Native anonymize binding version ${actualVersion} does not match ${expectedVersion}`,\n );\n }\n};\n\nexport const prepareNativeSearchPackage = ({\n binding,\n config,\n compressed = false,\n}: NativeSearchPackageOptions): Uint8Array => {\n const configBytes = encodeNativeSearchConfig(config);\n return compressed\n ? binding.prepareStaticSearchCompressedPackageBytes(configBytes)\n : binding.prepareStaticSearchPackageBytes(configBytes);\n};\n\nexport const prepare_search_package = ({\n binding,\n config,\n compressed = false,\n}: SharedNativeSearchPackageOptions): Uint8Array => {\n const configBytes = encodeNativeSearchConfigInput(config);\n return compressed\n ? binding.prepareStaticSearchCompressedPackageBytes(configBytes)\n : binding.prepareStaticSearchPackageBytes(configBytes);\n};\n\nexport const createNativeAnonymizerFromConfig = ({\n binding,\n config,\n}: NativeAnonymizerFromConfigOptions): PreparedNativeAnonymizer =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfig(config),\n ),\n );\n\nexport const createNativeAnonymizerFromPackage = ({\n binding,\n packageBytes,\n}: NativeAnonymizerFromPackageOptions): PreparedNativeAnonymizer =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromPreparedPackageBytes(packageBytes),\n );\n\nexport const load_prepared_package = ({\n binding,\n packageBytes,\n}: SharedNativePreparedPackageOptions): PreparedNativeAnonymizer =>\n createNativeAnonymizerFromPackage({ binding, packageBytes });\n\nexport const redact_text_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeRedactTextJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text_json(fullText, operators);\n\nexport const redact_text = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeRedactTextOptions): NativeStaticRedactionResult =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text(fullText, operators);\n\nexport const redact_text_stream_json = ({\n binding,\n config,\n fullText,\n operators,\n onEvent,\n}: SharedNativeRedactTextStreamJsonOptions): string | null =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text_stream_json(fullText, onEvent, operators);\n\nexport const diagnostics_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeDiagnosticsJsonOptions): string | null =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).diagnostics_json(fullText, operators);\n\nexport const diagnostics_stream_json = ({\n binding,\n config,\n fullText,\n operators,\n onBatch,\n}: SharedNativeDiagnosticsStreamJsonOptions): string | null =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).diagnostics_stream_json(fullText, onBatch, operators);\n\nexport const summary_diagnostics_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeDiagnosticsJsonOptions): string | null =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).summary_diagnostics_json(fullText, operators);\n\nexport const createNativePipelineFromPackage = ({\n binding,\n packageBytes,\n}: NativePipelineFromPackageOptions): PreparedNativePipeline =>\n new PreparedNativePipeline(\n createNativeAnonymizerFromPackage({ binding, packageBytes }),\n );\n\nexport const PreparedSearch = PreparedNativeAnonymizer;\nexport type PreparedSearch = PreparedNativeAnonymizer;\nexport const PreparedAnonymizer = PreparedNativeAnonymizer;\nexport type PreparedAnonymizer = PreparedNativeAnonymizer;\n\nconst toBindingOperatorConfig = (\n config: NativeOperatorConfig | undefined,\n): NativeBindingOperatorConfig | undefined => {\n if (!config) {\n return undefined;\n }\n const bindingConfig: NativeBindingOperatorConfig = {};\n if (config.operators !== undefined) {\n bindingConfig.operators = config.operators;\n }\n if (config.redactString !== undefined) {\n bindingConfig.redactString = config.redactString;\n }\n return bindingConfig;\n};\n\nconst toNativeStaticRedactionResult = (\n result: NativeBindingStaticRedactionResult,\n): NativeStaticRedactionResult => ({\n resolvedEntities: result.resolvedEntities.map(toNativePipelineEntity),\n redaction: toNativeRedactionResult(result.redaction),\n});\n\nconst toBindingStaticRedactionResult = (\n result: NativeStaticRedactionResult,\n): CanonicalStaticRedactionResult => ({\n resolved_entities: result.resolvedEntities.map(toBindingPipelineEntity),\n redaction: {\n redacted_text: result.redaction.redactedText,\n redaction_map: [...result.redaction.redactionMap.entries()].map(\n ([placeholder, original]) => ({ placeholder, original }),\n ),\n operator_map: [...result.redaction.operatorMap.entries()].map(\n ([placeholder, operator]) => ({ placeholder, operator }),\n ),\n entity_count: result.redaction.entityCount,\n },\n});\n\nconst toNativePipelineEntity = (\n entity: NativeBindingPipelineEntity,\n): NativePipelineEntity => ({\n start: entity.start,\n end: entity.end,\n label: entity.label,\n text: entity.text,\n score: entity.score,\n source: entity.source,\n ...(entity.sourceDetail ? { sourceDetail: entity.sourceDetail } : {}),\n});\n\nconst toBindingPipelineEntity = ({\n sourceDetail,\n ...entity\n}: NativePipelineEntity): CanonicalPipelineEntity => ({\n ...entity,\n source_detail: sourceDetail ?? null,\n});\n\nconst toNativeRedactionResult = (\n result: NativeBindingRedactionResult,\n): NativeRedactionResult => ({\n redactedText: result.redactedText,\n redactionMap: toRedactionMap(result.redactionMap),\n operatorMap: toOperatorMap(result.operatorMap),\n entityCount: result.entityCount,\n});\n\nconst toRedactionMap = (\n entries: readonly NativeBindingRedactionEntry[],\n): Map<string, string> => {\n const map = new Map<string, string>();\n for (const entry of entries) {\n map.set(entry.placeholder, entry.original);\n }\n return map;\n};\n\nconst toOperatorMap = (\n entries: readonly NativeBindingOperatorEntry[],\n): Map<string, OperatorType> => {\n const map = new Map<string, OperatorType>();\n for (const entry of entries) {\n map.set(entry.placeholder, entry.operator);\n }\n return map;\n};\n"],"mappings":";AAyNA,IAAa,2BAAb,MAAsC;CACpC;CAEA,YAAY,UAAuC;EACjD,KAAKA,YAAY;CACnB;CAEA,yBAAwC;EACtC,OAAO,KAAKA,UAAU,yBAAyB,KAAK;CACtD;CAEA,2BAA0C;EACxC,OAAO,KAAK,uBAAuB;CACrC;CAEA,gBAAsB;EACpB,IAAI,KAAKA,UAAU,eAAe;GAChC,KAAKA,UAAU,cAAc;GAC7B;EACF;EACA,KAAKA,UAAU,kBAAkB;CACnC;CAEA,kBAAwB;EACtB,KAAK,cAAc;CACrB;CAEA,+BAA8C;EAC5C,IAAI,KAAKA,UAAU,8BACjB,OAAO,KAAKA,UAAU,6BAA6B;EAErD,OAAO,KAAKA,UAAU,mCAAmC,KAAK;CAChE;CAEA,mCAAkD;EAChD,OAAO,KAAK,6BAA6B;CAC3C;CAEA,qBACE,UACA,WAC6B;EAC7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oC;CACpC,mBAAmB,OAAO,iBAAiB,IAAI,uBAAuB;CACtE,WAAW;EACT,eAAe,OAAO,UAAU;EAChC,eAAe,CAAC,GAAG,OAAO,UAAU,aAAa,QAAQ,CAAC,CAAC,CAAC,KACzD,CAAC,aAAa,eAAe;GAAE;GAAa;EAAS,EACxD;EACA,cAAc,CAAC,GAAG,OAAO,UAAU,YAAY,QAAQ,CAAC,CAAC,CAAC,KACvD,CAAC,aAAa,eAAe;GAAE;GAAa;EAAS,EACxD;EACA,cAAc,OAAO,UAAU;CACjC;AACF;AAEA,MAAM,0BACJ,YAC0B;CAC1B,OAAO,OAAO;CACd,KAAK,OAAO;CACZ,OAAO,OAAO;CACd,MAAM,OAAO;CACb,OAAO,OAAO;CACd,QAAQ,OAAO;CACf,GAAI,OAAO,eAAe,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;AACrE;AAEA,MAAM,2BAA2B,EAC/B,cACA,GAAG,cACiD;CACpD,GAAG;CACH,eAAe,gBAAgB;AACjC;AAEA,MAAM,2BACJ,YAC2B;CAC3B,cAAc,OAAO;CACrB,cAAc,eAAe,OAAO,YAAY;CAChD,aAAa,cAAc,OAAO,WAAW;CAC7C,aAAa,OAAO;AACtB;AAEA,MAAM,kBACJ,YACwB;CACxB,MAAM,sBAAM,IAAI,IAAoB;CACpC,KAAK,MAAM,SAAS,SAClB,IAAI,IAAI,MAAM,aAAa,MAAM,QAAQ;CAE3C,OAAO;AACT;AAEA,MAAM,iBACJ,YAC8B;CAC9B,MAAM,sBAAM,IAAI,IAA0B;CAC1C,KAAK,MAAM,SAAS,SAClB,IAAI,IAAI,MAAM,aAAa,MAAM,QAAQ;CAE3C,OAAO;AACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as createNativePipelineFromPackage, B as prepare_search_package, C as SharedNativeRedactTextJsonOptions, D as assertNativeBindingVersion, E as SharedNativeSearchPackageOptions, F as getNativeBindingVersion, H as redact_text_json, I as load_prepared_package, L as native_package_version, M as diagnostics_stream_json, N as encodeNativeSearchConfig, O as createNativeAnonymizerFromConfig, P as encodeNativeSearchConfigInput, R as normalize_for_search, S as SharedNativePreparedPackageOptions, T as SharedNativeRedactTextStreamJsonOptions, U as redact_text_stream_json, V as redact_text, W as summary_diagnostics_json, _ as PreparedNativeAnonymizer, a as NativeDiagnosticsBatchCallback, b as SharedNativeDiagnosticsJsonOptions, c as NativePipelineEntity, d as NativeRedactionResult, f as NativeResultEventCallback, g as PreparedAnonymizer, h as NativeStaticRedactionResult, i as NativeBindingVersionOptions, j as diagnostics_json, k as createNativeAnonymizerFromPackage, l as NativePipelineFromPackageOptions, m as NativeSearchPackageOptions, n as NativeAnonymizerFromConfigOptions, o as NativeNormalizeOptions, p as NativeSearchPackageInput, r as NativeAnonymizerFromPackageOptions, s as NativeOperatorConfig, t as NativeAnonymizeBinding, u as NativePreparedSearchBinding, v as PreparedNativePipeline, w as SharedNativeRedactTextOptions, x as SharedNativeDiagnosticsStreamJsonOptions, y as PreparedSearch, z as prepareNativeSearchPackage } from "./native.mjs";
|
|
2
|
+
export { NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOperatorConfig, NativePipelineEntity, NativePipelineFromPackageOptions, NativePreparedSearchBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeStaticRedactionResult, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedSearch, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, assertNativeBindingVersion, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromPackage, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, getNativeBindingVersion, load_prepared_package, native_package_version, normalize_for_search, prepareNativeSearchPackage, prepare_search_package, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/data/organization-unit-heads.json
|
|
2
|
+
var _comment = "Administrative or organizational unit nouns that can appear in legal prose without denoting a person or a street/city suffix. Lowercased and organized per language.";
|
|
3
|
+
var cs = [
|
|
4
|
+
"agentura",
|
|
5
|
+
"inspekce",
|
|
6
|
+
"kancelář",
|
|
7
|
+
"odbor",
|
|
8
|
+
"oddělení",
|
|
9
|
+
"sekretariát",
|
|
10
|
+
"správa",
|
|
11
|
+
"úřad"
|
|
12
|
+
];
|
|
13
|
+
var organization_unit_heads_default = {
|
|
14
|
+
_comment,
|
|
15
|
+
cs
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { _comment, cs, organization_unit_heads_default as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=organization-unit-heads.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-unit-heads.mjs","names":[],"sources":["../src/data/organization-unit-heads.json"],"sourcesContent":[""],"mappings":""}
|