Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class javax.speech.Word

java.lang.Object
  |
  +--javax.speech.Word

public class Word
extends Object
The Word class provides a standard representation of speakable words for speech engines. A Word object provides the following information: The written form string is required. The other properties are optional. Typically, one or more of the optional properties are specified. The 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.

See Also:
VocabManager, getVocabManager

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

UNKNOWN

public static final long UNKNOWN
Grammatical category of word is unknown. The value is zero - 0 - and implies that no other category flag is set.

DONT_CARE

public static final long DONT_CARE
Grammatical category of word doesn't matter.

OTHER

public static final long OTHER
Other grammatical category of word not specified elsewhere in this class.

NOUN

public static final long NOUN
Grammatical category of word is noun. English examples: "car", "house", "elephant".

PROPER_NOUN

public static final long PROPER_NOUN
Grammatical category of word is proper noun. English examples: "Yellowstone", "Singapore".

PRONOUN

public static final long PRONOUN
Grammatical category of word is pronoun. English examples: "me", "I", "they".

VERB

public static final long VERB
Grammatical category of word is verb. English examples: "run", "debug", "integrate".

ADVERB

public static final long ADVERB
Grammatical category of word is adverb. English examples: "slowly", "loudly", "barely", "very", "never".

ADJECTIVE

public static final long ADJECTIVE
Grammatical category of word is adjective. English examples: "red", "mighty", "very", "first", "eighteenth".

PROPER_ADJECTIVE

public static final long PROPER_ADJECTIVE
Grammatical category of word is proper adjective. English examples: "British", "Brazilian".

AUXILIARY

public static final long AUXILIARY
Grammatical category of word is auxiliary. English examples: "have", "do", "is", "shall", "must", "cannot".

DETERMINER

public static final long DETERMINER
Grammatical category of word is determiner. English examples: "the", "a", "some", "many", "his", "her".

CARDINAL

public static final long CARDINAL
Grammatical category of word is cardinal. English examples: "one", "two", "million".

CONJUNCTION

public static final long CONJUNCTION
Grammatical category of word is conjunction. English examples: "and", "or", "since", "if".

PREPOSITION

public static final long PREPOSITION
Grammatical category of word is preposition. English examples: "of", "for".

CONTRACTION

public static final long CONTRACTION
Grammatical category is contraction. English examples: "don't", "can't".

ABBREVIATION

public static final long ABBREVIATION
Word is an abbreviation or acronynm. English examples: "Mr.", "USA".
Method Detail

setWrittenForm

public void setWrittenForm(String text)
Set the "written form" of the Word. The written form text should be a string that could be used to present the Word visually.

getWrittenForm

public String getWrittenForm()
Get the written form of the Word.

setSpokenForm

public void setSpokenForm(String text)
Set the "spoken form" of the 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".


getSpokenForm

public String getSpokenForm()
Get the "spoken form" of the Word. Returns null if the spoken form is not defined.

setPronunciations

public void setPronunciations(String[] pron)
Set the pronunciation of the 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).


getPronunciations

public String[] getPronunciations()
Get the pronunciations of the Word. The pronunciation string uses the Unicode IPA subset. Returns null if no pronunciations are specified.

setCategories

public void setCategories(long cat)
Set the categories of the 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.

getCategories

public long getCategories()
Get the categories of the 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