kmaurinjones commited on
Commit
4702916
1 Parent(s): f97aee4

Update wordle_functions.py

Browse files
Files changed (1) hide show
  1. wordle_functions.py +4 -4
wordle_functions.py CHANGED
@@ -667,15 +667,15 @@ def wordle_wizard(word_list: list, max_guesses: int = None,
667
  best_of_the_best_1.append(word)
668
 
669
  # only using top ten most frequent prefixes suffixes to bias. After that it the impact is especially negligible
670
- test_starts = get_gram_freq(word_list = word_list, letters_length = 2, position = "start", search = None)[:10]
671
- test_ends = get_gram_freq(word_list = word_list, letters_length = 2, position = "end", search = None)[:10]
672
 
673
- # list of the best words that also have the best suffixes and prefixes
674
  best_of_the_best_2 = []
675
  for start_gram, start_count in test_starts:
676
  for end_gram, end_count in test_ends:
677
  for word in best_of_the_best_1:
678
- if word[:2] == start_gram and word[-2:] == end_gram:
679
  best_of_the_best_2.append(word)
680
 
681
  if len(best_of_the_best_2) > 0:
 
667
  best_of_the_best_1.append(word)
668
 
669
  # only using top ten most frequent prefixes suffixes to bias. After that it the impact is especially negligible
670
+ test_starts = get_gram_freq(word_list = word_list, letters_length = 1, position = "start", search = None)[:10]
671
+ test_ends = get_gram_freq(word_list = word_list, letters_length = 1, position = "end", search = None)[:10]
672
 
673
+ # list of the best words that also have the most frequent starting and ending letters (suffixes and prefixes didn't have an impact)
674
  best_of_the_best_2 = []
675
  for start_gram, start_count in test_starts:
676
  for end_gram, end_count in test_ends:
677
  for word in best_of_the_best_1:
678
+ if word[:1] == start_gram and word[-1:] == end_gram:
679
  best_of_the_best_2.append(word)
680
 
681
  if len(best_of_the_best_2) > 0: