-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump to 0.0.6
- Loading branch information
Showing
5 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
class PygoruutLanguages: | ||
def __init__(self): | ||
# ISO 639 language codes and their corresponding languages | ||
self.languagesISO639 = { | ||
"ar": "Arabic", | ||
"bn": "Bengali", | ||
"zh": "ChineseMandarin", | ||
"cs": "Czech", | ||
"nl": "Dutch", | ||
"en": "English", | ||
"eo": "Esperanto", | ||
"fa": "Farsi", | ||
"fi": "Finnish", | ||
"fr": "French", | ||
"de": "German", | ||
"el": "Greek", | ||
"gu": "Gujarati", | ||
"hi": "Hindi", | ||
"hu": "Hungarian", | ||
"is": "Icelandic", | ||
"it": "Italian", | ||
"jam": "Jamaican", | ||
"ja": "Japanese", | ||
"lb": "Luxembourgish", | ||
"ms": "MalayLatin", | ||
"mr": "Marathi", | ||
"no": "Norwegian", | ||
"pl": "Polish", | ||
"pt": "Portuguese", | ||
"pa": "Punjabi", | ||
"ro": "Romanian", | ||
"ru": "Russian", | ||
"sk": "Slovak", | ||
"es": "Spanish", | ||
"sw": "Swahili", | ||
"sv": "Swedish", | ||
"ta": "Tamil", | ||
"te": "Telugu", | ||
"tr": "Turkish", | ||
"uk": "Ukrainian", | ||
"ur": "Urdu", | ||
"vi": "VietnameseNorthern" | ||
} | ||
|
||
# Non-ISO 639 language or dialect names | ||
self.languagesNonISO639 = [ | ||
"BengaliDhaka", | ||
"BengaliRahr", | ||
"Isan", | ||
"MalayArab", | ||
"VietnameseCentral", | ||
"VietnameseSouthern" | ||
] | ||
|
||
def get_supported_languages(self): | ||
# Concatenate the keys of languagesISO639 with the values of languagesNonISO639 | ||
return list(self.languagesISO639.keys()) + self.languagesNonISO639 | ||
|
||
def get_all_supported_languages(self): | ||
# Concatenate the keys and values of languagesISO639 with the values of languagesNonISO639 | ||
return list(self.languagesISO639.keys()) + list(self.languagesISO639.values()) + self.languagesNonISO639 | ||
|
||
def __getitem__(self, value): | ||
if len(value) == 2 or len(value) == 3: | ||
value = self.languagesISO639[value] or value | ||
return value | ||
|
||
# Example usage: | ||
if __name__ == '__main__': | ||
pygoruut = PygoruutLanguages() | ||
print(pygoruut.get_supported_languages()) | ||
print(pygoruut["vi"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "pygoruut" | ||
version = "0.0.5" | ||
version = "0.0.6" | ||
description = "A Python wrapper for the goruut phonemization tool" | ||
readme = "README.md" | ||
authors = [{ name = "Neurlang Project", email = "[email protected]" }] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters