Cleanups
This commit is contained in:
@@ -55,7 +55,7 @@ class DictionaryProvider:
|
|||||||
l = []
|
l = []
|
||||||
if not filter_fun:
|
if not filter_fun:
|
||||||
filter_fun = lambda s: True
|
filter_fun = lambda s: True
|
||||||
with open("/home/max/Desktop/clean-words-5.txt") as d:
|
with open("/usr/share/dict/words") as d:
|
||||||
return [
|
return [
|
||||||
word
|
word
|
||||||
for word in filter(filter_fun, map(lambda w: w.strip(), d.readlines()))
|
for word in filter(filter_fun, map(lambda w: w.strip(), d.readlines()))
|
||||||
@@ -66,9 +66,8 @@ class DictionaryProvider:
|
|||||||
return (
|
return (
|
||||||
len(word) == length
|
len(word) == length
|
||||||
and all(map(lambda x: x in string.ascii_lowercase, word))
|
and all(map(lambda x: x in string.ascii_lowercase, word))
|
||||||
and not all(map(lambda c: c in "xiv", word))
|
and not all(map(lambda c: c in "xiv", word)) # hack to remove some roman numerals
|
||||||
# and (word.startswith("s") or word.startswith("z"))
|
)
|
||||||
) # hack to remove some roman numerals
|
|
||||||
|
|
||||||
return f
|
return f
|
||||||
|
|
||||||
@@ -109,7 +108,6 @@ class WordleRemainingWordsStateEvaluator:
|
|||||||
Get a score for the given word state
|
Get a score for the given word state
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Score values are totally arbitrary. This will be improved in the future based on the remaining selections
|
|
||||||
return -sum([1 for word in self.dictionary if self.word_playable.is_word_playable(state, word)])
|
return -sum([1 for word in self.dictionary if self.word_playable.is_word_playable(state, word)])
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
Reference in New Issue
Block a user