mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-31 04:59:24 +08:00
Fix tag CSV parser ignoring the documented TAB delimiter (#17496)
This commit is contained in:
@@ -92,11 +92,12 @@ def chunk(filename, binary=None, lang="Chinese", callback=None, **kwargs):
|
||||
callback(0.1, "Start to parse.")
|
||||
txt = get_text(filename, binary)
|
||||
lines = txt.split("\n")
|
||||
delimiter = "\t" if any("\t" in line for line in lines) else ","
|
||||
|
||||
fails = []
|
||||
content = ""
|
||||
res = []
|
||||
reader = csv.reader((line + "\n" for line in lines))
|
||||
reader = csv.reader((line + "\n" for line in lines), delimiter=delimiter)
|
||||
prev_line_num = 0
|
||||
|
||||
# line_num tracks the physical span when quoted fields cross lines.
|
||||
|
||||
Reference in New Issue
Block a user