- The E-mail Preprocessor filters and interprets English electronic mail message input before NaturalText speaks it. E-mail preprocessing accomplishes the following:
- Pronounces common surnames, place names, phone numbers, and addresses
correctly.
- Strips headers from message text.
- Interprets multiple date and time formats.
- Interprets specialized punctuation (for instance, *asterisks* for emphasis)
and symbols (such as, [: )] ) and speaks appropriate text.
- Assesses word context to interpret ambiguous punctuation and
abbreviations.
- The NaturalText API includes two functions for preprocessing English text on the host system. The functions ttsPreprocess and ttsPreprocessFile preprocess English e-mail text so it can be passed to ttsSpeak.
- ttsPreprocess operates on text buffers, while ttsPreprocessFile file operates on files. You can discard or retain message headers by specifying either TTS_METHOD_EMAIL_KEEP_HEADER or TTS_METHOD_EMAIL_STRIP_HEADER as processing methods.
- The example code below illustrates a way of using ttsPreprocess to preprocess text from buffers:
char *buffer, *out_buffer;
unsigned outputbuf_size, result_size ;
CTAHD ctahd;
DWORD ret_code;
ret_code = ttsPreprocess(
buffer, /* Pointer to input text buffer */
TTSMETHOD_EMAIL_STRIP_HEADER, /* Processing method */
&result_size, /* Actual length of the the output*/
/* text after processing. */
out_buffer, /* Pointer to output text buffer */
outputbuf_size ); /* Size of output buffer */
if( ret_code == SUCCESS )
ttsSpeak( ctahd, out_buffer );
Note: ttsPreprocess and ttsPreprocessFile run on the host machine and only apply to English text input.