Adding upstream version 11.7.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
b4e0e3422e
commit
82a8846a46
144 changed files with 44104 additions and 39367 deletions
|
@ -3,7 +3,7 @@ import typing as t
|
|||
key = t.Sequence[t.Hashable]
|
||||
|
||||
|
||||
def new_trie(keywords: t.Iterable[key]) -> t.Dict:
|
||||
def new_trie(keywords: t.Iterable[key], trie: t.Optional[t.Dict] = None) -> t.Dict:
|
||||
"""
|
||||
Creates a new trie out of a collection of keywords.
|
||||
|
||||
|
@ -16,11 +16,12 @@ def new_trie(keywords: t.Iterable[key]) -> t.Dict:
|
|||
|
||||
Args:
|
||||
keywords: the keywords to create the trie from.
|
||||
trie: a trie to mutate instead of creating a new one
|
||||
|
||||
Returns:
|
||||
The trie corresponding to `keywords`.
|
||||
"""
|
||||
trie: t.Dict = {}
|
||||
trie = {} if trie is None else trie
|
||||
|
||||
for key in keywords:
|
||||
current = trie
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue