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 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. int main()
  77. {
  78. for (ucd::codepoint_t c = 0; c <= 0x10FFFF; ++c)
  79. {
  80. const char *category = get_category_string(ucd::lookup_category(c));
  81. const char *category_group = get_category_group_string(ucd::lookup_category_group(c));
  82. ucd::codepoint_t upper = ucd::toupper(c);
  83. ucd::codepoint_t lower = ucd::tolower(c);
  84. ucd::codepoint_t title = ucd::totitle(c);
  85. const char *whitespace = ucd::isspace(c) ? "White_Space" : "";
  86. printf("%06X %s %s %06X %06X %06X %s\n",
  87. c, category_group, category,
  88. upper, lower, title,
  89. whitespace);
  90. }
  91. return 0;
  92. }