@aim-packages/subtitle 0.0.10 → 0.0.12
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.cjs.js +14 -14
- package/dist/index.d.ts +13 -7
- package/dist/index.es.js +630 -605
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,11 @@ declare function chunkSegmentStringsWithIndex(segments: AimSegments[], character
|
|
|
75
75
|
indexResult: number[];
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
declare function consolidateSegments(items: Segment[], option: {
|
|
79
|
+
maxDistance: number;
|
|
80
|
+
padding: number;
|
|
81
|
+
}): Segment[] | undefined;
|
|
82
|
+
|
|
78
83
|
/**
|
|
79
84
|
* 匹配中文、日文、韩文字符的正则表达式
|
|
80
85
|
*
|
|
@@ -103,7 +108,7 @@ declare function convertToSeconds(time?: string): number;
|
|
|
103
108
|
* @public
|
|
104
109
|
*/
|
|
105
110
|
declare function create(options?: ParserOptions<AimSegments[], AimSegments[], string> & {
|
|
106
|
-
vad?:
|
|
111
|
+
vad?: Segment[];
|
|
107
112
|
}): Parser<string>;
|
|
108
113
|
|
|
109
114
|
declare function create_2(options?: ParserOptions<RequiredByKey<Partial<AimSegments>, "index">[], Partial<AimSegments>[], string>): Parser<string>;
|
|
@@ -272,6 +277,11 @@ declare interface RepeatCheckOption {
|
|
|
272
277
|
|
|
273
278
|
declare type RequiredByKey<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
274
279
|
|
|
280
|
+
declare type Segment = {
|
|
281
|
+
start: number;
|
|
282
|
+
end: number;
|
|
283
|
+
};
|
|
284
|
+
|
|
275
285
|
declare function splitToSentences(text: string, languageCode?: LanguageCode): string[];
|
|
276
286
|
|
|
277
287
|
declare function srtToAimSegments(text: string): Promise<AimSegments[]>;
|
|
@@ -359,15 +369,11 @@ export declare namespace utils {
|
|
|
359
369
|
containsCJKCharacters,
|
|
360
370
|
languageCodeToName,
|
|
361
371
|
chunkArrayStrings,
|
|
362
|
-
chunkSegmentStringsWithIndex
|
|
372
|
+
chunkSegmentStringsWithIndex,
|
|
373
|
+
consolidateSegments
|
|
363
374
|
}
|
|
364
375
|
}
|
|
365
376
|
|
|
366
|
-
declare type VADTimeItem = {
|
|
367
|
-
start: number;
|
|
368
|
-
end: number;
|
|
369
|
-
};
|
|
370
|
-
|
|
371
377
|
declare function vttToAimSegments(text: string): Promise<AimSegments[]>;
|
|
372
378
|
|
|
373
379
|
export { }
|