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.

tokenizer.h 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (C) 2017 Reece H. Dunn
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, see: <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef ESPEAK_NG_TOKENIZER_H
  18. #define ESPEAK_NG_TOKENIZER_H
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. typedef struct espeak_ng_TOKENIZER_ espeak_ng_TOKENIZER;
  24. ESPEAK_NG_API espeak_ng_TOKENIZER *
  25. create_tokenizer(void);
  26. ESPEAK_NG_API void
  27. destroy_tokenizer(espeak_ng_TOKENIZER *tokenizer);
  28. typedef enum
  29. {
  30. ESPEAKNG_TOKENIZER_OPTION_TEXT = 0,
  31. } espeak_ng_TOKENIZER_OPTIONS;
  32. ESPEAK_NG_API int
  33. tokenizer_reset(espeak_ng_TOKENIZER *tokenizer,
  34. espeak_ng_TEXT_DECODER *decoder,
  35. espeak_ng_TOKENIZER_OPTIONS options);
  36. typedef enum
  37. {
  38. ESPEAKNG_TOKEN_END_OF_BUFFER,
  39. ESPEAKNG_TOKEN_UNKNOWN,
  40. ESPEAKNG_TOKEN_NEWLINE,
  41. ESPEAKNG_TOKEN_PARAGRAPH,
  42. ESPEAKNG_TOKEN_WHITESPACE,
  43. ESPEAKNG_TOKEN_WORD_UPPERCASE,
  44. ESPEAKNG_TOKEN_WORD_LOWERCASE,
  45. ESPEAKNG_TOKEN_WORD_MIXEDCASE,
  46. ESPEAKNG_TOKEN_WORD_CAPITALIZED,
  47. ESPEAKNG_TOKEN_FULL_STOP,
  48. ESPEAKNG_TOKEN_QUESTION_MARK,
  49. ESPEAKNG_TOKEN_EXCLAMATION_MARK,
  50. ESPEAKNG_TOKEN_COMMA,
  51. ESPEAKNG_TOKEN_COLON,
  52. ESPEAKNG_TOKEN_SEMICOLON,
  53. ESPEAKNG_TOKEN_ELLIPSIS,
  54. ESPEAKNG_TOKEN_PUNCTUATION,
  55. ESPEAKNG_TOKEN_SYMBOL,
  56. } espeak_ng_TOKEN_TYPE;
  57. ESPEAK_NG_API espeak_ng_TOKEN_TYPE
  58. tokenizer_read_next_token(espeak_ng_TOKENIZER *tokenizer);
  59. ESPEAK_NG_API const char *
  60. tokenizer_get_token_text(espeak_ng_TOKENIZER *tokenizer);
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif