Skip to main content

exact

Function exact 

Source
pub fn exact<M: MessageLike>(messages: &[M], config: Config) -> Exact
Expand description

Create an exact copy-forward compressor.

Uses binary search extension to find optimal substring matches. Perfect compression but slower than approximate() for large texts.

Supports both regular string slices and optional strings for handling missing values:

use copyforward::{exact, Config, CopyForward};

// Regular usage
let messages = &["Hello world", "Hello world today"];
let compressed = exact(messages, Config::default());

// With None values (for dataframes)
let messages_with_none = &[Some("Hello"), None, Some("World")];
let compressed = exact(messages_with_none, Config::default());