|
import streamlit as st |
|
|
|
st.set_page_config( |
|
page_title="Grascii Search", |
|
menu_items={ |
|
"About": """ |
|
Web interface for [grascii](https://github.com/grascii/grascii)'s |
|
search utility |
|
|
|
Image search powered by [gregg-vision-v0.2.1](https://huggingface.co/grascii/gregg-vision-v0.2.1) |
|
""" |
|
}, |
|
) |
|
|
|
import pandas as pd |
|
from search import write_grascii_search, write_reverse_search, write_dictionaries |
|
|
|
pd.options.mode.copy_on_write = True |
|
|
|
if "report_submitted" not in st.session_state: |
|
st.session_state["report_submitted"] = False |
|
|
|
if "grascii" not in st.session_state: |
|
st.session_state["grascii"] = "" |
|
|
|
if "alternatives" not in st.session_state: |
|
st.session_state["alternatives"] = {} |
|
|
|
if "save_image" in st.session_state: |
|
st.session_state["save_image"] = st.session_state["save_image"] |
|
|
|
if st.session_state["report_submitted"]: |
|
st.toast("Thanks for the report!") |
|
st.session_state["report_submitted"] = False |
|
|
|
with st.sidebar: |
|
st.markdown( |
|
""" |
|
# What's New |
|
|
|
:blue-badge[2025-07-15] |
|
|
|
- The preanniversary-phrases dictionary is now available! |
|
- You may select which dictionaries you would like to search. |
|
- To see which dictionary contained each result, hover over the result |
|
table. Click the "eye" icon at the top right of the table and |
|
select "Dictionary". |
|
""" |
|
) |
|
|
|
write_dictionaries() |
|
|
|
tab1, tab2 = st.tabs(["Grascii", "Reverse"]) |
|
|
|
with tab1: |
|
write_grascii_search() |
|
|
|
with tab2: |
|
write_reverse_search() |
|
|