@dan-uni/dan-any-plugin-detaolu 0.6.8 → 0.9.2
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/index.js +8 -1
- package/dist/index.umd.min.js +25265 -25052
- package/dist/index.umd.min.js.LICENSE.txt +1 -1
- package/dist/pakku.js/similarity_stub.d.ts +1 -1
- package/dist/pakku.js/types.d.ts +6 -0
- package/package.json +1 -1
- package/src/pakku.js/index.ts +7 -0
- package/src/pakku.js/similarity_stub.ts +1 -1
- package/src/pakku.js/types.ts +7 -0
|
@@ -27,7 +27,7 @@ See the Apache Version 2.0 License for specific language governing permissions
|
|
|
27
27
|
and limitations under the License.
|
|
28
28
|
***************************************************************************** */
|
|
29
29
|
|
|
30
|
-
/*! For license information please see index.
|
|
30
|
+
/*! For license information please see index.min.js.LICENSE.txt */
|
|
31
31
|
|
|
32
32
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from '.';
|
|
2
2
|
import type { int, Stats } from './types';
|
|
3
|
-
export declare function init(wasm_module: ArrayBuffer): Promise<void>;
|
|
3
|
+
export declare function init(wasm_module: ArrayBuffer | NonSharedBuffer): Promise<void>;
|
|
4
4
|
export declare function begin_chunk(config: Config): void;
|
|
5
5
|
export declare function begin_index_lock(): void;
|
|
6
6
|
export declare function detect_similarity(str: string, mode: number, index_l: int, S: Stats): null | {
|
package/dist/pakku.js/types.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export interface DanmuObjectRepresentative extends DanmuObject {
|
|
|
23
23
|
disp_str: string;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
+
export interface DanmuObjectDeleted extends DanmuObject {
|
|
27
|
+
pakku: {
|
|
28
|
+
deleted_reason: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
26
31
|
export interface DanmuChunk<ObjectType extends DanmuObject> {
|
|
27
32
|
objs: ObjectType[];
|
|
28
33
|
}
|
|
@@ -41,6 +46,7 @@ export interface DanmuClusterPtr {
|
|
|
41
46
|
export interface DanmuClusterOutput {
|
|
42
47
|
clusters: DanmuClusterPtr[];
|
|
43
48
|
stats: Stats;
|
|
49
|
+
deleted_chunk: DanmuObjectDeleted[];
|
|
44
50
|
}
|
|
45
51
|
export declare class Stats {
|
|
46
52
|
combined_identical: number;
|
package/package.json
CHANGED
package/src/pakku.js/index.ts
CHANGED
|
@@ -332,6 +332,7 @@ async function merge(
|
|
|
332
332
|
const ret: DanmuClusterOutput = {
|
|
333
333
|
clusters: [],
|
|
334
334
|
stats: new Stats(),
|
|
335
|
+
deleted_chunk: [],
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
function apply_single_cluster(idx: int, obj: DanmuObject, desc: string) {
|
|
@@ -444,6 +445,12 @@ async function merge(
|
|
|
444
445
|
s.deleted_blacklist++
|
|
445
446
|
s.deleted_blacklist_each[matched] =
|
|
446
447
|
(s.deleted_blacklist_each[matched] || 0) + 1
|
|
448
|
+
ret.deleted_chunk.push({
|
|
449
|
+
...obj,
|
|
450
|
+
pakku: {
|
|
451
|
+
deleted_reason: `命中黑名单:${matched}`,
|
|
452
|
+
},
|
|
453
|
+
})
|
|
447
454
|
}
|
|
448
455
|
return null
|
|
449
456
|
}
|
|
@@ -9,7 +9,7 @@ let ptr_buf: number
|
|
|
9
9
|
|
|
10
10
|
const MAX_STRING_LEN = 16005
|
|
11
11
|
|
|
12
|
-
export async function init(wasm_module: ArrayBuffer) {
|
|
12
|
+
export async function init(wasm_module: ArrayBuffer | NonSharedBuffer) {
|
|
13
13
|
module = await generated_promise({ wasm: wasm_module })
|
|
14
14
|
ptr_buf = module._malloc(MAX_STRING_LEN * 2 + 7)
|
|
15
15
|
if (ptr_buf % 2)
|
package/src/pakku.js/types.ts
CHANGED
|
@@ -46,6 +46,12 @@ export interface DanmuObjectRepresentative extends DanmuObject {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
export interface DanmuObjectDeleted extends DanmuObject {
|
|
50
|
+
pakku: {
|
|
51
|
+
deleted_reason: string
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
export interface DanmuChunk<ObjectType extends DanmuObject> {
|
|
50
56
|
objs: ObjectType[]
|
|
51
57
|
|
|
@@ -79,6 +85,7 @@ export interface DanmuClusterPtr {
|
|
|
79
85
|
export interface DanmuClusterOutput {
|
|
80
86
|
clusters: DanmuClusterPtr[]
|
|
81
87
|
stats: Stats
|
|
88
|
+
deleted_chunk: DanmuObjectDeleted[]
|
|
82
89
|
}
|
|
83
90
|
|
|
84
91
|
export class Stats {
|