ai insight rework #1
This commit is contained in:
1 parent
0d960c8153
commit
9d76f54d33
13 files changed
+730
-299
No files matched your search
@@ -16,7 +16,12 @@ def classify_chunk_tipe(text: str) -> str:
|
||||
lines = [ln.strip() for ln in (text or "").splitlines() if ln.strip()]
|
||||
if not lines:
|
||||
return "prosa"
|
||||
numeric = sum(1 for ln in lines if _NUMERIC_PIPE_ROW.match(ln))
|
||||
numeric = sum(
|
||||
1
|
||||
for ln in lines
|
||||
if _NUMERIC_PIPE_ROW.match(ln)
|
||||
or (ln.startswith("|") and ln.endswith("|") and ln.count("|") > 1)
|
||||
)
|
||||
if numeric >= max(2, len(lines) // 2):
|
||||
return "tabel"
|
||||
return "prosa"
|
||||
|
||||
Reference in new issue
Block a user