Skip to main content

sliding_window

Function sliding_window 

Source
pub fn sliding_window(seq: &str, width: usize) -> IsccResult<Vec<String>>
Expand description

Generate sliding window n-grams from a string.

Returns overlapping substrings of width Unicode characters, advancing by one character at a time. If the input is shorter than width, returns a single element containing the full input.

Returns Err(IsccError::InvalidInput) if width < 2.