Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import epitran
|
|
3 |
import langcodes
|
4 |
from langcodes import LanguageTagError
|
5 |
from pathlib import Path
|
|
|
6 |
# TODO: reverse transliterate?
|
7 |
|
8 |
|
@@ -46,6 +47,15 @@ def get_valid_epitran_mappings_list():
|
|
46 |
map_path = Path(epitran.__path__[0]) / "data" / "map"
|
47 |
map_files = map_path.glob("*.*")
|
48 |
valid_mappings = [map_file.stem for map_file in map_files]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
return valid_mappings
|
50 |
|
51 |
|
|
|
3 |
import langcodes
|
4 |
from langcodes import LanguageTagError
|
5 |
from pathlib import Path
|
6 |
+
from operator import itemgetter
|
7 |
# TODO: reverse transliterate?
|
8 |
|
9 |
|
|
|
47 |
map_path = Path(epitran.__path__[0]) / "data" / "map"
|
48 |
map_files = map_path.glob("*.*")
|
49 |
valid_mappings = [map_file.stem for map_file in map_files]
|
50 |
+
problem_mappings = ['generic-Latn',
|
51 |
+
'tur-Latn-bab',
|
52 |
+
'ood-Latn-sax',
|
53 |
+
'vie-Latn-so',
|
54 |
+
'vie-Latn-ce',
|
55 |
+
'vie-Latn-no',
|
56 |
+
'kaz-Cyrl-bab'] # https://github.com/dmort27/epitran/issues/98
|
57 |
+
filtered_mappings = [mapping for mapping in valid_epitran_mappings if mapping not in problem_mappings]
|
58 |
+
|
59 |
return valid_mappings
|
60 |
|
61 |
|