MCPcopy
hub / github.com/TheAlgorithms/Python / load_dictionary

Function load_dictionary

strings/detecting_english_programmatically.py:7–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def load_dictionary() -> dict[str, None]:
8 path = os.path.split(os.path.realpath(__file__))
9 english_words: dict[str, None] = {}
10 with open(path[0] + "/dictionary.txt") as dictionary_file:
11 for word in dictionary_file.read().split("\n"):
12 english_words[word] = None
13 return english_words
14
15
16ENGLISH_WORDS = load_dictionary()

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected