eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tostring.c 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. /* Enumeration types to string.
  2. *
  3. * Copyright (C) 2012-2016 Reece H. Dunn
  4. *
  5. * This file is part of ucd-tools.
  6. *
  7. * ucd-tools is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * ucd-tools is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with ucd-tools. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "ucd/ucd.h"
  21. const char *ucd_get_category_group_string(ucd_category_group c)
  22. {
  23. switch (c)
  24. {
  25. case UCD_CATEGORY_GROUP_C: return "C";
  26. case UCD_CATEGORY_GROUP_I: return "I";
  27. case UCD_CATEGORY_GROUP_L: return "L";
  28. case UCD_CATEGORY_GROUP_M: return "M";
  29. case UCD_CATEGORY_GROUP_N: return "N";
  30. case UCD_CATEGORY_GROUP_P: return "P";
  31. case UCD_CATEGORY_GROUP_S: return "S";
  32. case UCD_CATEGORY_GROUP_Z: return "Z";
  33. default: return "-";
  34. }
  35. }
  36. const char *ucd_get_category_string(ucd_category c)
  37. {
  38. switch (c)
  39. {
  40. case UCD_CATEGORY_Cc: return "Cc";
  41. case UCD_CATEGORY_Cf: return "Cf";
  42. case UCD_CATEGORY_Cn: return "Cn";
  43. case UCD_CATEGORY_Co: return "Co";
  44. case UCD_CATEGORY_Cs: return "Cs";
  45. case UCD_CATEGORY_Ii: return "Ii";
  46. case UCD_CATEGORY_Ll: return "Ll";
  47. case UCD_CATEGORY_Lm: return "Lm";
  48. case UCD_CATEGORY_Lo: return "Lo";
  49. case UCD_CATEGORY_Lt: return "Lt";
  50. case UCD_CATEGORY_Lu: return "Lu";
  51. case UCD_CATEGORY_Mc: return "Mc";
  52. case UCD_CATEGORY_Me: return "Me";
  53. case UCD_CATEGORY_Mn: return "Mn";
  54. case UCD_CATEGORY_Nd: return "Nd";
  55. case UCD_CATEGORY_Nl: return "Nl";
  56. case UCD_CATEGORY_No: return "No";
  57. case UCD_CATEGORY_Pc: return "Pc";
  58. case UCD_CATEGORY_Pd: return "Pd";
  59. case UCD_CATEGORY_Pe: return "Pe";
  60. case UCD_CATEGORY_Pf: return "Pf";
  61. case UCD_CATEGORY_Pi: return "Pi";
  62. case UCD_CATEGORY_Po: return "Po";
  63. case UCD_CATEGORY_Ps: return "Ps";
  64. case UCD_CATEGORY_Sc: return "Sc";
  65. case UCD_CATEGORY_Sk: return "Sk";
  66. case UCD_CATEGORY_Sm: return "Sm";
  67. case UCD_CATEGORY_So: return "So";
  68. case UCD_CATEGORY_Zl: return "Zl";
  69. case UCD_CATEGORY_Zp: return "Zp";
  70. case UCD_CATEGORY_Zs: return "Zs";
  71. default: return "--";
  72. }
  73. }
  74. const char *ucd_get_script_string(ucd_script s)
  75. {
  76. static const char *scripts[] =
  77. {
  78. "Afak",
  79. "Aghb",
  80. "Ahom",
  81. "Arab",
  82. "Armi",
  83. "Armn",
  84. "Avst",
  85. "Bali",
  86. "Bamu",
  87. "Bass",
  88. "Batk",
  89. "Beng",
  90. "Blis",
  91. "Bopo",
  92. "Brah",
  93. "Brai",
  94. "Bugi",
  95. "Buhd",
  96. "Cakm",
  97. "Cans",
  98. "Cari",
  99. "Cham",
  100. "Cher",
  101. "Cirt",
  102. "Copt",
  103. "Cprt",
  104. "Cyrl",
  105. "Cyrs",
  106. "Deva",
  107. "Dsrt",
  108. "Dupl",
  109. "Egyd",
  110. "Egyh",
  111. "Egyp",
  112. "Elba",
  113. "Ethi",
  114. "Geok",
  115. "Geor",
  116. "Glag",
  117. "Goth",
  118. "Gran",
  119. "Grek",
  120. "Gujr",
  121. "Guru",
  122. "Hang",
  123. "Hani",
  124. "Hano",
  125. "Hans",
  126. "Hant",
  127. "Hatr",
  128. "Hebr",
  129. "Hira",
  130. "Hluw",
  131. "Hmng",
  132. "Hrkt",
  133. "Hung",
  134. "Inds",
  135. "Ital",
  136. "Java",
  137. "Jpan",
  138. "Jurc",
  139. "Kali",
  140. "Kana",
  141. "Khar",
  142. "Khmr",
  143. "Khoj",
  144. "Knda",
  145. "Kore",
  146. "Kpel",
  147. "Kthi",
  148. "Lana",
  149. "Laoo",
  150. "Latf",
  151. "Latg",
  152. "Latn",
  153. "Lepc",
  154. "Limb",
  155. "Lina",
  156. "Linb",
  157. "Lisu",
  158. "Loma",
  159. "Lyci",
  160. "Lydi",
  161. "Mahj",
  162. "Mand",
  163. "Mani",
  164. "Maya",
  165. "Mend",
  166. "Merc",
  167. "Mero",
  168. "Mlym",
  169. "Modi",
  170. "Mong",
  171. "Moon",
  172. "Mroo",
  173. "Mtei",
  174. "Mult",
  175. "Mymr",
  176. "Narb",
  177. "Nbat",
  178. "Nkgb",
  179. "Nkoo",
  180. "Nshu",
  181. "Ogam",
  182. "Olck",
  183. "Orkh",
  184. "Orya",
  185. "Osma",
  186. "Palm",
  187. "Pauc",
  188. "Perm",
  189. "Phag",
  190. "Phli",
  191. "Phlp",
  192. "Phlv",
  193. "Phnx",
  194. "Plrd",
  195. "Prti",
  196. "Qaak",
  197. "Rjng",
  198. "Roro",
  199. "Runr",
  200. "Samr",
  201. "Sara",
  202. "Sarb",
  203. "Saur",
  204. "Sgnw",
  205. "Shaw",
  206. "Shrd",
  207. "Sidd",
  208. "Sind",
  209. "Sinh",
  210. "Sora",
  211. "Sund",
  212. "Sylo",
  213. "Syrc",
  214. "Syre",
  215. "Syrj",
  216. "Syrn",
  217. "Tagb",
  218. "Takr",
  219. "Tale",
  220. "Talu",
  221. "Taml",
  222. "Tang",
  223. "Tavt",
  224. "Telu",
  225. "Teng",
  226. "Tfng",
  227. "Tglg",
  228. "Thaa",
  229. "Thai",
  230. "Tibt",
  231. "Tirh",
  232. "Ugar",
  233. "Vaii",
  234. "Visp",
  235. "Wara",
  236. "Wole",
  237. "Xpeo",
  238. "Xsux",
  239. "Yiii",
  240. "Zinh",
  241. "Zmth",
  242. "Zsym",
  243. "Zxxx",
  244. "Zyyy",
  245. "Zzzz",
  246. };
  247. if ((unsigned int)s >= (sizeof(scripts)/sizeof(scripts[0])))
  248. return "----";
  249. return scripts[(unsigned int)s];
  250. }