diff --git a/Cargo.toml b/Cargo.toml index c2aa36d..0fd2fbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,8 @@ categories = ["compression", "data-structures"] edition = "2021" [dependencies] -louds-rs = "0.6" +# louds-rs = "0.6" +louds-rs = { path = "../louds-rs" } mem_dbg = { version = "0.1.4", optional = true } serde = { version = "1.0", features = ["derive"], optional = true } diff --git a/src/inc_search.rs b/src/inc_search.rs index dc378ae..04a2ea2 100644 --- a/src/inc_search.rs +++ b/src/inc_search.rs @@ -38,7 +38,10 @@ //! //! This means the above code restores the time complexity of _O(m log n)_ for //! the loop. -use crate::map::Trie; +use crate::{ + map::Trie, + try_collect::{TryCollect, TryFromIterator}, +}; use louds_rs::LoudsNodeNum; #[derive(Debug, Clone)] @@ -181,6 +184,18 @@ impl<'a, Label: Ord, Value> IncSearch<'a, Label, Value> { self.trie.value(self.node) } + /// Return the current prefix for this search. + pub fn prefix(&self) -> C + where + C: TryFromIterator, + Label: Clone, + { + let mut v: Vec