@@ -116,6 +116,7 @@ def get_n_guesses(result_hist: dict, n: int = None, corpus: list = minidict) ->
116116 This function filters the given corpus of allowed words using the information
117117 contained in a result history. Each entry in the result history consists of
118118 a guessed word and its corresponding result string, where:
119+
119120 - '0' indicates the letter is not present in the target word,
120121 - '1' indicates the letter is present but in the wrong position, and
121122 - '2' indicates the letter is correct and in the correct position.
@@ -130,22 +131,23 @@ def get_n_guesses(result_hist: dict, n: int = None, corpus: list = minidict) ->
130131 result_hist : dict
131132 A dictionary mapping previously guessed words to their
132133 corresponding result strings composed of '0', '1', and '2'.
133- n : int ( optional)
134+ n : int, optional
134135 The maximum number of valid guesses to return.
135136 If None, all valid guesses are returned.
136- corpus : list ( optional)
137+ corpus : list, optional
137138 A list of all allowed words to consider as possible targets.
138139
139140 Returns
140141 -------
141- list: A list of words from the corpus that are consistent with the result history.
142+ list
143+ A list of words from the corpus that are consistent with the result history.
142144
143145 Raises
144146 ------
145147 TypeError
146- If result_hist is not a dictionary.
147- If n is not a positive integer or None.
148- If corpus is not a list of strings.
148+ If result_hist is not a dictionary;
149+ if n is not a positive integer or None; or
150+ if corpus is not a list of strings.
149151 ValueError
150152 If result_hist is internally inconsistent.
151153
@@ -158,7 +160,6 @@ def get_n_guesses(result_hist: dict, n: int = None, corpus: list = minidict) ->
158160 >>> result_hist = {"crane": "01200", "sloth": "10020"}
159161 >>> get_n_guesses(result_hist, corpus=corpus)
160162 ['about', 'shout', 'mount']
161-
162163 >>> get_n_guesses(result_hist, n=2, corpus=corpus)
163164 ['shout', 'mount']
164165 """
0 commit comments