Nazia Nafis commited on
Commit
3511d01
·
1 Parent(s): ed0586b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import nltk
3
+ from nltk.corpus import words
4
+
5
+ st.title("WORDLE Assistant")
6
+ st.image("/home/nn007/Downloads/wordle-1.jpg")
7
+
8
+ @st.cache
9
+ def download():
10
+ nltk.download("words")
11
+ download()
12
+
13
+ five_letters = [word for word in words.words() if len(word)==5]
14
+
15
+ st.markdown("### Inclusion Letters")
16
+ inclusions = st.text_input(label="Type in the letters in green/yellow:")
17
+
18
+ st.markdown("### Exclusion Letters")
19
+ exclusions = st.text_input(label="Type in the letters in grey:")
20
+
21
+ st.markdown("## List of All Possible Words")
22
+ clue_result=[]
23
+ for word in five_letters:
24
+ if all(c in word for c in inclusions)and not any(c in word for c in exclusions):
25
+ clue_result.append(word)
26
+ st.write(clue_result)