From 707e65b01773ba0d46490ec4f6a523cd03503ae7 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 4 Feb 2026 17:35:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(annotation):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=9C=8D=E5=8A=A1=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=88=86=E6=AE=B5=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在处理分段注释时初始化 segments 列表变量 - 确保分段信息列表在函数开始时被正确初始化 - 提高代码可读性和变量声明的一致性 --- runtime/datamate-python/app/module/annotation/service/editor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/datamate-python/app/module/annotation/service/editor.py b/runtime/datamate-python/app/module/annotation/service/editor.py index 26fb4a6..1c6fda4 100644 --- a/runtime/datamate-python/app/module/annotation/service/editor.py +++ b/runtime/datamate-python/app/module/annotation/service/editor.py @@ -546,6 +546,7 @@ class AnnotationEditorService: segment_annotation_keys: set[str], ) -> Tuple[List[SegmentInfo], List[Tuple[Optional[Dict[str, Any]], str, str, int, int]]]: splitter = AnnotationTextSplitter(max_chars=self.SEGMENT_THRESHOLD) + segments: List[SegmentInfo] = [] segment_contexts: List[Tuple[Optional[Dict[str, Any]], str, str, int, int]] = [] segment_cursor = 0