The Word
class provides a standard representation of
speakable words for speech engines. A Word
object
provides the following information:
Word
visually.
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 appropriate 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.
#VocabManager
Engine#getVocabManager
Consts Summary: | |
long long | UNKNOWN = 0 |
long long | DONT_CARE = 1 |
long long | OTHER = 2 |
long long | NOUN = 4 |
long long | PROPER_NOUN = 8 |
long long | PRONOUN = 16 |
long long | VERB = 32 |
long long | ADVERB = 64 |
long long | ADJECTIVE = 128 |
long long | PROPER_ADJECTIVE = 256 |
long long | AUXILIARY = 512 |
long long | DETERMINER = 1024 |
long long | CARDINAL = 2048 |
long long | CONJUNCTION = 4096 |
long long | PREPOSITION = 8192 |
long long | CONTRACTION = 16384 |
long long | ABBREVIATION = 32768 |
Operations Summary: | |
void | initWithDetails(in string writtenForm, in string spokenForm, in StringArray pron, in long long cat) |
long long | getCategories() |
StringArray | getPronunciations() |
string | getSpokenForm() |
string | getWrittenForm() |
void | setCategories(in long long cat) |
void | setPronunciations(in StringArray pron) |
void | setSpokenForm(in string text) |
void | setWrittenForm(in string text) |
Operations Inherited from Bonobo::Unknown | |
ref, unref, queryInterface |
Const Details: |
Grammatical category of word is unknown.
The value is zero - 0
- and implies
that no other category flag is set.
Grammatical category of word doesn't matter.
Other grammatical category of word not specified elsewhere in this class.
Grammatical category of word is noun. English examples: "car", "house", "elephant".
Grammatical category of word is proper noun. English examples: "Yellowstone", "Singapore".
Grammatical category of word is pronoun. English examples: "me", "I", "they".
Grammatical category of word is verb. English examples: "run", "debug", "integrate".
Grammatical category of word is adverb. English examples: "slowly", "loudly", "barely", "very", "never".
Grammatical category of word is adjective. English examples: "red", "mighty", "very", "first", "eighteenth".
Grammatical category of word is proper adjective. English examples: "British", "Brazilian".
Grammatical category of word is auxiliary. English examples: "have", "do", "is", "shall", "must", "cannot".
Grammatical category of word is determiner. English examples: "the", "a", "some", "many", "his", "her".
Grammatical category of word is cardinal. English examples: "one", "two", "million".
Grammatical category of word is conjunction. English examples: "and", "or", "since", "if".
Grammatical category of word is preposition. English examples: "of", "for".
Grammatical category is contraction. English examples: "don't", "can't".
Word is an abbreviation or acronynm. English examples: "Mr.", "USA".
Operation Details: |
Initialise, setting the pronunciations, spoken form, written form, and categories.
Word
.Word
.Word
.Word
.
Get the categories of the Word
.
Value may be UNKNOWN
or an OR'ed set of the
categories defined by this class.
Get the pronunciations of the Word
.
The pronunciation string uses the UTF8 IPA subset.
Returns null
if no pronunciations are specified.
Word
.
Get the "spoken form" of the Word
.
Returns null
if the spoken form is not defined.
Word
.
Get the written form of the Word
.
Word
.
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
.
The category information is a guide to the word's grammatical role. Speech synthesizers can use this information to improve phrasing and accenting.
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 UTF8.
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).
Word
.
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".
Word
.
Set the "written form" of the Word
.
The written form text should be a string that could be
used to present the Word
visually.
Word
.