|
|
@@ -200,15 +200,15 @@ class MinerUPaddleOCRMerger:
|
|
|
(匹配的文字框信息, 新的指针位置)
|
|
|
"""
|
|
|
target_text = self._normalize_text(target_text)
|
|
|
-
|
|
|
- # 在窗口范围内查找
|
|
|
+
|
|
|
+ # 在窗口范围内查找, 窗口是start_index往回移动窗口的1/3到start_index + look_ahead_window
|
|
|
+ search_start = max(0, int(start_index - self.look_ahead_window/3))
|
|
|
search_end = min(start_index + self.look_ahead_window, len(text_boxes))
|
|
|
|
|
|
best_match = None
|
|
|
best_index = start_index
|
|
|
- best_similarity = 0
|
|
|
|
|
|
- for i in range(start_index, search_end):
|
|
|
+ for i in range(search_start, search_end):
|
|
|
if text_boxes[i]['used']:
|
|
|
continue
|
|
|
|