Thnx for a great lib
Ive add a func to get a list of Lang by script
Maybe it will be useful for you too
func GetListOfLangsBaseOnScript(script *unicode.RangeTable) []Lang {
var res []Lang
switch script {
case unicode.Latin:
for k, _ := range latinLangs {
res = append(res, k)
}
return res
case unicode.Cyrillic:
for k, _ := range cyrillicLangs {
res = append(res, k)
}
return res
case unicode.Devanagari:
for k, _ := range devanagariLangs {
res = append(res, k)
}
return res
case unicode.Hebrew:
for k, _ := range hebrewLangs {
res = append(res, k)
}
return res
case unicode.Ethiopic:
for k, _ := range ethiopicLangs {
res = append(res, k)
}
return res
case unicode.Arabic:
for k, _ := range arabicLangs {
res = append(res, k)
}
return res
case unicode.Han:
res = append(res, Cmn)
return res
case unicode.Bengali:
res = append(res, Ben)
return res
case unicode.Hangul:
res = append(res, Kor)
return res
case unicode.Georgian:
res = append(res, Kat)
return res
case unicode.Greek:
res = append(res, Ell)
return res
case unicode.Kannada:
res = append(res, Kan)
return res
case unicode.Tamil:
res = append(res, Tam)
return res
case unicode.Thai:
res = append(res, Tha)
return res
case unicode.Gujarati:
res = append(res, Guj)
return res
case unicode.Gurmukhi:
res = append(res, Pan)
return res
case unicode.Telugu:
res = append(res, Tel)
return res
case unicode.Malayalam:
res = append(res, Mal)
return res
case unicode.Oriya:
res = append(res, Ori)
return res
case unicode.Myanmar:
res = append(res, Mya)
return res
case unicode.Sinhala:
res = append(res, Sin)
return res
case unicode.Khmer:
res = append(res, Khm)
return res
case unicode.Katakana:
res = append(res, Jpn)
return res
case unicode.Hiragana:
res = append(res, Jpn)
return res
}
return nil
}
Thnx for a great lib Ive add a func to get a list of Lang by script Maybe it will be useful for you too