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.

printucddata.cpp 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /*
  2. * Copyright (C) 2012 Reece H. Dunn
  3. *
  4. * This file is part of ucd-tools.
  5. *
  6. * ucd-tools is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * ucd-tools is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with ucd-tools. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "ucd/ucd.h"
  20. #include <stdio.h>
  21. const char *get_category_group_string(ucd::category_group c)
  22. {
  23. using namespace ucd;
  24. switch (c)
  25. {
  26. case C: return "C";
  27. case I: return "I";
  28. case L: return "L";
  29. case M: return "M";
  30. case N: return "N";
  31. case P: return "P";
  32. case S: return "S";
  33. case Z: return "Z";
  34. default: return "-";
  35. }
  36. }
  37. const char *get_category_string(ucd::category c)
  38. {
  39. using namespace ucd;
  40. switch (c)
  41. {
  42. case Cc: return "Cc";
  43. case Cf: return "Cf";
  44. case Cn: return "Cn";
  45. case Co: return "Co";
  46. case Cs: return "Cs";
  47. case Ii: return "Ii";
  48. case Ll: return "Ll";
  49. case Lm: return "Lm";
  50. case Lo: return "Lo";
  51. case Lt: return "Lt";
  52. case Lu: return "Lu";
  53. case Mc: return "Mc";
  54. case Me: return "Me";
  55. case Mn: return "Mn";
  56. case Nd: return "Nd";
  57. case Nl: return "Nl";
  58. case No: return "No";
  59. case Pc: return "Pc";
  60. case Pd: return "Pd";
  61. case Pe: return "Pe";
  62. case Pf: return "Pf";
  63. case Pi: return "Pi";
  64. case Po: return "Po";
  65. case Ps: return "Ps";
  66. case Sc: return "Sc";
  67. case Sk: return "Sk";
  68. case Sm: return "Sm";
  69. case So: return "So";
  70. case Zl: return "Zl";
  71. case Zp: return "Zp";
  72. case Zs: return "Zs";
  73. default: return "--";
  74. }
  75. }
  76. const char *get_script_string(ucd::script s)
  77. {
  78. using namespace ucd;
  79. switch (s)
  80. {
  81. case Arab: return "Arab";
  82. case Armi: return "Armi";
  83. case Armn: return "Armn";
  84. case Avst: return "Avst";
  85. case Bali: return "Bali";
  86. case Bamu: return "Bamu";
  87. case Batk: return "Batk";
  88. case Beng: return "Beng";
  89. case Bopo: return "Bopo";
  90. case Brah: return "Brah";
  91. case Brai: return "Brai";
  92. case Bugi: return "Bugi";
  93. case Buhd: return "Buhd";
  94. case Cans: return "Cans";
  95. case Cari: return "Cari";
  96. case Cakm: return "Cakm";
  97. case Cham: return "Cham";
  98. case Cher: return "Cher";
  99. case Copt: return "Copt";
  100. case Cprt: return "Cprt";
  101. case Cyrl: return "Cyrl";
  102. case Deva: return "Deva";
  103. case Dsrt: return "Dsrt";
  104. case Egyp: return "Egyp";
  105. case Ethi: return "Ethi";
  106. case Geor: return "Geor";
  107. case Glag: return "Glag";
  108. case Goth: return "Goth";
  109. case Grek: return "Grek";
  110. case Gujr: return "Gujr";
  111. case Guru: return "Guru";
  112. case Hang: return "Hang";
  113. case Hano: return "Hano";
  114. case Hant: return "Hant";
  115. case Hebr: return "Hebr";
  116. case Hira: return "Hira";
  117. case Ital: return "Ital";
  118. case Java: return "Java";
  119. case Kali: return "Kali";
  120. case Kana: return "Kana";
  121. case Khar: return "Khar";
  122. case Khmr: return "Khmr";
  123. case Knda: return "Knda";
  124. case Kthi: return "Kthi";
  125. case Lana: return "Lana";
  126. case Laoo: return "Laoo";
  127. case Latn: return "Latn";
  128. case Lepc: return "Lepc";
  129. case Limb: return "Limb";
  130. case Linb: return "Linb";
  131. case Lisu: return "Lisu";
  132. case Lyci: return "Lyci";
  133. case Lydi: return "Lydi";
  134. case Mand: return "Mand";
  135. case Merc: return "Merc";
  136. case Mero: return "Mero";
  137. case Mlym: return "Mlym";
  138. case Mong: return "Mong";
  139. case Mtei: return "Mtei";
  140. case Mymr: return "Mymr";
  141. case Nkoo: return "Nkoo";
  142. case Ogam: return "Ogam";
  143. case Olck: return "Olck";
  144. case Orkh: return "Orkh";
  145. case Orya: return "Orya";
  146. case Osma: return "Osma";
  147. case Phag: return "Phag";
  148. case Phli: return "Phli";
  149. case Phnx: return "Phnx";
  150. case Plrd: return "Plrd";
  151. case Prti: return "Prti";
  152. case Rjng: return "Rjng";
  153. case Runr: return "Runr";
  154. case Samr: return "Samr";
  155. case Sarb: return "Sarb";
  156. case Saur: return "Saur";
  157. case Shaw: return "Shaw";
  158. case Shrd: return "Shrd";
  159. case Sinh: return "Sinh";
  160. case Sora: return "Sora";
  161. case Sund: return "Sund";
  162. case Sylo: return "Sylo";
  163. case Syrn: return "Syrn";
  164. case Tagb: return "Tagb";
  165. case Takr: return "Takr";
  166. case Tale: return "Tale";
  167. case Talu: return "Talu";
  168. case Taml: return "Taml";
  169. case Tavt: return "Tavt";
  170. case Telu: return "Telu";
  171. case Tfng: return "Tfng";
  172. case Tglg: return "Tglg";
  173. case Thaa: return "Thaa";
  174. case Thai: return "Thai";
  175. case Tibt: return "Tibt";
  176. case Ugar: return "Ugar";
  177. case Vaii: return "Vaii";
  178. case Xpeo: return "Xpeo";
  179. case Xsux: return "Xsux";
  180. case Yiii: return "Yiii";
  181. case Zyyy: return "Zyyy";
  182. case Zzzz: return "Zzzz";
  183. default: return "----";
  184. }
  185. }
  186. int main()
  187. {
  188. for (ucd::codepoint_t c = 0; c <= 0x10FFFF; ++c)
  189. {
  190. const char *script = get_script_string(ucd::lookup_script(c));
  191. const char *category = get_category_string(ucd::lookup_category(c));
  192. const char *category_group = get_category_group_string(ucd::lookup_category_group(c));
  193. ucd::codepoint_t upper = ucd::toupper(c);
  194. ucd::codepoint_t lower = ucd::tolower(c);
  195. ucd::codepoint_t title = ucd::totitle(c);
  196. const char *whitespace = ucd::isspace(c) ? "White_Space" : "";
  197. printf("%06X %s %s %s %06X %06X %06X %s\n",
  198. c, script, category_group, category,
  199. upper, lower, title,
  200. whitespace);
  201. }
  202. return 0;
  203. }