#trie #prefix-tree #retrieval-tree #digital-tree

lr_trie

Left-Right trie is trie capable of mapping any string to any string

18 stable releases

new 3.1.0 Mar 9, 2025
3.0.1 Mar 9, 2025
2.0.1 Mar 3, 2025
1.5.0 Feb 25, 2025
1.3.0 Jul 28, 2024

#1121 in Data structures

Download history 71/week @ 2024-12-09 48/week @ 2024-12-16 37/week @ 2025-02-10 72/week @ 2025-02-17 134/week @ 2025-02-24 474/week @ 2025-03-03

725 downloads per month

MIT license

55KB
1.5K SLoC

Left-Right Trie

Left-Right trie is trie that allows mapping of any string to any string with complexity based on alphabet used size.

let mut trie = LrTrie::new();
let one = KeyEntry::new("emoción").unwrap();
let another = KeyEntry::new("emotion").unwrap();

trie.insert(&one, &another);
assert!(trie.member(&one, LeftRight::Left).is_some());
assert!(trie.member(&another, LeftRight::Left).is_none());
assert!(trie.member(&another, LeftRight::Right).is_some());

lib.rs:

To reduce memory demands of LrTrie, operations are not particularly optimal. If alphabet used became wide enough, some rework using e.g. hashmap would be needed.

No runtime deps