Skip to content

Commit

Permalink
GH-485: update dictionary app (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 authored Sep 12, 2021
1 parent 49a680f commit 6b1acfe
Show file tree
Hide file tree
Showing 13 changed files with 9,681 additions and 22 deletions.
21 changes: 0 additions & 21 deletions apps/col_add_entry.py

This file was deleted.

45 changes: 45 additions & 0 deletions apps/col_dictionary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import os
from os.path import join

import streamlit as st
import streamlit.components.v1 as components

st.set_page_config(
page_title="Dictionary App",
layout="wide",
)

json_viewer_build_dir = join(
os.path.dirname(os.path.abspath(__file__)),
"components", "json_viewer", "component", "frontend", "build"
)
json_viewer = components.declare_component(
"json_viewer",
path=json_viewer_build_dir
)

# SIDEBAR
add_selectbox = st.sidebar.text_input('Word', value="gà")

# MAIN
st.write('# Dictionary')
st.text_input('Word', key=1, value="gà")
data = [
{
"description": "(Động vật học) Loài chim nuôi (gia cầm) để lấy thịt và trứng, bay kém, mỏ cứng, con trống có cựa và biết gáy.",
"tag": "noun",
"examples": [
"Bán gà ngày gió, bán chó ngày mưa. (tục ngữ)",
"Gà người gáy, gà nhà ta sáng. (tục ngữ)"
]
},
{
"description": "Đánh cuộc riêng trong một ván bài tổ tôm hay tài bàn ngoài số tiền góp chính",
"tag": "verb",
"examples": [
"Gà lần nào cũng thua thì đánh làm gì."
]
}
]

output_data = json_viewer(json_object=data, label=0)
2 changes: 1 addition & 1 deletion apps/components/json_viewer/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import streamlit.components.v1 as components
import streamlit as st

_RELEASE = False
_RELEASE = True

if _RELEASE:
root_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"files": {
"main.js": "./static/js/main.ee7180e8.chunk.js",
"main.js.map": "./static/js/main.ee7180e8.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.723788a6.js",
"runtime-main.js.map": "./static/js/runtime-main.723788a6.js.map",
"static/js/2.5b8594be.chunk.js": "./static/js/2.5b8594be.chunk.js",
"static/js/2.5b8594be.chunk.js.map": "./static/js/2.5b8594be.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.98ae7f8f21e9dfea38c2aa5dcc10e9eb.js": "./precache-manifest.98ae7f8f21e9dfea38c2aa5dcc10e9eb.js",
"service-worker.js": "./service-worker.js",
"static/js/2.5b8594be.chunk.js.LICENSE.txt": "./static/js/2.5b8594be.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.723788a6.js",
"static/js/2.5b8594be.chunk.js",
"static/js/main.ee7180e8.chunk.js"
]
}
Loading

0 comments on commit 6b1acfe

Please sign in to comment.