@aim-packages/subtitle 0.0.10 → 0.0.11
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 +7 -7
- package/dist/index.d.ts +11 -1
- package/dist/index.es.js +287 -275
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,10 @@ declare function chunkSegmentStringsWithIndex(segments: AimSegments[], character
|
|
|
75
75
|
indexResult: number[];
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
declare function consolidateSegments(items: Segments[], option: {
|
|
79
|
+
maxDistance: number;
|
|
80
|
+
}): Segments[] | undefined;
|
|
81
|
+
|
|
78
82
|
/**
|
|
79
83
|
* 匹配中文、日文、韩文字符的正则表达式
|
|
80
84
|
*
|
|
@@ -272,6 +276,11 @@ declare interface RepeatCheckOption {
|
|
|
272
276
|
|
|
273
277
|
declare type RequiredByKey<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
274
278
|
|
|
279
|
+
declare type Segments = {
|
|
280
|
+
start: number;
|
|
281
|
+
end: number;
|
|
282
|
+
};
|
|
283
|
+
|
|
275
284
|
declare function splitToSentences(text: string, languageCode?: LanguageCode): string[];
|
|
276
285
|
|
|
277
286
|
declare function srtToAimSegments(text: string): Promise<AimSegments[]>;
|
|
@@ -359,7 +368,8 @@ export declare namespace utils {
|
|
|
359
368
|
containsCJKCharacters,
|
|
360
369
|
languageCodeToName,
|
|
361
370
|
chunkArrayStrings,
|
|
362
|
-
chunkSegmentStringsWithIndex
|
|
371
|
+
chunkSegmentStringsWithIndex,
|
|
372
|
+
consolidateSegments
|
|
363
373
|
}
|
|
364
374
|
}
|
|
365
375
|
|