String algorithm for fun! Detailed information can be found on my blogger MuTuX.
st = SuffixTrie("abcefdgacematabce")
a = "efdg"
b = "efg"
c = "atabce"
d = "abc"
print "hasSubstring - " + a + ": " + str(st.hasSubstring(a))
print "hasSubstring - " + b + ": " + str(st.hasSubstring(b))
print "hasSuffix - " + c + ": " + str(st.hasSuffix(c))
print "hasSuffix - " + d + ": " + str(st.hasSuffix(d))
Have fun!