-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
sentencex.segment() panics with a Rust begin <= end slice index error when the input
contains a straight double-quoted string whose last character before the closing quote is
a period, followed by a space and two or more consecutive dots.
The panic propagates to Python as pyo3_runtime.PanicException (not a Python Exception),
so it cannot be caught by except Exception — only except BaseException.
Minimal reproduction
from sentencex import segment
list(segment("ml", '"." .. a')) # panics
list(segment("en", '"X." .. a')) # panicsBoth lines raise:
pyo3_runtime.PanicException: begin <= end (7 <= 6) when slicing `"." .. a`[...]
Rust stderr:
thread '<unnamed>' panicked at src/languages/language.rs:265:47:
begin <= end (7 <= 6) when slicing `"." .. a`[...]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels