Spaces:
Sleeping
Sleeping
Update modules/text_processing.py
Browse files
modules/text_processing.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import re
|
| 2 |
from typing import Dict, List, Tuple, Any
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
# ----------------- Regex helpers -----------------
|
| 6 |
LIST_BULLET = re.compile(r"^(?:[-*•・]|\d+\.|\d+\))\s+(.*)")
|
|
@@ -31,7 +32,6 @@ def naive_section_split(text: str, target_chars: int = 1200) -> List[Tuple[str,
|
|
| 31 |
cur_buf.append(ln)
|
| 32 |
if sum(len(x) for x in cur_buf) > target_chars:
|
| 33 |
flush()
|
| 34 |
-
# ★ 修正ポイント:f-string の {} が抜けていた
|
| 35 |
cur_title = f"セクション{len(sections)+1}"
|
| 36 |
flush()
|
| 37 |
|
|
|
|
| 1 |
import re
|
| 2 |
from typing import Dict, List, Tuple, Any
|
| 3 |
+
# ★ 相対ではなく絶対(modules 配下直読み)に変更
|
| 4 |
+
from llm import LLMClient
|
| 5 |
|
| 6 |
# ----------------- Regex helpers -----------------
|
| 7 |
LIST_BULLET = re.compile(r"^(?:[-*•・]|\d+\.|\d+\))\s+(.*)")
|
|
|
|
| 32 |
cur_buf.append(ln)
|
| 33 |
if sum(len(x) for x in cur_buf) > target_chars:
|
| 34 |
flush()
|
|
|
|
| 35 |
cur_title = f"セクション{len(sections)+1}"
|
| 36 |
flush()
|
| 37 |
|