Skip to content

Commit

Permalink
added docs to lib
Browse files Browse the repository at this point in the history
  • Loading branch information
sriram98v committed Sep 27, 2023
1 parent c19ec7a commit 2fdaf0e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path = "src/bin/bin.rs"

[package]
name = "kgst"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
path = "src/lib.rs"
authors = ["Sriram Vijendran <[email protected]>"]
Expand Down
28 changes: 28 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//! # K-Truncated Generalized Suffix Tree
//! Implementation of the [truncated suffix tree](https://pubmed.ncbi.nlm.nih.gov/18283030/)
//! construction of which is performed in linear time
//!
//! ## Examples
//!
//! ```
//! use generalized_suffix_tree::suffix_tree::KGST;
//!
//! // Initalize empty tree
//! let mut tree: KGST<char, String> = KGST::new('$');
//!
//! // insert item with corresponding item id
//! let item_string:Vec<char> = "MKAILVVLLYTFTTADADTLCIGYHANNSTDTVDTVLEKNVTVTHSVNLLENRHNGKLCKLRGVAPLHLGKCNIAGWILGNPECESLSTAGSWSYIVETSNPDNGTCYPGDFINYEELREQLSSVSSFEKFEIFPKTSSWPNHDTNRGVTAACPHDGAKSFYRNLLWLVKKEKENSYPMINKSYTNNKGKEVLVLWAIHHPATSADQQSLYQNANAYVFVGSSKYSKKFEPEIAARPKVRDQAGRMKYYWTLVEPGDKITFEATGNLVVPIYAFALKRNSGSGIIISDTSVHDCDTTCQTPNGAINTSLPFQNIHPVTIGECPKYVKSTKLRMATGLRNIPSIQSRGLFGAIAGFIEGGWTGMIDGWYGYHHQNEQGSGYAADLKSTQNAIDGITNKVNSVIEKMNTQFTAVGKEFNHLERRIENLNKKVDDGFLDIWTYNAELLVLLENERTLDYHDSNVKNLYEKVRSQLKNNAKEIGNGCFEFYHKCDDTCMESVKNGTYDYPKYSEEAKLNREEIDGVKLESTRIYQILAIYSTVASSLVLVVSLGAISFWMCSNGSLQCRICI".chars().collect();
//! let item_id:String = "World".to_string();
//! tree.insert(item_id.clone(), item_string.clone(),&0);
//!
//!
//! // Query if some string is a substring in the tree
//! let substring_match = tree.substring_match(&item_string[i..i+max_depth+1]);
//!
//! // Query if some string is a suffix in the tree
//! let suffix_match = tree.suffix_match(&item_string[i..i+max_depth+1]);
//!
//! // Clear tree
//! tree.clear();
//! ```
pub mod suffix_node;
pub mod suffix_tree;
pub mod tree_item;

0 comments on commit 2fdaf0e

Please sign in to comment.