Spaces:
Runtime error
Runtime error
Teddy Xinyuan Chen
commited on
2024-05-10T12-14-51Z
Browse files
app.py
CHANGED
|
@@ -3,6 +3,16 @@
|
|
| 3 |
import gradio as gr
|
| 4 |
from taibun import Converter, to_simplified, to_traditional
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def convert_text(text, system="Tailo", dialect="south", format="mark", sandhi="none"):
|
| 8 |
# Create a converter object with selected options
|
|
@@ -44,6 +54,7 @@ interface = gr.Interface(
|
|
| 44 |
],
|
| 45 |
title="Hokkien Transliteration Converter",
|
| 46 |
description="Convert Hokkien text between various transliteration systems using the <a href='https://github.com/andreihar/taibun' target='_blank'>taibun</a> package. Made by <a href='https://teddysc.me'>Teddy</a>.",
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
# Launch the app
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
from taibun import Converter, to_simplified, to_traditional
|
| 5 |
|
| 6 |
+
# List of example texts
|
| 7 |
+
# source: https://github.com/andreihar/taibun
|
| 8 |
+
examples = [
|
| 9 |
+
("先生講,學生恬恬聽。", "Tailo", "south", "mark", "none"),
|
| 10 |
+
("我欲用箸食魚", "POJ", "north", "number", "auto"),
|
| 11 |
+
("生日快樂", "Zhuyin", "south", "strip", "exc_last"),
|
| 12 |
+
("太空朋友,恁好!恁食飽未?", "Pingyim", "north", "mark", "incl_last"),
|
| 13 |
+
("這是台灣囡仔", "Tongiong", "south", "number", "none"),
|
| 14 |
+
]
|
| 15 |
+
|
| 16 |
|
| 17 |
def convert_text(text, system="Tailo", dialect="south", format="mark", sandhi="none"):
|
| 18 |
# Create a converter object with selected options
|
|
|
|
| 54 |
],
|
| 55 |
title="Hokkien Transliteration Converter",
|
| 56 |
description="Convert Hokkien text between various transliteration systems using the <a href='https://github.com/andreihar/taibun' target='_blank'>taibun</a> package. Made by <a href='https://teddysc.me'>Teddy</a>.",
|
| 57 |
+
examples=examples,
|
| 58 |
)
|
| 59 |
|
| 60 |
# Launch the app
|