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.

categories.py 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/python
  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. import os
  19. import sys
  20. import ucd
  21. ucd_rootdir = sys.argv[1]
  22. unicode_data = ucd.parse_ucd_data(ucd_rootdir, 'UnicodeData')
  23. if __name__ == '__main__':
  24. sys.stdout.write("""/* Unicode General Categories
  25. *
  26. * Copyright (C) 2012 Reece H. Dunn
  27. *
  28. * This file is part of ucd-tools.
  29. *
  30. * ucd-tools is free software: you can redistribute it and/or modify
  31. * it under the terms of the GNU General Public License as published by
  32. * the Free Software Foundation, either version 3 of the License, or
  33. * (at your option) any later version.
  34. *
  35. * ucd-tools is distributed in the hope that it will be useful,
  36. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. * GNU General Public License for more details.
  39. *
  40. * You should have received a copy of the GNU General Public License
  41. * along with ucd-tools. If not, see <http://www.gnu.org/licenses/>.
  42. */
  43. // NOTE: This file is automatically generated from the UnicodeData.txt file in
  44. // the Unicode Character database by the ucd-tools/tools/categories.py script.
  45. #include "ucd/ucd.h"
  46. using namespace ucd;
  47. """)
  48. sys.stdout.write('\n')
  49. sys.stdout.write('ucd::category ucd::lookup_category(codepoint_t c)\n')
  50. sys.stdout.write('{\n')
  51. sys.stdout.write('\treturn Cn;\n')
  52. sys.stdout.write('}\n')