pub struct TextAnalysis<'a> { /* private fields */ }analysis only.Expand description
Analysis results for dialogue text content
Contains extracted plain text, override tag information, and Unicode complexity indicators. Uses zero-copy references where possible.
Implementations§
Source§impl<'a> TextAnalysis<'a>
impl<'a> TextAnalysis<'a>
Sourcepub fn analyze(text: &'a str) -> Result<Self>
pub fn analyze(text: &'a str) -> Result<Self>
Analyze dialogue text content comprehensively
Extracts plain text, parses override tags, and analyzes Unicode complexity. Uses zero-copy references for tag arguments.
§Arguments
text- Original dialogue text with potential override tags
§Returns
Complete text analysis results or parsing error.
§Example
let text = "Hello {\\b1}world{\\b0}!";
let analysis = TextAnalysis::analyze(text)?;
assert_eq!(analysis.plain_text(), "Hello world!");
assert_eq!(analysis.override_tags().len(), 2);§Errors
Returns an error if text parsing fails or contains invalid override tags.
Sourcepub fn analyze_with_registry(
text: &'a str,
registry: Option<&ExtensionRegistry>,
) -> Result<Self>
Available on crate feature plugins only.
pub fn analyze_with_registry( text: &'a str, registry: Option<&ExtensionRegistry>, ) -> Result<Self>
plugins only.Analyze dialogue text content with extension registry support
Same as analyze but allows custom tag handlers via registry.
Unhandled tags fall back to standard processing.
§Arguments
text- Original dialogue text with potential override tagsregistry- Optional registry for custom tag handlers
§Returns
Complete text analysis results or parsing error.
§Errors
Returns an error if text parsing fails or contains invalid override tags.
Sourcepub fn plain_text(&self) -> &str
pub fn plain_text(&self) -> &str
Get plain text without override tags
Sourcepub const fn char_count(&self) -> usize
pub const fn char_count(&self) -> usize
Get Unicode character count
Sourcepub const fn line_count(&self) -> usize
pub const fn line_count(&self) -> usize
Get line count after processing linebreaks
Sourcepub const fn has_bidi_text(&self) -> bool
pub const fn has_bidi_text(&self) -> bool
Check if text contains bidirectional content
Sourcepub const fn has_complex_unicode(&self) -> bool
pub const fn has_complex_unicode(&self) -> bool
Check if text contains complex Unicode beyond basic Latin
Get parsed override tags
Sourcepub fn diagnostics(&self) -> &[TagDiagnostic<'a>]
pub fn diagnostics(&self) -> &[TagDiagnostic<'a>]
Get parse diagnostics collected during analysis
Trait Implementations§
Source§impl<'a> Clone for TextAnalysis<'a>
impl<'a> Clone for TextAnalysis<'a>
Source§fn clone(&self) -> TextAnalysis<'a>
fn clone(&self) -> TextAnalysis<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more