Abstract:
A text parser for a text-to-speech processor accepts a text stream and parses the text stream to detect non-spoken characters and spoken characters. The spoken characters are passed to the text-to-speech converter and are not altered. A text generator generates pre-designated text sequences in response to non-spoken characters, such as special character sequences or character sequences which match format templates. A speech command generator generates speech commands in response to detecting of non-spoken characters such as non-spoken characters which affect text style, font, underlining, etc. The text-to-speech converter converts spoken text parsed by the parser and text generated by the text generator into speech, the text-to-speech converter being operable in response to speech commands generated by the speech command generator. According to the invention, it is not necessary to pre-process text files in preparation for text-to-speech conversion, and arbitrary files which contain both spoken and non-spoken characters may be converted easily.

Description:
This application is a continuation, of application Ser. No. 07/978,487 filed Nov. 18, 1992, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field Of The Invention 
     The present invention relates to a parser for text that is to be subjected to text-to-speech processing, and particularly to such a parser which detects non-spoken characters and which replaces those characters with spoken text-equivalent characters or which generates speech commands based on the non-spoken characters. 
     2. Description Of The Related Art 
     Recently, as the technology for electronically converting text-to-speech has advanced, direct text-to-speech conversion is replacing other techniques where computer generated speech is desired, for example, digitized speech techniques in which spoken words are digitized by high speed analog-to-digital sampling and the digitized words are stored for selective play out. In comparison to direct text-to-speech, however, digital speech techniques consume large amounts of memory because a different storage location is needed for each one of the high speed digital samples. Direct text-to-speech techniques, on the other hand, need only store ASCII text, and consequently those direct text-to-speech techniques need only about b 1/1000 of the memory needed by digitized speech techniques. 
     Moreover, digitized speech techniques are unsuitable for many applications where computer generated speech is needed. Digitized speech does not work when original audio signals are not available, for example, when it is desired to &#34;speak&#34; an incoming facsimile. Direct text-to-speech, on the other hand, can perform optical character recognition on the incoming facsimile message and channel the text which results from optical character recognition processing to a text-to-speech converter, whereby an incoming facsimile message may be spoken. 
     Despite the desirability of direct text-to-speech, conventional text-to-speech processes have only limited ability to adapt to the format of an incoming text stream. For example, an incoming text stream often contains characters that are not part of the message being communicated, such as new paragraph marks, printer control characters, and other &#34;non-spoken&#34; characters. Conventional text-to-speech processors attempt to speak each and every character that is fed to it, including the non-spoken characters embedded in the text, which results in garbled speech. Moreover, there has not been provisions to automatically vary the intonation of text-to-speech processors based on the context of the text. This results in monotonous sequences of monotone speech. 
     Accordingly, it has heretofore not been possible to send arbitrary text files to a text-to-speech converter. Rather, it has been necessary to manually edit text files before text-to-speech processing so as to remove non-spoken characters and so as to insert speech commands (for example, loud, soft, fast or slow) so as to break monotony. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to address the foregoing difficulties. 
     In one aspect, the invention is a text parser which parses the text fed to a text-to-speech converter so as to detect non-spoken characters. Any non-spoken characters that are detected are subjected to analysis. If the non-spoken characters match any one of a set of first characteristics, such as non-spoken characters that designate the position and paragraphing of text on a page or non-spoken character sequences having pre-designated formats, then the non-spoken characters are replaced by pre-designated text sequences that correspond to the non-spoken characters. If the non-spoken characters match any one of a set of second characteristics, such as non-spoken characters that indicate the typeface, font, underlining or boldness of succeeding text, then those non-spoken characters are deleted and replaced with speech commands which cause a text-to-speech converter to vary intonation, speaking speed, etc. 
     The characteristics of non-spoken characters are determined in accordance with stored tables of characteristics. The tables contain formatting information and rules for dealing with the different aspects of non-spoken characters. A first table contains a list of unprintable or non-spoken characters. A second table contains a list of mark-up codes by which conventional word processing programs designate text style (for example, bold, italics, etc.) fonts, underlining, etc. Another table stores a list of non-spoken characters such as exclamation points, mathematical symbols, etc. that are to be replaced by text-equivalent spoken characters. Yet another table stores format templates for converting specially formatted strings such as dates, times, and DOS path names into speakable text-equivalent strings. Yet another table interprets the spatial relationship of text within a printed page (for example, titles, captions for figures, paragraphing, etc.) to identify and assign user specifiable changes in speech commands (intonation, etc.) and to insert user-specifiable legends. 
     The text stream input to the parser may be obtained from a variety of sources. For example, the text stream may be obtained from word processing files which ordinarily contain significant numbers of non-spoken characters that designate paper size, font, underlining, spacing, etc. Likewise, the input text may be obtained from electronic mail on a local area network, or it may be downloaded from an electronic bulletin board via a modem. Finally, it is possible to obtain input text files by subjecting input facsimile messages to optical character recognition processing and storing the resulting text for pre-parsing and text-to-speech conversion. 
     This brief summary has been provided so that the nature of the invention may be understood quickly. A more complete understanding of the invention can be obtained by reference to the following detailed description of the preferred embodiment thereof in connection with the drawings which together form a complete part of the specification. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram showing an apparatus according to the invention. 
     FIG. 2 is a functional block diagram for explaining text parsing. 
     FIGS. 3(a) 3(b), and 3(c) is a flow diagram for explaining text parsing according to the invention. 
     FIG. 4(a) through 4(d) are representative reference tables by which parsing of non-spoken characters is conducted. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 is a schematic block diagram of an apparatus according to the invention. 
     In FIG. 1, reference numeral 10 designates personal computing equipment such as an IBM PC or PC-compatible computer. Computing equipment 10 includes a CPU 11 such as an 80386 processor which executes stored program instructions such as operator-selected applications programs that are stored in ROM 12 or specialized functions such as start-up programs which are stored in RAM 14. Computing equipment 10 further includes a local area network interface device 15 which provides access to a local area network 16 whereby the computing equipment can access files on a remote file server or send files for remote printing or otherwise interact with a local area network in accordance with known techniques such as by sending or receiving electronic mail. 
     Computing equipment 10 further includes a monitor 17 for displaying graphic images and a keyboard/mouse 19 for allowing operator designation and inputting functions. 
     Mass storage memory 20, such as a fixed disk or a floppy disk drive is connected for access by CPU 11. Mass storage memory 20 typically includes stored program instructions sequences such as an instruction sequence for text parsing according to the invention, or other application programs such as word processing application programs, optical character recognition programs, spread sheet application programs, and other information and data processing programs. Mass storage memory 20 further stores reference tables for use by the text parser of the invention, as well as arbitrary files which include text that are to be processed by text-to-speech conversion, scripting files which control a text-to-speech narration process, image files which are inserted by the scripting files, digitized sound files which are inserted by the scripting files and MIDI files which are inserted by the scripting files. Other data may be stored on mass storage memory 20 as designated by the operator. 
     A modem 21, a facsimile interface 22, and a voice telephone interface 24 are provided so that CPU 11 can interface to an ordinary telephone line 25. Each of the modem 21, facsimile interface 22, and voice telephone interface 24 are given access to the telephone line 25 via a telephone line switch 26 which is activated under control by CPU 11 so as to connect the telephone line 25 to one of the modem 21, the facsimile 22 or the voice telephone interface 24, as appropriate to the data on the telephone line. Thus, CPU 11 can send and receive binary data such as ASCII text files via modem 21, it can send and receive facsimile messages via facsimile interface 22, and it can interact on ordinary voice telephone lines via voice telephone interface 24. In this regard, voice telephone interface 24 is provided with a DTMF decoder so as to decode tones on voice telephone which correspond to operator depressions of a telephone keypad. The decoded tones are interpreted by CPU 11 as operator commands in accordance with program instructions stored in mass storage memory 20. 
     A conventional text-to-speech converter 26 is connected to CPU 11. The text-to-speech converter 26 interprets text strings sent to it and converts those text strings to audio speech information. The text-to-speech converter 26 provides the audio speech information either to a speaker 27 for enunciation to a local computer operator, or provides the audio speech information to the voice telephone interface 24 for enunciation over ordinary voice telephone lines. 
     FIG. 2 is a functional block diagram for explaining the operation of the FIG. 1 apparatus. In FIG. 2, 30 is a text parser for parsing text stored in input buffer 31 and for storing parsed text in output buffer 32. The parsed text in output buffer 32 is spoken by text-to-speech converter 26 over voice telephone interface 24 or over speaker 27 as explained above. 
     Text parser 30 is implemented in accordance with a stored program instruction sequence stored in mass storage memory 20 and executed by CPU 11. Typically, the stored program instruction steps are stored in RAM 14 and executed out of RAM. Likewise, input buffer 31 and output buffer 32 are stored in other locations in RAM 14. 
     The text that is stored in input buffer 31 and which is parsed by text parser 30 may be provided from a variety of text sources. For example, the text may be generated by word processing programs which have been executed by CPU 11 and which stores the resulting word processed files in mass storage memory. The text may also be obtained by similarly processed word processed files which are accessed from a file server across local area network 16. Or, the text may be obtained from electronic mail messages which are sent and received to users in the local area network over the local area network 16. The text files may also be obtained in binary format, for example, ASCII, from modem 21 via telephone line 25 and telephone line switch 26. Such binary data is often associated with computerized bulletin boards and are downloaded by CPU 11 in accordance with stored program instruction sequences. 
     The text file may also be obtained by optical character recognition processing of a facsimile document that is received from telephone line 25 via facsimile interface 22. In accordance with conventional technology, facsimile images that are received from facsimile interface 22 are converted by CPU 11 into bit map images and the bit map images are subjected to optical character recognition processing. The text files that result from optical character recognition processing may be stored in mass storage memory 20 and thereupon provided to input buffer 31, or may be provided directly to input buffer 31. 
     In FIG. 2, text parser 30 includes a parser 34 which maintains a pointer 35 to characters in input buffer 31. Based on the position of that pointer, characters are provided to parser 34. Parser 34 inspects those characters to detect non-spoken characters. Spoken characters are provided directly to output buffer 32 for enunciation by text-to-speech converter 26. Non-spoken characters are determined by reference to one of reference tables 38, the contents of which will be discussed more fully with respect to FIG. 4. For non-spoken characters, parser 34 inspects those characters with respect to reference tables 35 to determine whether they have certain characteristics. For example, if parser 34 determines that the non-spoken characters correspond to certain pre-designated character sequences, such as punctuation marks or mathematical symbols, then text generator 36 generates text-equivalent sequences in replacement for those non-spoken characters. If, on the other hand, parser 34 determines that the non-spoken characters correspond to certain escape sequences which control text font, style, underlining, appearance, etc. then speech command generator 37 generates speech commands which alter the manner in which text-to-speech converter 26 enunciates the speech. For example, via commands generated by speech command generator 37, the text-to-speech converter 26 can modify speed, pitch (frequency), volume, stress or voice. 
     In FIG. 2, text and speech commands are provided serially to the output buffer whereupon text-to-speech converter 26 sequentially and serially processes the text and embedded speech commands so as to extract the speech commands from the text. This arrangement is preferable, because since the speech commands are embedded in the text, it is not possible to lose synchronization between text and the speech commands associated with that text. On the other hand, when speech commands are not embedded in text then it is possible to lose synchronization between text and the associated commands because the commands and text are processed by the text-to-speech converter 26 separately. 
     It is also preferable for the parser 34 not simply to read the input buffer 31 from beginning to end but rather to provide for control over pointer 35 which points to text in the buffer. As shown in FIG. 2, CPU 11 preferably provides for pointer positioning commands which allow operator interface and control over the sequence by which the input buffer is provided. For example, in accordance with operator input from keyboard 19, CPU 11 may re-position pointer 35 so as to repeat text strings in the input buffer, or so as to backspace or fast forward through the input buffer. Likewise, it is possible for an operator to indicate that only certain portions should be parsed. For example, an operator may designate that only the first sentence of each paragraph be spoken, or, in the case of electronic mail, that only header information such as sender and subject be spoken. 
     Similar control over the position of pointer 35 in input buffer 31 may also be provided for remote users via telephone interface 24. In this case, a remote user may designate text play out commands by depressing selected keys on a touch telephone dial pad. The resulting DTMF tones are decoded by DTMF decoder 24a and provided to CPU 11 via the voice telephone interface 24. CPU 11 can interpret those DTMF commands and re-position the pointer in response to those commands in much the same manner as commands entered by local users through keyboard/mouse 19. Suitable techniques are discussed in my co-pending U.S. patent applications Ser. Nos. 07/977,680, filed Nov. 18, 1992, and 07/978,440, filed Nov. 18, 1992, respectively entitled &#34;Graphics User Interface For Controlling Text-To-Speech Conversion&#34; and &#34;Method And Apparatus For Extracting Text From A Structured Data File And Converting The Extracted Text To Speech&#34;, the contents of which are incorporated herein by reference as if set forth here in full. 
     FIG. 3 is a detailed flow diagram showing operation of the present invention. 
     In step S301, an input text file is obtained and loaded into input buffer 31. As mentioned above, the input text file can be obtained from any of a variety of sources, such as a word processing text file, a DOS text file, electronic mail, etc. 
     In step S302, parser 34 sets pointer 35 to the beginning of the input buffer 31. Characters are provided to parser 34 from the pointer&#39;s position. In step S303, the characters provided to the parser are inspected to determine if an action token has been detected at the position of pointer 35. An &#34;action token&#34; refers to as a special character, such as a vertical bar (&#34;|&#34;) by which a scripting program which includes text narration to be converted into speech can command certain actions to be taken, such as commanding an image file to be inserted onto a monitor, commanding digitized sound to be played over a speaker, commanding MIDI music to be played, etc. Scripting is described in my co-pending U.S. patent application Ser. No. 07/978,336, filed Nov. 18, 1992, entitled &#34;Method And Apparatus For Scripting A Text To-Speech-Based Multimedia Presentation&#34;, the contents of which are incorporated herein by reference as if set forth in full. 
     If in step S303 an action token has been detected, then in step S304, the command sequence which follows the action token is sent to a presentation manager for execution. The position of pointer 35 is updated in step S305 to the position in input buffer 31 which immediately follows the command sequence, and flow returns to step S303 for inspection of the characters at the new pointer position. 
     If in step S303 an action token is not detected, then flow advances to step S306 which determines whether the pointer points to an non-spoken character. Non-spoken characters are determined by reference to one of reference tables 38, such as the table illustrated in FIG. 4(a). As shown in that figure, the table includes only spoken characters such as those characters between hexadecimal codes 20H through 7EH. The table is user-modifiable, so that other spoken codes can be added to the table, for example, when special characters for European accents may be present in the text. For example, certain spoken codes can include an accented lower case e (&#34;e&#34;) whose hexadecimal code is 8Ah. 
     If an non-spoken character is not detected at the pointer, then step S307 determines whether there is any associated spatial context with the character. For example, when it is desired to convert a text file which includes the text for a form organized into title fields, the position of those fields is an associated spatial context to the text. Thus, the position of the field may indicate a title or the position of the field may indicate a social security number or the position of the field may indicate a name, etc. If there is any associated spatial context with the field, then flow advances to step S308 in which a text label for that field is inserted into output buffer 32. Thus, if the spatial context of the field indicates that the text in input buffer 31 is a social security number, then step S308 inserts the text &#34;social security number&#34; into output buffer 32. 
     In either event, flow advances to step S309 in which the text characters at the position of pointer 35 in input buffer 31 are sent to output buffer 32. The position of pointer 35 in the output buffer 31 is updated (step S310) and flow thereupon returns to step S303 for inspection of the characters at the new pointer position. 
     Meanwhile, in step S311, text-to-speech converter 26 obtains text from output buffer 32 and converts the text into speech for enunciation by speaker 27 or voice telephone interface 24. It is to be understood that the speaking step shown in step S311 occurs concurrently and independently of the steps which load text and speech commands into output buffer 32. The inclusion of step S311 in FIG. 3 is for illustrative purposes only and is not to be construed as an indication of sequential operation. 
     Reverting to step S306, if that step determines that there are non-spoken characters at the position of pointer 35 then flow advances to step S312 which determined whether the non-spoken characters are associated with intonation and/or speed commands. The determination in step S312 is made by reference to one of reference tables 38, such as the tables shown in FIG. 4(b). As shown in that table, the non-spoken characters at the proper position are compared to mark-up codes which are conventionally used by word processing programs to indicate that a different style is to be used for the succeeding text. For example, a mark-up code &#34;&amp;B&#34; may indicate that the succeeding text is to be printed in bold letters, and a mark-up code &#34;&amp;I&#34; may indicate that the succeeding text is to be printed in italics. If by reference to the table in FIG. 4(b) step S312 determines that the non-spoken characters correspond to mark-up codes, then flow advances to step S313 in which speech commands are obtained from the table and used by speech command generator to insert a speech command into the output buffer 32. For example, if a mark-up code for bold text is detected in step S312, then a speech command for increased emphasis, such as {loud volume} {slow speed} may be inserted into output buffer 32 by speech command generator 37. Likewise, different styles generate different speech commands for different emphasis as set forth in the table. 
     The table in FIG. 4(b) also shows generated text associated with mark-up codes. If desired, it is possible for step S313 also to cause text generator 36 to insert an enunciation of the mark-up code into the output buffer so that the listener may understand fully that the mark-up code has been encountered in the input buffer 31. 
     In step S314, the position of pointer 35 is updated to a position after the mark-up code. Flow then returns to step S303 for inspection of the characters at the new pointer position. 
     If in step S312 the non-spoken characters are not associated with intonation and/or speed commands, then flow advances to step S315 in which parser 34 inspects the non-spoken characters to determine whether they form part of a formatted string of characters. The determination in step S315 is made by reference to one of the reference tables 38, such as the table shown in FIG. 4(c). 
     As shown in FIG. 4(c), the table includes format templates which comprise wild card fields, for example &#34;[F1]&#34;, as well as format data such as &#34;:&#34; and &#34;\&#34;. If parser 34 determines in step S315 that the character string beginning at the position of pointer 35 matches the format of one of the format templates in the reference table of FIG. 4(c), then text generator 36 generates the associated text. Format templates may be provided for several different formats such as computer file designation formats, dates, time-of-day, etc. The format templates illustrated in FIG. 4(c) are for computer file designation formats and time-of-day formats. Thus, for example, if the character string beginning at the position of pointer 35 is &#34;D:\media\images.tif&#34;, then parser 34 will determine in step S315 that the character string matches the format template for a computer file designation which is the first entry in the table of FIG. 4(c). In this example, [F1]=&#34;D&#34;, [F2]=&#34;media&#34;, and [F3]=&#34;images.tif&#34;. Then, in step S316, the character string is converted into a text-equivalent format in accordance with the generated text entry from the table. Thus, in this example, text generator 36 generates the following text: &#34;computer file designation: drive D, media directory, images.tif file&#34;. The text generated by text generator 36 is inserted into the output buffer 32 (step S317). 
     The table shown in FIG. 4(c) may also include speech commands such as {low volume}, etc. so as to place emphasis where important. If speech commands are present then speech command generator 37 generates the needed speech commands and inserts them in the proper sequence with text into output buffer 32. In the foregoing example, speech commands are generated so that &#34;computer text file designation&#34; is spoken with a lower volume than the remainder of the character string. 
     In any event, in step S318, the position of pointer 35 is updated to the position next succeeding the character string that was converted to text-equivalent format and flow returns to step S303 for inspection of the characters at the new pointer position. 
     If in step S315 the non-spoken characters at the pointer position are not part of a formatted string, then flow advances to step S319 where parser 34 determines whether the non-spoken characters are non-spoken punctuation marks. Parser 34 makes this determination by reference to one of reference tables 38, such as the reference table shown in FIG. 4(d). As seen there, each punctuation mark or other non-spoken symbol such as arithmetic symbols is associated with a text phrase which is generated by text generator 36 and inserted into output buffer 32 (step S320). If desired, a speech command may also be stored in the reference table. If present, the speech command is used by speech command generator 37 and is inserted into the appropriate position of output buffer 32. 
     If in step S319 parser 34 does not determine that the non-spoken characters are punctuation marks, then in step S322, parser 34 concludes that the non-spoken characters are simply &#34;noise&#34; characters that should be deleted. For this purpose, parser 34 preferably examines adjacent characters so that even one or two or three spoken characters that are positioned between non-spoken characters are also determined to be &#34;noise&#34;. Examining adjacent characters ensures that characters which are not meant to be spoken but which by chance are speakable, such as the letter &#34;C&#34; embedded in a sequence of non-spoken escape characters, are not inadvertently spoken. 
     In step S323, text generator 36 generates &#34;unprintable text deleted&#34; and inserts that text in output buffer 32 so that it is enunciated as a message to the user by text-to-speech converter 26. In step S324, the noise characters are skipped by updating the position of pointer 35 past the end of the noise characters.