[][src]Struct generalized_suffix_tree::GeneralizedSuffixTree

pub struct GeneralizedSuffixTree { /* fields omitted */ }

This is the generalized suffix tree, implemented using Ukkonen's Algorithm. One important modification to the algorithm is that this is no longer an online algorithm, i.e. it only accepts strings fully provided to the suffix tree, instead of being able to stream processing each string. It is not a fundamental limitation and can be supported.

Examples

use generalized_suffix_tree::GeneralizedSuffixTree;
let mut tree = GeneralizedSuffixTree::new();
tree.add_string(String::from("abcdabce"));
tree.add_string(String::from("cdefdefg"));
println!("{}", tree.is_suffix("bce"));

Methods

impl GeneralizedSuffixTree[src]

pub fn new() -> GeneralizedSuffixTree[src]

pub fn add_string(&mut self, s: String)[src]

Add a new string to the generalized suffix tree.

pub fn longest_common_substring(&self) -> String[src]

Find the longest common substring among all strings in the suffix.

pub fn is_suffix(&self, s: &str) -> bool[src]

Checks whether a given string s is a suffix in the suffix tree.

pub fn is_substr(&self, s: &str) -> bool[src]

Checks whether a given string s is a substring of any of the strings in the suffix tree.

pub fn pretty_print(&self)[src]

Trait Implementations

impl Debug for GeneralizedSuffixTree[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]