Skip to content

Panic on quoted text ending with period followed by spaced dots #43

@santhoshtr

Description

@santhoshtr

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'))  # panics

Both 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`[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions