kambris commited on
Commit
9ad6024
ยท
verified ยท
1 Parent(s): 7f4af18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -33
app.py CHANGED
@@ -81,6 +81,38 @@ with gr.Blocks(title="Arabic Transliterator") as demo:
81
  gr.Markdown("## ๐Ÿ“ Latin-to-Arabic Transliterator with Text-to-Speech")
82
  gr.Markdown("Enter Latin characters to convert to Arabic script. Use combinations like 'th', 'kh', 'sh', 'gh' for special sounds.")
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  with gr.Row():
85
  with gr.Column():
86
  latin_input = gr.Textbox(
@@ -88,38 +120,6 @@ with gr.Blocks(title="Arabic Transliterator") as demo:
88
  lines=3,
89
  placeholder="Example: ahlan wa sahlan (ุฃู‡ู„ุง ูˆุณู‡ู„ุง)"
90
  )
91
-
92
- # Add transliteration guide
93
- with gr.Accordion("๐Ÿ“– Transliteration Guide", open=False):
94
- gr.Markdown("""
95
- ### Two-Character Combinations:
96
- `th` โ†’ ุซ, `kh` โ†’ ุฎ, `dh` โ†’ ุฐ, `sh` โ†’ ุด, `gh` โ†’ ุบ
97
- `aa` โ†’ ุข, `ee` โ†’ ูŠ, `oo` โ†’ ูˆ, `uu` โ†’ ูˆ, `ii` โ†’ ูŠ
98
-
99
- ### Single Characters:
100
- **Consonants:**
101
- `a` โ†’ ุง, `b` โ†’ ุจ, `t` โ†’ ุช, `j` โ†’ ุฌ, `H` โ†’ ุญ, `d` โ†’ ุฏ, `r` โ†’ ุฑ, `z` โ†’ ุฒ, `s` โ†’ ุณ
102
- `S` โ†’ ุต, `D` โ†’ ุถ, `T` โ†’ ุท, `Z` โ†’ ุธ, `'` โ†’ ุน, `f` โ†’ ู, `q` โ†’ ู‚, `k` โ†’ ูƒ
103
- `l` โ†’ ู„, `m` โ†’ ู…, `n` โ†’ ู†, `h` โ†’ ู‡, `w` โ†’ ูˆ, `y` โ†’ ูŠ, `x` โ†’ ุก
104
-
105
- **Initial Vowels (Word Beginnings):**
106
- `o` โ†’ ุฃู, `i` โ†’ ุฅู, `u` โ†’ ุฃู, `e` โ†’ ุฃ
107
-
108
- **Short Vowels (Diacritics):**
109
- `I` โ†’ ู (Kasra), `U` โ†’ ู (Damma), `A` โ†’ ูŽ (Fatha), `~` โ†’ ู‘ (Shadda), `^` โ†’ ู’ (Sukun)
110
-
111
- **Tanween (Double Diacritics):**
112
- `an` โ†’ ู‹ (Fathatan), `un` โ†’ ูŒ (Dammatan), `in` โ†’ ู (Kasratan)
113
-
114
- **Tips:**
115
- - Use capital letters for emphatic consonants (S, D, T, Z, H)
116
- - Use capital vowels (I, U, A) for diacritics/short vowels
117
- - Use 'an', 'un', 'in' for tanween (double diacritics)
118
- - Combinations like 'th', 'kh' are processed before single letters
119
- - Use apostrophe (') for the letter ุน (ayn)
120
- - Use 'x' for hamza ุก when standalone
121
- - Use ~ for shadda (gemination) and ^ for sukun (no vowel)
122
- """)
123
 
124
  with gr.Column():
125
  arabic_output = gr.Textbox(
@@ -155,6 +155,5 @@ with gr.Blocks(title="Arabic Transliterator") as demo:
155
  )
156
 
157
 
158
-
159
  if __name__ == "__main__":
160
  demo.launch()
 
81
  gr.Markdown("## ๐Ÿ“ Latin-to-Arabic Transliterator with Text-to-Speech")
82
  gr.Markdown("Enter Latin characters to convert to Arabic script. Use combinations like 'th', 'kh', 'sh', 'gh' for special sounds.")
83
 
84
+ # Full-width transliteration guide
85
+ with gr.Accordion("๐Ÿ“– Transliteration Guide", open=False):
86
+ gr.Markdown("""
87
+ ### Two-Character Combinations:
88
+ `th` โ†’ ุซ, `kh` โ†’ ุฎ, `dh` โ†’ ุฐ, `sh` โ†’ ุด, `gh` โ†’ ุบ
89
+ `aa` โ†’ ุข, `ee` โ†’ ูŠ, `oo` โ†’ ูˆ, `uu` โ†’ ูˆ, `ii` โ†’ ูŠ
90
+
91
+ ### Single Characters:
92
+ **Consonants:**
93
+ `a` โ†’ ุง, `b` โ†’ ุจ, `t` โ†’ ุช, `j` โ†’ ุฌ, `H` โ†’ ุญ, `d` โ†’ ุฏ, `r` โ†’ ุฑ, `z` โ†’ ุฒ, `s` โ†’ ุณ
94
+ `S` โ†’ ุต, `D` โ†’ ุถ, `T` โ†’ ุท, `Z` โ†’ ุธ, `'` โ†’ ุน, `f` โ†’ ู, `q` โ†’ ู‚, `k` โ†’ ูƒ
95
+ `l` โ†’ ู„, `m` โ†’ ู…, `n` โ†’ ู†, `h` โ†’ ู‡, `w` โ†’ ูˆ, `y` โ†’ ูŠ, `x` โ†’ ุก
96
+
97
+ **Initial Vowels (Word Beginnings):**
98
+ `o` โ†’ ุฃู, `i` โ†’ ุฅู, `u` โ†’ ุฃู, `e` โ†’ ุฃ
99
+
100
+ **Short Vowels (Diacritics):**
101
+ `I` โ†’ ู (Kasra), `U` โ†’ ู (Damma), `A` โ†’ ูŽ (Fatha), `~` โ†’ ู‘ (Shadda), `^` โ†’ ู’ (Sukun)
102
+
103
+ **Tanween (Double Diacritics):**
104
+ `an` โ†’ ู‹ (Fathatan), `un` โ†’ ูŒ (Dammatan), `in` โ†’ ู (Kasratan)
105
+
106
+ **Tips:**
107
+ - Use capital letters for emphatic consonants (S, D, T, Z, H)
108
+ - Use capital vowels (I, U, A) for diacritics/short vowels
109
+ - Use 'an', 'un', 'in' for tanween (double diacritics)
110
+ - Combinations like 'th', 'kh' are processed before single letters
111
+ - Use apostrophe (') for the letter ุน (ayn)
112
+ - Use 'x' for hamza ุก when standalone
113
+ - Use ~ for shadda (gemination) and ^ for sukun (no vowel)
114
+ """)
115
+
116
  with gr.Row():
117
  with gr.Column():
118
  latin_input = gr.Textbox(
 
120
  lines=3,
121
  placeholder="Example: ahlan wa sahlan (ุฃู‡ู„ุง ูˆุณู‡ู„ุง)"
122
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  with gr.Column():
125
  arabic_output = gr.Textbox(
 
155
  )
156
 
157
 
 
158
  if __name__ == "__main__":
159
  demo.launch()