Extend algorithm to Generalized suffix tree.