File size: 953 Bytes
3511d01
70e24c8
3511d01
 
 
0ed3a59
cd7ced9
 
3511d01
dba7e51
3511d01
 
 
 
 
 
 
 
 
 
 
 
c9763ce
60e0180
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st
import nltk
from nltk.corpus import words

st.title("WORDLE Assistant")
st.image("wordle-1.jpg")
url = "https://medium.com/nerd-for-tech/i-made-this-app-to-help-you-get-unstuck-at-wordle-7d8d9f145dd7"
st.write("For more on how to use this app, check out [this link](%s)" % url)

@st.cache_data 
def download():
    nltk.download("words")
download()

five_letters = [word for word in words.words() if len(word)==5]

st.markdown("### Inclusion Letters")
inclusions = st.text_input(label="Type in the letters in green/yellow:")

st.markdown("### Exclusion Letters")
exclusions = st.text_input(label="Type in the letters in grey:")

if (len(inclusions) != 0 or len(exclusions) != 0):
    st.markdown("## List of All Possible Words")
    clue_result=[]
    for word in five_letters:
        if all(c in word for c in inclusions)and not any(c in word for c in exclusions):
            clue_result.append(word)
    st.write(clue_result)