-
Notifications
You must be signed in to change notification settings - Fork 0
/
TesseractLanguages.cs
78 lines (77 loc) · 2.04 KB
/
TesseractLanguages.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
public static class TesseractLanguage
{
public enum Languages
{
English,
German,
French,
Spanish,
Italian,
Dutch,
Portuguese,
Russian,
Japanese,
ChineseSimplified,
ChineseTraditional,
Korean,
Arabic,
Turkish,
Swedish,
Polish,
Greek,
Hungarian,
Finnish,
Danish,
Norwegian
}
public static string GetLanguageCode(Languages language)
{
switch (language)
{
case Languages.English:
return "eng";
case Languages.German:
return "deu";
case Languages.French:
return "fra";
case Languages.Spanish:
return "spa";
case Languages.Italian:
return "ita";
case Languages.Dutch:
return "nld";
case Languages.Portuguese:
return "por";
case Languages.Russian:
return "rus";
case Languages.Japanese:
return "jpn";
case Languages.ChineseSimplified:
return "chi_sim";
case Languages.ChineseTraditional:
return "chi_tra";
case Languages.Korean:
return "kor";
case Languages.Arabic:
return "ara";
case Languages.Turkish:
return "tur";
case Languages.Swedish:
return "swe";
case Languages.Polish:
return "pol";
case Languages.Greek:
return "ell";
case Languages.Hungarian:
return "hun";
case Languages.Finnish:
return "fin";
case Languages.Danish:
return "dan";
case Languages.Norwegian:
return "nor";
default:
throw new ArgumentException($"Unsupported language: {language}");
}
}
}