Update pipeline/postprocess.py
Browse files- pipeline/postprocess.py +2 -2
pipeline/postprocess.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
MIN_DISPLAY = 2.5
|
| 4 |
MAX_DISPLAY = 7.0
|
| 5 |
MERGE_MAX_CHARS = 72
|
| 6 |
-
SPLIT_MAX_CHARS =
|
| 7 |
MAX_GAP = 1.5
|
| 8 |
|
| 9 |
|
|
@@ -112,7 +112,7 @@ def split_long_segment(seg: dict, depth: int = 0) -> list:
|
|
| 112 |
text = seg["text"].strip()
|
| 113 |
|
| 114 |
# حداکثر ۲ بار split — جلوگیری از تک کلمه شدن
|
| 115 |
-
if depth >=
|
| 116 |
return [seg]
|
| 117 |
|
| 118 |
best_idx = len(words) // 2
|
|
|
|
| 3 |
MIN_DISPLAY = 2.5
|
| 4 |
MAX_DISPLAY = 7.0
|
| 5 |
MERGE_MAX_CHARS = 72
|
| 6 |
+
SPLIT_MAX_CHARS = 100
|
| 7 |
MAX_GAP = 1.5
|
| 8 |
|
| 9 |
|
|
|
|
| 112 |
text = seg["text"].strip()
|
| 113 |
|
| 114 |
# حداکثر ۲ بار split — جلوگیری از تک کلمه شدن
|
| 115 |
+
if depth >= 1 or len(text) <= SPLIT_MAX_CHARS or len(words) < 8:
|
| 116 |
return [seg]
|
| 117 |
|
| 118 |
best_idx = len(words) // 2
|