From 2c551cb5dbd0712cc9c1183f106a3bd40d528f94 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 4 Sep 2025 18:51:57 +0800 Subject: [PATCH] Add support for Chinese book title marks in normalize_extracted_info --- lightrag/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lightrag/utils.py b/lightrag/utils.py index c696c110..e697de8a 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -1896,6 +1896,12 @@ def normalize_extracted_info(name: str, remove_inner_quotes=False) -> str: if "‘" not in inner_content and "’" not in inner_content: name = inner_content + # Handle Chinese-style book title mark + if name.startswith("《") and name.endswith("》"): + inner_content = name[1:-1] + if "《" not in inner_content and "》" not in inner_content: + name = inner_content + if remove_inner_quotes: # Remove Chinese quotes name = name.replace("“", "").replace("”", "").replace("‘", "").replace("’", "")