Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.speech.Word
Word
class provides a standard representation of
speakable words for speech engines. A Word
object
provides the following information:
Word
visually.
Word
class allows the specification
of multiple pronunciations and multiple grammatical categories.
Each pronunciation must be approporiate to each category. If not,
separate Word
objects should be created.
All the optional properties of a word are hints to the speech engine. Speech engines will use the information as appropriate for their internal design.
Field Summary | |
static long | ABBREVIATION
Word is an abbreviation or acronynm. |
static long | ADJECTIVE
Grammatical category of word is adjective. |
static long | ADVERB
Grammatical category of word is adverb. |
static long | AUXILIARY
Grammatical category of word is auxiliary. |
static long | CARDINAL
Grammatical category of word is cardinal. |
static long | CONJUNCTION
Grammatical category of word is conjunction. |
static long | CONTRACTION
Grammatical category is contraction. |
static long | DETERMINER
Grammatical category of word is determiner. |
static long | DONT_CARE
Grammatical category of word doesn't matter. |
static long | NOUN
Grammatical category of word is noun. |
static long | OTHER
Other grammatical category of word not specified elsewhere in this class. |
static long | PREPOSITION
Grammatical category of word is preposition. |
static long | PRONOUN
Grammatical category of word is pronoun. |
static long | PROPER_ADJECTIVE
Grammatical category of word is proper adjective. |
static long | PROPER_NOUN
Grammatical category of word is proper noun. |
static long | UNKNOWN
Grammatical category of word is unknown. |
static long | VERB
Grammatical category of word is verb. |
Method Summary | |
long | getCategories()
Get the categories of the Word .
|
String[] | getPronunciations()
Get the pronunciations of the Word .
|
String | getSpokenForm()
Get the "spoken form" of the Word .
|
String | getWrittenForm()
Get the written form of the Word . |
void | setCategories(long cat)
Set the categories of the Word .
|
void | setPronunciations(String[] pron)
Set the pronunciation of the Word as
an array containing a phonetic character String
for each pronunciation of the word.
|
void | setSpokenForm(String text)
Set the "spoken form" of the Word .
|
void | setWrittenForm(String text)
Set the "written form" of the Word .
|
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final long UNKNOWN
0
- and implies
that no other category flag is set.public static final long DONT_CARE
public static final long OTHER
public static final long NOUN
public static final long PROPER_NOUN
public static final long PRONOUN
public static final long VERB
public static final long ADVERB
public static final long ADJECTIVE
public static final long PROPER_ADJECTIVE
public static final long AUXILIARY
public static final long DETERMINER
public static final long CARDINAL
public static final long CONJUNCTION
public static final long PREPOSITION
public static final long CONTRACTION
public static final long ABBREVIATION
Method Detail |
public void setWrittenForm(String text)
Word
.
The written form text should be a string that could be
used to present the Word
visually.public String getWrittenForm()
Word
.public void setSpokenForm(String text)
Word
.
May be null
.
The spoken form of a word is useful for mapping the written form to words that are likely to be handled by a speech recognizer or synthesizer. For example, "JavaSoft" to "java soft", "toString" -> "to string", "IEEE" -> "I triple E".
public String getSpokenForm()
Word
.
Returns null
if the spoken form is not defined.public void setPronunciations(String[] pron)
Word
as
an array containing a phonetic character String
for each pronunciation of the word.
The pronunciation string uses the IPA subset of Unicode.
The string should be null
if no pronunciation is
available. Speech engines should be expected to handle
most words of the language they support.
Recognizers can use pronunciation information to improve recognition accuracy. Synthesizers use the information to accurately speak unusual words (e.g., foreign words).
public String[] getPronunciations()
Word
.
The pronunciation string uses the Unicode IPA subset.
Returns null
if no pronunciations are specified.public void setCategories(long cat)
Word
.
The categories may be UNKNOWN
or may be an
OR'ed set of the defined categories such as NOUN
,
VERB
, PREPOSITION
. For example:
Word w = new Word("running"); w.setCategories(Word.NOUN | Word.VERB);The category information is a guide to the word's grammatical role. Speech synthesizers can use this information to improve phrasing and accenting.
public long getCategories()
Word
.
Value may be UNKNOWN
or an OR'ed set
of the categories defined by this class.Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com