StrTree¶
Treats a string as a tree.
-
class
cpip.util.StrTree.
StrTree
(theIterable=None)¶ Initialise the class with a optional list of strings.
-
add
(s)¶ Add a string.
-
has
(s, i=0)¶ Returns the index of the end of s that match a complete word in the tree. i.e. [i:return_value] is in the dictionary. Note IndexError and KeyError are trapped here.
-
values
()¶ Returns all values.
-