From c92d334b29fcbf318610f497c28749d85c608eae Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 25 Jul 2024 14:30:58 +0800 Subject: [PATCH] fix bug of regx (#1703) ### What problem does this PR solve? #1689 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/nlp/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/nlp/__init__.py b/rag/nlp/__init__.py index 349354cea..e620225dc 100644 --- a/rag/nlp/__init__.py +++ b/rag/nlp/__init__.py @@ -344,7 +344,7 @@ def make_colon_as_title(sections): if txt[-1] not in "::": continue txt = txt[::-1] - arr = re.split(r"([。?!!?;;]| .)", txt) + arr = re.split(r"([。?!!?;;]| \.)", txt) if len(arr) < 2 or len(arr[1]) < 32: continue sections.insert(i - 1, (arr[0][::-1], "title"))