collections.doctest 359 B

1234567891011121314151617181920
  1. .. Copyright (C) 2001-2019 NLTK Project
  2. .. For license information, see LICENSE.TXT
  3. ===========
  4. Collections
  5. ===========
  6. >>> import nltk
  7. >>> from nltk.collections import *
  8. Trie
  9. ----
  10. Trie can be pickled:
  11. >>> import pickle
  12. >>> trie = nltk.collections.Trie(['a'])
  13. >>> s = pickle.dumps(trie)
  14. >>> pickle.loads(s)
  15. {'a': {True: None}}