python implementation of suffix tree, which yields a data structure that can allow substring querying finished in O(n), where n is the length of query string.