Dionyssos commited on
Commit
38c5196
·
1 Parent(s): 18fcbae

transcyril diphones fx

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. textual.py +30 -14
app.py CHANGED
@@ -262,9 +262,9 @@ with gr.Blocks() as demo:
262
  value='Η γρηγορη καφετι αλεπου πειδαει πανω απο τον τεμπελη σκυλο.',
263
  )
264
  choice_dropdown = gr.Dropdown(
265
- choices=VOICES + language_names,
266
  label="Vox :",
267
- value=VOICES[0]
268
  )
269
  soundscape_input = gr.Textbox(
270
  lines=1,
@@ -272,7 +272,7 @@ with gr.Blocks() as demo:
272
  label="AudioGen Txt:"
273
  )
274
  kv_input = gr.Number(
275
- label="Tokens",
276
  value=24,
277
  )
278
  generate_button = gr.Button("Generate Audio", variant="primary")
 
262
  value='Η γρηγορη καφετι αλεπου πειδαει πανω απο τον τεμπελη σκυλο.',
263
  )
264
  choice_dropdown = gr.Dropdown(
265
+ choices=language_names + VOICES,
266
  label="Vox :",
267
+ value=language_names[0], #VOICES[0]
268
  )
269
  soundscape_input = gr.Textbox(
270
  lines=1,
 
272
  label="AudioGen Txt:"
273
  )
274
  kv_input = gr.Number(
275
+ label="Tokens:",
276
  value=24,
277
  )
278
  generate_button = gr.Button("Generate Audio", variant="primary")
textual.py CHANGED
@@ -36,25 +36,41 @@ def only_greek_or_only_latin(text, lang='grc'):
36
  }
37
 
38
  cyrillic_to_latin_map = {
39
- 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'ж': 'zh',
40
- 'з': 'z', 'и': 'i', 'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
41
- 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'kh', 'ц': 'ts',
42
- 'ч': 'ch', 'ш': 'sh', 'щ': 'shch', 'ъ': '', 'ы': 'y', 'ь': '', 'э': 'e', 'ю': 'yu',
43
- 'я': 'ya',
 
 
 
 
 
 
 
 
 
44
  }
45
 
46
- # Direct Cyrillic to Greek mapping based on phonetic similarity.
47
- # These are approximations and may not be universally accepted transliterations.
48
  cyrillic_to_greek_map = {
49
- 'а': 'α', 'б': 'β', 'в': 'β', 'г': 'γ', 'д': 'δ', 'е': 'ε', 'ё': 'ιο', 'ж': 'ζ',
50
- 'з': 'ζ', 'и': 'ι', 'й': 'ι', 'κ': 'κ', 'λ': 'λ', 'м': 'μ', 'н': 'ν', 'о': 'ο',
51
- 'π': 'π', 'ρ': 'ρ', 'σ': 'σ', 'τ': 'τ', 'у': 'ου', 'ф': 'φ', 'х': 'χ', 'ц': 'τσ',
52
- 'ч': 'τσ', # or τζ depending on desired sound
53
- 'ш': 'σ', 'щ': 'σ', # approximations
54
- 'ъ': '', 'ы': 'ι', 'ь': '', 'э': 'ε', 'ю': 'ιου',
55
- 'я': 'ια',
 
 
 
 
 
 
 
56
  }
57
 
 
58
  # Convert the input text to lowercase, preserving accents for Latin characters.
59
  # casefold() is used for more robust caseless matching across Unicode characters.
60
  lowercased_text = text.lower() #casefold()
 
36
  }
37
 
38
  cyrillic_to_latin_map = {
39
+ # 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'ж': 'zh',
40
+ # 'з': 'z', 'и': 'i', 'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
41
+ # 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'kh', 'ц': 'ts',
42
+ # 'ч': 'ch', 'ш': 'sh', 'щ': 'shch', 'ъ': '', 'ы': 'y', 'ь': '', 'э': 'e', 'ю': 'yu',
43
+ # 'я': 'ya',
44
+ # ----------------
45
+ 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ж': 'zh',
46
+ 'з': 'z', 'и': 'i', 'ј': 'j', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n',
47
+ 'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f',
48
+ 'х': 'h', 'ц': 'c', 'ч': 'č', 'ш': 'š',
49
+ 'ђ': 'đ', 'љ': 'lj', 'њ': 'nj', 'ћ': 'ć', 'џ': 'dž',
50
+ 'ё': 'yo', 'й': 'y', 'щ': 'shch', 'ъ': '', 'ы': 'y', 'ь': '',
51
+ 'э': 'e', 'ю': 'io', 'я': 'ia',
52
+ 'ѓ': 'y', 'ѕ': 's', 'ќ': 'k',
53
  }
54
 
55
+ # Cyrillic to Greek on phonetic similarity.
 
56
  cyrillic_to_greek_map = {
57
+ # 'а': 'α', 'б': 'β', 'в': 'β', 'г': 'γ', 'д': 'δ', 'е': 'ε', 'ё': 'ιο', 'ж': 'ζ',
58
+ # 'з': 'ζ', 'и': 'ι', 'й': 'ι', 'κ': 'κ', 'λ': 'λ', 'м': 'μ', 'н': 'ν', 'о': 'ο',
59
+ # 'π': 'π', 'ρ': 'ρ', 'σ': 'σ', 'τ': 'τ', 'у': 'ου', 'ф': 'φ', 'х': 'χ', 'ц': 'τσ',
60
+ # 'ч': 'τσ', # or τζ depending on desired sound
61
+ # 'ш': 'σ', 'щ': 'σ', # approximations
62
+ # 'ъ': '', 'ы': 'ι', 'ь': '', 'э': 'ε', 'ю': 'ιου',
63
+ # 'я': 'ια',
64
+ # --------------------
65
+ 'а': 'α', 'б': 'μπ', 'в': 'β', 'г': 'γ', 'д': 'ντ', 'е': 'ε',
66
+ 'ё': 'γιο', 'ж': 'ζ', 'з': 'ζ', 'и': 'ι', 'й': 'γι', 'к': 'κ',
67
+ 'л': 'λ', 'м': 'μ', 'н': 'ν', 'о': 'ο', 'п': 'π', 'р': 'ρ',
68
+ 'с': 'σ', 'т': 'τ', 'у': 'ου', 'ф': 'φ', 'х': 'χ', 'ц': 'τσ',
69
+ 'ч': 'τσ', 'ш': 'σ', 'щ': 'στς', 'ъ': '', 'ы': 'ι', 'ь': '',
70
+ 'э': 'ε', 'ю': 'γιου', 'я': 'για'
71
  }
72
 
73
+
74
  # Convert the input text to lowercase, preserving accents for Latin characters.
75
  # casefold() is used for more robust caseless matching across Unicode characters.
76
  lowercased_text = text.lower() #casefold()