pub struct TokenizationDebugger { /* private fields */ }Expand description
Comprehensive tokenization debugger for analyzing tokenization behavior
Implementations§
Source§impl TokenizationDebugger
impl TokenizationDebugger
Sourcepub fn with_config(config: DebuggerConfig) -> Self
pub fn with_config(config: DebuggerConfig) -> Self
Create debugger with custom configuration
Sourcepub fn add_tokenizer(&mut self, name: String, tokenizer: TokenizerWrapper)
pub fn add_tokenizer(&mut self, name: String, tokenizer: TokenizerWrapper)
Add a tokenizer to the debugger
Sourcepub fn remove_tokenizer(&mut self, name: &str) -> Option<TokenizerWrapper>
pub fn remove_tokenizer(&mut self, name: &str) -> Option<TokenizerWrapper>
Remove a tokenizer from the debugger
Sourcepub fn list_tokenizers(&self) -> Vec<String>
pub fn list_tokenizers(&self) -> Vec<String>
List all available tokenizers
Sourcepub fn debug_text(&mut self, text: &str) -> Result<DebugSession>
pub fn debug_text(&mut self, text: &str) -> Result<DebugSession>
Debug tokenization of input text with all registered tokenizers
Sourcepub fn compare_texts(&mut self, texts: &[String]) -> Result<Vec<DebugSession>>
pub fn compare_texts(&mut self, texts: &[String]) -> Result<Vec<DebugSession>>
Compare tokenization across multiple texts
Sourcepub fn get_history(&self) -> &[DebugSession]
pub fn get_history(&self) -> &[DebugSession]
Get debugging history
Sourcepub fn get_session(&self, session_id: &str) -> Option<&DebugSession>
pub fn get_session(&self, session_id: &str) -> Option<&DebugSession>
Get a specific session by ID
Sourcepub fn generate_report(&self, session_id: &str) -> Result<String>
pub fn generate_report(&self, session_id: &str) -> Result<String>
Generate a detailed debug report
Sourcepub fn generate_html_visualization(&self, session_id: &str) -> Result<String>
pub fn generate_html_visualization(&self, session_id: &str) -> Result<String>
Generate HTML visualization of tokenization
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenizationDebugger
impl RefUnwindSafe for TokenizationDebugger
impl Send for TokenizationDebugger
impl Sync for TokenizationDebugger
impl Unpin for TokenizationDebugger
impl UnsafeUnpin for TokenizationDebugger
impl UnwindSafe for TokenizationDebugger
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more