suffix_trie

Crates.iosuffix_trie
lib.rssuffix_trie
version0.1.0
sourcesrc
created_at2024-03-29 11:56:28.140766
updated_at2024-03-29 11:56:28.140766
descriptionSuffix trie for searching
homepage
repositoryhttps://github.com/EgorGorshen/suffix-tier
max_upload_size
id1189905
size10,634
Горшенков Егор Павлович (EgorGorshen)

documentation

README

Suffix Trie Library

This Rust library provides a flexible and efficient implementation of a Suffix Trie data structure, ideal for applications involving string searches, autocomplete systems, and other text processing tasks. It supports adding words, searching by prefix, and collecting all suffixes or substrings that match a given prefix.

Features

  • Efficient string insertion and search
  • Support for collecting all suffixes matching a given prefix
  • Ideal for autocomplete systems, text processing, and pattern matching

Installation

Add this to your Cargo.toml:

[dependencies]
suffix_trie = "0.1.0"

Usage

Here's a quick example to get you started:

use suffix_trie::SuffixTrie;

let mut trie = SuffixTrie::new();
trie.add_suffix("hello".to_string());
trie.add_suffix("helium".to_string());

if let Some(suffixes) = trie.find_prefixes("he") {
    for suffix in suffixes {
        println!("{}", suffix);
    }
}

Running Tests

To run tests, use the following command:

cargo test

Contributing

Contributions are welcome! Please feel free to submit pull requests, create issues, or suggest improvements.

source links

TODO

  • None
Commit count: 1

cargo fmt