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

Function main

21-async/mojifinder/charindex.py:76–84  ·  view source on GitHub ↗
(words: list[str])

Source from the content-addressed store, hash-verified

74
75
76def main(words: list[str]) -> None:
77 if not words:
78 print('Please give one or more words to search.')
79 sys.exit(2) # command line usage error
80 index = InvertedIndex()
81 chars = index.search(' '.join(words))
82 for line in format_results(chars):
83 print(line)
84 print('─' * 66, f'{len(chars)} found')
85
86
87if __name__ == '__main__':

Callers 1

charindex.pyFile · 0.70

Calls 3

searchMethod · 0.95
InvertedIndexClass · 0.85
format_resultsFunction · 0.85

Tested by

no test coverage detected