|
|
@@ -305,6 +305,7 @@ public class GraphNerService {
|
|
|
// 如果已经有页码和行号,直接返回
|
|
|
if (posMap.containsKey("page") && posMap.get("page") != null
|
|
|
&& posMap.containsKey("line") && posMap.get("line") != null) {
|
|
|
+ log.debug("位置信息已完整,跳过映射: documentId={}", documentId);
|
|
|
return posMap;
|
|
|
}
|
|
|
|
|
|
@@ -313,11 +314,13 @@ public class GraphNerService {
|
|
|
Integer charEnd = getIntValue(posMap, "charEnd");
|
|
|
|
|
|
if (charStart == null || charEnd == null) {
|
|
|
+ log.debug("缺少字符位置信息,跳过映射: documentId={}, posMap={}", documentId, posMap);
|
|
|
return posMap;
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
// 使用 PositionMappingService 映射页码和行号
|
|
|
+ log.debug("开始位置映射: documentId={}, charStart={}, charEnd={}", documentId, charStart, charEnd);
|
|
|
Map<String, Object> mappedPosition = positionMappingService.mapCharToPosition(
|
|
|
documentId, charStart, charEnd);
|
|
|
|
|
|
@@ -325,6 +328,7 @@ public class GraphNerService {
|
|
|
Map<String, Object> enrichedPosition = new HashMap<>(posMap);
|
|
|
enrichedPosition.putAll(mappedPosition);
|
|
|
|
|
|
+ log.debug("位置映射完成: documentId={}, result={}", documentId, enrichedPosition);
|
|
|
return enrichedPosition;
|
|
|
} catch (Exception e) {
|
|
|
log.warn("位置映射失败: documentId={}, charStart={}, charEnd={}, error={}",
|