MCPcopy Create free account
hub / github.com/geekcomputers/Python / add_word

Method add_word

Word_Dictionary/dictionary.py:8–14  ·  view source on GitHub ↗
(self, word: str)

Source from the content-addressed store, hash-verified

6 self.node = {}
7
8 def add_word(self, word: str) -> None:
9 node = self.node
10 for ltr in word:
11 if ltr not in node:
12 node[ltr] = {}
13 node = node[ltr]
14 node["is_word"] = True
15
16 def word_exists(self, word: str) -> bool:
17 node = self.node

Callers 1

dictionary.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected