pub struct AnnotatedText {
pub segments: Vec<TextSegment>,
}Expand description
A collection of TextSegments representing extracted prose from a source file.
This is the primary output of the parser crate. It separates human-readable text from code/markup, enabling LanguageTool to check only the relevant portions while maintaining accurate byte offset mappings back to the original file.
Fields§
§segments: Vec<TextSegment>Ordered segments of text extracted from the source.
Implementations§
Source§impl AnnotatedText
impl AnnotatedText
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Returns all non-markup segment text concatenated.
Use this to get the plain text string that LanguageTool actually checks. Offsets returned by LanguageTool are relative to this string.
Trait Implementations§
Source§impl Clone for AnnotatedText
impl Clone for AnnotatedText
Source§fn clone(&self) -> AnnotatedText
fn clone(&self) -> AnnotatedText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnnotatedText
impl Debug for AnnotatedText
Source§impl From<&str> for AnnotatedText
impl From<&str> for AnnotatedText
Source§impl PartialEq for AnnotatedText
impl PartialEq for AnnotatedText
Source§fn eq(&self, other: &AnnotatedText) -> bool
fn eq(&self, other: &AnnotatedText) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AnnotatedText
Auto Trait Implementations§
impl Freeze for AnnotatedText
impl RefUnwindSafe for AnnotatedText
impl Send for AnnotatedText
impl Sync for AnnotatedText
impl Unpin for AnnotatedText
impl UnsafeUnpin for AnnotatedText
impl UnwindSafe for AnnotatedText
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