upstream version 1.2.2
[debian/freetts] / com / sun / speech / freetts / en / us / CMUTimeVoice.java
1 /**
2  * Portions Copyright 2001 Sun Microsystems, Inc.
3  * Portions Copyright 1999-2001 Language Technologies Institute, 
4  * Carnegie Mellon University.
5  * All Rights Reserved.  Use is subject to license terms.
6  * 
7  * See the file "license.terms" for information on usage and
8  * redistribution of this file, and for a DISCLAIMER OF ALL 
9  * WARRANTIES.
10  */
11 package com.sun.speech.freetts.en.us;
12
13 import java.io.IOException;
14 import java.net.URL;
15 import java.util.Locale;
16
17 import com.sun.speech.freetts.Age;
18 import com.sun.speech.freetts.Gender;
19 import com.sun.speech.freetts.ProcessException;
20 import com.sun.speech.freetts.Utterance;
21 import com.sun.speech.freetts.UtteranceProcessor;
22
23 /**
24  * Defines limited domain synthesis voice that specializes
25  * in telling the time.  This is based on data created by
26  * the example time domain voice in FestVox.
27  */
28 public class CMUTimeVoice extends CMUClusterUnitVoice {
29
30     /**
31      * Creates a simple cluster unit voice
32      *
33      * @param name the name of the voice
34      * @param gender the gender of the voice
35      * @param age the age of the voice
36      * @param description a human-readable string providing a
37      * description that can be displayed for the users.
38      * @param locale the locale of the voice
39      * @param domain the domain of this voice.  For example,
40      * @param organization the organization which created the voice
41      * "general", "time", or
42      * "weather".
43      * @param lexicon the lexicon to load
44      * @param database the url to the database containing unit data
45      * for this voice.
46      */
47     public CMUTimeVoice(String name, Gender gender, Age age,
48             String description, Locale locale, String domain,
49             String organization, CMULexicon lexicon, URL database) {
50         super(name, gender, age, description, locale,
51                 domain, organization, lexicon, database);
52     }
53
54     /**
55      * The FestVox voice does not take advantage of any post lexical
56      * processing.  As a result, it doesn't end up getting certain
57      * units that are expected by the typical post lexical processing.
58      * For example, if "the" is followed by a word that begins with
59      * a vowel, the typical post lexical processing will change its
60      * pronunciation from "dh ax" to "dh iy".  We don't want this
61      * in this voice.
62      * 
63      * @return the post lexical analyzer in use by this voice
64      * 
65      * @throws IOException if an IO error occurs while getting
66      *     processor
67      */
68     protected UtteranceProcessor getPostLexicalAnalyzer() throws IOException {
69         /* Do nothing
70          */
71         return new UtteranceProcessor() {
72             public void processUtterance(Utterance utterance)
73                 throws ProcessException {
74             }
75         };
76     }
77     
78     /**
79      * Converts this object to a string
80      * 
81      * @return a string representation of this object
82      */
83     public String toString() {
84         return "CMUTimeVoice";
85     }
86 }