Initial commit

This commit is contained in:
2026-02-01 09:31:38 +01:00
commit e02db93960
4396 changed files with 1511612 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
.. Copyright (C) 2001-2025 NLTK Project
.. For license information, see LICENSE.TXT
===========
Collections
===========
>>> import nltk
>>> from nltk.collections import *
Trie
----
Trie can be pickled:
>>> import pickle
>>> trie = nltk.collections.Trie(['a'])
>>> s = pickle.dumps(trie)
>>> pickle.loads(s)
{'a': {True: None}}
LazyIteratorList
----------------
Fetching the length of a LazyIteratorList object does not throw a StopIteration exception:
>>> lil = LazyIteratorList(i for i in range(1, 11))
>>> lil[-1]
10
>>> len(lil)
10