pub struct Sentence<'a> {
pub text: &'a str,
pub span: Range<usize>,
pub char_span: Range<usize>,
}Expand description
A sentence extracted from source text.
text is a zero-copy slice of the original input. It includes the
terminating delimiter (if any) and surrounding whitespace — call
.text.trim() to strip those. span and char_span give the byte and
char offsets of the slice in the source string.
Fields§
§text: &'a strZero-copy slice of the source text (includes terminator).
span: Range<usize>Byte offsets [start, end) of this sentence in the source string.
char_span: Range<usize>Unicode scalar-value offsets [start, end) of this sentence.
Trait Implementations§
impl<'a> Eq for Sentence<'a>
impl<'a> StructuralPartialEq for Sentence<'a>
Auto Trait Implementations§
impl<'a> Freeze for Sentence<'a>
impl<'a> RefUnwindSafe for Sentence<'a>
impl<'a> Send for Sentence<'a>
impl<'a> Sync for Sentence<'a>
impl<'a> Unpin for Sentence<'a>
impl<'a> UnsafeUnpin for Sentence<'a>
impl<'a> UnwindSafe for Sentence<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more