Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 472 Bytes

automaton_clear.rst

File metadata and controls

23 lines (19 loc) · 472 Bytes

clear()

Remove all keys from the trie. This method invalidates all iterators.

Examples

>>> import ahocorasick
>>> A = ahocorasick.Automaton()
>>> A.add_word("cat", 1)
True
>>> A.add_word("dog", 2)
True
>>> A.add_word("elephant", 3)
True
>>> len(A)
3
>>> A.clear()
>>> len(A)
0