Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/memsearch/chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _emit(content: str, start_line: int, end_line: int) -> None:
# Single line exceeds max_size — split within the line
if len(text) >= max_size and len(current_lines) == 1:
sub_chunks = _split_long_text(text, max_size)
for j, part in enumerate(sub_chunks):
for part in sub_chunks:
_emit(
part.strip(),
base_line + current_start + 1,
Expand Down Expand Up @@ -235,7 +235,7 @@ def _emit(content: str, start_line: int, end_line: int) -> None:


# Sentence-ending punctuation for splitting long text without line breaks.
_SENTENCE_END_RE = re.compile(r"[。!?.!?]\s*")
_SENTENCE_END_RE = re.compile(r"[。\uFF01\uFF1F.!?]\s*")


def _split_long_text(text: str, max_size: int) -> list[str]:
Expand Down
Loading