MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / search

Method search

21-async/mojifinder/charindex.py:61–66  ·  view source on GitHub ↗
(self, query: str)

Source from the content-addressed store, hash-verified

59 self.entries = entries
60
61 def search(self, query: str) -> set[Char]:
62 if words := list(tokenize(query)):
63 found = self.entries[words[0]]
64 return found.intersection(*(self.entries[w] for w in words[1:]))
65 else:
66 return set()
67
68
69def format_results(chars: set[Char]) -> Iterator[str]:

Callers 1

mainFunction · 0.95

Calls 1

tokenizeFunction · 0.70

Tested by

no test coverage detected