Available on crate feature
analysis only.Expand description
ASS dialogue event analysis and processing
Provides comprehensive analysis capabilities for ASS dialogue events including timing validation, overlap detection, text analysis, and performance impact assessment. Designed for zero-copy efficiency with lifetime-generic references.
§Features
- Timing Analysis: Overlap detection using O(n log n) sweep-line algorithm
- Text Processing: Override tag parsing and Unicode complexity detection
- Performance Scoring: Animation complexity and rendering impact assessment
- Zero-Copy Design: Minimal allocations via lifetime-generic spans
- Standards Compliance: Full ASS v4+ and libass 0.17.4+ compatibility
§Performance Targets
- Event analysis: <1ms per dialogue event
- Overlap detection: <1ms for 1000 events
- Text parsing: <0.5ms per event text
- Memory usage: ~1.1x input size via zero-copy spans
§Quick Start
use ass_core::analysis::events::{DialogueInfo, find_overlapping_events};
use ass_core::parser::Event;
let event = Event {
start: "0:00:00.00",
end: "0:00:05.00",
text: "Hello {\\b1}world{\\b0}!",
..Default::default()
};
let info = DialogueInfo::analyze(&event)?;
println!("Duration: {}ms", info.duration_ms());
println!("Animation score: {}/10", info.animation_score());
println!("Performance impact: {:?}", info.performance_impact());§Module Organization
dialogue_info- Individual event analysis and timing validationtext_analysis- Text content parsing and Unicode complexity detectionoverlap- Efficient timing overlap detection algorithmsutils- Collection operations like sorting and duration calculations
Re-exports§
pub use dialogue_info::DialogueInfo;pub use dialogue_info::TimingRelation;pub use overlap::count_overlapping_events;pub use overlap::find_overlapping_event_refs;pub use overlap::find_overlapping_events;pub use scoring::calculate_animation_score;pub use scoring::calculate_complexity_score;pub use scoring::get_performance_impact;pub use scoring::PerformanceImpact;pub use tags::calculate_tag_complexity;pub use tags::parse_override_block;pub use tags::DiagnosticKind;pub use tags::OverrideTag;pub use tags::TagDiagnostic;pub use text_analysis::TextAnalysis;pub use utils::calculate_average_duration;pub use utils::calculate_total_duration;pub use utils::count_overlapping_dialogue_events;pub use utils::find_events_in_range;pub use utils::find_overlapping_dialogue_events;pub use utils::sort_events_by_time;
Modules§
- dialogue_
info - Dialogue event analysis and information extraction
- overlap
- Event timing overlap detection using sweep-line algorithm
- scoring
- Complexity scoring algorithms for ASS events
- tags
- Override tag parsing and complexity analysis
- text_
analysis - Text content analysis for ASS dialogue events
- utils
- Utility functions for dialogue event analysis