Update app.py
Browse files
app.py
CHANGED
@@ -9,17 +9,18 @@ from bs4 import BeautifulSoup as soup
|
|
9 |
st.markdown("π² Word Games π - Enter two to seven letters to get a high score of as many words as you can of that length. Leave a letter blank to confine word search to a smaller number of letters.")
|
10 |
|
11 |
st.markdown("Letters in Descending Frequency and Proportion in Words")
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
@st.cache # cache download processes so they only execute once with same inputs
|
16 |
def download():
|
17 |
nltk.download('words')
|
18 |
download()
|
19 |
|
20 |
-
|
21 |
[a,b,c,d,e,f,g] = st.columns(7)
|
22 |
-
|
23 |
with a:
|
24 |
first_letter = st.text_input(label="1st",value = 's').lower()
|
25 |
with b:
|
@@ -42,9 +43,18 @@ clue5 = first_letter+second_letter+third_letter+fourth_letter+fifth_letter
|
|
42 |
clue6 = first_letter+second_letter+third_letter+fourth_letter+fifth_letter+sixth_letter
|
43 |
clue7 = first_letter+second_letter+third_letter+fourth_letter+fifth_letter+sixth_letter+seventh_letter
|
44 |
|
|
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
exclusions = st.text_input(label="exclusions")
|
48 |
|
49 |
clue_result2 = []
|
50 |
clue_result3 = []
|
|
|
9 |
st.markdown("π² Word Games π - Enter two to seven letters to get a high score of as many words as you can of that length. Leave a letter blank to confine word search to a smaller number of letters.")
|
10 |
|
11 |
st.markdown("Letters in Descending Frequency and Proportion in Words")
|
12 |
+
|
13 |
+
Vowels = "E, A, I, O, U, Y"
|
14 |
+
Consonants = "R, T, N, S, L, C, D, P, M, H, G, B, F, W, K, V, X, Z, J, Q"
|
15 |
+
st.markdown("Vowels: ", Vowels)
|
16 |
+
st.markdown("Consonants: ", Consonants)
|
17 |
|
18 |
@st.cache # cache download processes so they only execute once with same inputs
|
19 |
def download():
|
20 |
nltk.download('words')
|
21 |
download()
|
22 |
|
|
|
23 |
[a,b,c,d,e,f,g] = st.columns(7)
|
|
|
24 |
with a:
|
25 |
first_letter = st.text_input(label="1st",value = 's').lower()
|
26 |
with b:
|
|
|
43 |
clue6 = first_letter+second_letter+third_letter+fourth_letter+fifth_letter+sixth_letter
|
44 |
clue7 = first_letter+second_letter+third_letter+fourth_letter+fifth_letter+sixth_letter+seventh_letter
|
45 |
|
46 |
+
exclusions = st.text_input(label="exclusions")
|
47 |
|
48 |
+
# Remove remaining choices after exclusions
|
49 |
+
for character in exclusions:
|
50 |
+
if any(c in exclusions):
|
51 |
+
Vowels.replace(c,'')
|
52 |
+
Consonants.replace(c,'')
|
53 |
+
Vowels.replace(' ', '').replace(',','')
|
54 |
+
Consonants.replace(' ', '').replace(',','')
|
55 |
+
st.write("Vowels Remaining = ", (Vowels))
|
56 |
+
st.write("Consonants Remaining = ", (Consonants))
|
57 |
|
|
|
58 |
|
59 |
clue_result2 = []
|
60 |
clue_result3 = []
|