From 77f0fb03e3f44273ea4b6dcc2f807ccf3bec3823 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Tue, 13 Aug 2024 11:42:38 +0800 Subject: [PATCH] fix parameter error (#1925) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- deepdoc/parser/txt_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepdoc/parser/txt_parser.py b/deepdoc/parser/txt_parser.py index bb61005f4..8a322a128 100644 --- a/deepdoc/parser/txt_parser.py +++ b/deepdoc/parser/txt_parser.py @@ -15,7 +15,7 @@ from rag.nlp import find_codec,num_tokens_from_string import re class RAGFlowTxtParser: - def __call__(self, fnm, binary=None, chunk_token_num=128): + def __call__(self, fnm, binary=None, chunk_token_num=128, delimiter="\n!?;。;!?"): txt = "" if binary: encoding = find_codec(binary) @@ -27,7 +27,7 @@ class RAGFlowTxtParser: if not l: break txt += l - return self.parser_txt(txt, chunk_token_num) + return self.parser_txt(txt, chunk_token_num, delimiter) @classmethod def parser_txt(cls, txt, chunk_token_num=128, delimiter="\n!?;。;!?"):