public class TtsSpan extends Object implements ParcelableSpan
TYPE_DATE
or TYPE_MEASURE
. And a list of arguments, provided as
key-value pairs in a bundle.
The inner classes are there for convenience and provide builders for each
TtsSpan type.Modifier and Type | Class and Description |
---|---|
static class |
TtsSpan.Builder<C extends TtsSpan.Builder<?>>
A simple builder for TtsSpans.
|
static class |
TtsSpan.CardinalBuilder
A builder for TtsSpans of type
TYPE_CARDINAL . |
static class |
TtsSpan.DateBuilder
A builder for TtsSpans of type
TYPE_DATE . |
static class |
TtsSpan.DecimalBuilder
A builder for TtsSpans of type
TYPE_DECIMAL . |
static class |
TtsSpan.DigitsBuilder
A builder for TtsSpans of type
TYPE_DIGITS . |
static class |
TtsSpan.ElectronicBuilder
A builder for TtsSpans of type
TYPE_ELECTRONIC . |
static class |
TtsSpan.FractionBuilder
A builder for TtsSpans of type
TYPE_FRACTION . |
static class |
TtsSpan.MeasureBuilder
A builder for TtsSpans of type
TYPE_MEASURE . |
static class |
TtsSpan.MoneyBuilder
A builder for TtsSpans of type
TYPE_MONEY . |
static class |
TtsSpan.OrdinalBuilder
A builder for TtsSpans of type
TYPE_ORDINAL . |
static class |
TtsSpan.SemioticClassBuilder<C extends TtsSpan.SemioticClassBuilder<?>>
A builder for TtsSpans, has setters for morphosyntactic features.
|
static class |
TtsSpan.TelephoneBuilder
A builder for TtsSpans of type
TYPE_TELEPHONE . |
static class |
TtsSpan.TextBuilder
A builder for TtsSpans of type
TYPE_TEXT . |
static class |
TtsSpan.TimeBuilder
A builder for TtsSpans of type
TYPE_TIME . |
static class |
TtsSpan.VerbatimBuilder
A builder for TtsSpans of type
TYPE_VERBATIM . |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
ANIMACY_ANIMATE |
static String |
ANIMACY_INANIMATE |
static String |
ARG_ANIMACY
String argument supplying animacy information.
|
static String |
ARG_CASE
String argument supplying case information.
|
static String |
ARG_COUNTRY_CODE
Argument used to specify the country code of a telephone number.
|
static String |
ARG_CURRENCY
Argument used to specify the currency.
|
static String |
ARG_DAY
Argument used to specify the day of the month of a date.
|
static String |
ARG_DENOMINATOR
Argument used to specify the denominator of a fraction.
|
static String |
ARG_DIGITS
Argument used to specify a string of digits.
|
static String |
ARG_DOMAIN
Argument used to specify the domain part of a URI.
|
static String |
ARG_EXTENSION
Argument used to specify the extension part of a telephone number.
|
static String |
ARG_FRACTIONAL_PART
Argument used to specify the fractional part of a decimal.
|
static String |
ARG_FRAGMENT_ID
Argument used to specify the fragment id of a URI.
|
static String |
ARG_GENDER
String argument supplying gender information.
|
static String |
ARG_HOURS
Argument used to specify the hours of a time.
|
static String |
ARG_INTEGER_PART
Argument used to specify the integer part of a decimal or fraction.
|
static String |
ARG_MINUTES
Argument used to specify the minutes of a time.
|
static String |
ARG_MONTH
Argument used to specify the month of a date.
|
static String |
ARG_MULTIPLICITY
String argument supplying multiplicity information.
|
static String |
ARG_NUMBER
Argument used to specify a whole number.
|
static String |
ARG_NUMBER_PARTS
Argument used to specify the main number part of a telephone number.
|
static String |
ARG_NUMERATOR
Argument used to specify the numerator of a fraction.
|
static String |
ARG_PASSWORD
Argument used to specify the password part of a URI.
|
static String |
ARG_PATH
Argument used to specify the path part of a URI.
|
static String |
ARG_PORT
Argument used to specify the port number of a URI.
|
static String |
ARG_PROTOCOL
Argument used to specify the protocol of a URI.
|
static String |
ARG_QUANTITY
Argument used to choose the suffix (thousand, million, etc) that is used
to pronounce large amounts of money.
|
static String |
ARG_QUERY_STRING
Argument used to specify the query string of a URI.
|
static String |
ARG_TEXT
String supplying the text to be synthesized.
|
static String |
ARG_UNIT
Argument used to specify the unit of a measure.
|
static String |
ARG_USERNAME
Argument used to specify the username part of a URI.
|
static String |
ARG_VERBATIM
Argument used to specify a string where the characters are read verbatim,
except whitespace.
|
static String |
ARG_WEEKDAY
Argument used to specify the weekday of a date.
|
static String |
ARG_YEAR
Argument used to specify the year of a date.
|
static String |
CASE_ABLATIVE |
static String |
CASE_ACCUSATIVE |
static String |
CASE_DATIVE |
static String |
CASE_GENITIVE |
static String |
CASE_INSTRUMENTAL |
static String |
CASE_LOCATIVE |
static String |
CASE_NOMINATIVE |
static String |
CASE_VOCATIVE |
static String |
GENDER_FEMALE |
static String |
GENDER_MALE |
static String |
GENDER_NEUTRAL |
static int |
MONTH_APRIL |
static int |
MONTH_AUGUST |
static int |
MONTH_DECEMBER |
static int |
MONTH_FEBRUARY |
static int |
MONTH_JANUARY |
static int |
MONTH_JULY |
static int |
MONTH_JUNE |
static int |
MONTH_MARCH |
static int |
MONTH_MAY |
static int |
MONTH_NOVEMBER |
static int |
MONTH_OCTOBER |
static int |
MONTH_SEPTEMBER |
static String |
MULTIPLICITY_DUAL |
static String |
MULTIPLICITY_PLURAL |
static String |
MULTIPLICITY_SINGLE |
static String |
TYPE_CARDINAL
The text associated with this span is a cardinal.
|
static String |
TYPE_DATE
The text associated with this span is a date.
|
static String |
TYPE_DECIMAL
The text associated with this span is a decimal number.
|
static String |
TYPE_DIGITS
The text associated with this span is a series of digits that have to be
read sequentially.
|
static String |
TYPE_ELECTRONIC
The text associated with this span is a URI (can be used for URLs and
email addresses).
|
static String |
TYPE_FRACTION
The text associated with this span is a fractional number.
|
static String |
TYPE_MEASURE
The text associated with this span is a measure, consisting of a number
and a unit.
|
static String |
TYPE_MONEY
The text associated with this span is an amount of money.
|
static String |
TYPE_ORDINAL
The text associated with this span is an ordinal.
|
static String |
TYPE_TELEPHONE
The text associated with this span is a telephone number.
|
static String |
TYPE_TEXT
This span type can be used to add morphosyntactic features to the text it
spans over, or synthesize a something else than the spanned text.
|
static String |
TYPE_TIME
The text associated with this span is a time, consisting of a number of
hours and minutes, specified with
ARG_HOURS and
ARG_MINUTES . |
static String |
TYPE_VERBATIM
The text associated with this span is a series of characters that have to
be read verbatim.
|
static int |
WEEKDAY_FRIDAY |
static int |
WEEKDAY_MONDAY |
static int |
WEEKDAY_SATURDAY |
static int |
WEEKDAY_SUNDAY |
static int |
WEEKDAY_THURSDAY |
static int |
WEEKDAY_TUESDAY |
static int |
WEEKDAY_WEDNESDAY |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
TtsSpan(Parcel src) |
TtsSpan(String type,
PersistableBundle args) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
PersistableBundle |
getArgs()
Returns a bundle of the arguments set.
|
int |
getSpanTypeId()
Return a special type identifier for this span class.
|
int |
getSpanTypeIdInternal()
Internal implementation of
ParcelableSpan.getSpanTypeId() that is not meant to
be overridden outside of the framework. |
String |
getType()
Returns the type.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
void |
writeToParcelInternal(Parcel dest,
int flags)
Internal implementation of
Parcelable.writeToParcel(Parcel, int)
that is not meant to be overridden outside of the framework. |
public static final String TYPE_TEXT
ARG_TEXT
to set a different text.
Accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_CARDINAL
ARG_NUMBER
.
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_ORDINAL
ARG_NUMBER
.
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_DECIMAL
ARG_INTEGER_PART
and
ARG_FRACTIONAL_PART
.
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_FRACTION
ARG_NUMERATOR
and
ARG_DENOMINATOR
. ARG_INTEGER_PART
is optional
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_MEASURE
TYPE_CARDINAL
,
TYPE_DECIMAL
or TYPE_FRACTION
. The unit can be
specified with ARG_UNIT
.
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_TIME
ARG_HOURS
and
ARG_MINUTES
.
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and
ARG_CASE
.public static final String TYPE_DATE
ARG_MONTH
and ARG_YEAR
has to be provided.
The argument ARG_DAY
is optional if ARG_MONTH
is set.
The argument ARG_WEEKDAY
is optional if ARG_DAY
is set.
Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
,
ARG_MULTIPLICITY
and ARG_CASE
.public static final String TYPE_TELEPHONE
ARG_NUMBER_PARTS
is required. ARG_COUNTRY_CODE
and
ARG_EXTENSION
are optional.
Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
,
ARG_MULTIPLICITY
and ARG_CASE
.public static final String TYPE_ELECTRONIC
ARG_PROTOCOL
, ARG_USERNAME
, ARG_PASSWORD
,
ARG_DOMAIN
, ARG_PORT
, ARG_PATH
,
ARG_QUERY_STRING
and ARG_FRAGMENT_ID
.
Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
,
ARG_MULTIPLICITY
and ARG_CASE
.public static final String TYPE_MONEY
TYPE_DECIMAL
.
ARG_CURRENCY
is used to set the currency. ARG_QUANTITY
is optional.
Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
,
ARG_MULTIPLICITY
and ARG_CASE
.public static final String TYPE_DIGITS
ARG_DIGITS
.
Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
,
ARG_MULTIPLICITY
and ARG_CASE
.public static final String TYPE_VERBATIM
ARG_VERBATIM
is required.
Also accepts the arguments ARG_GENDER
,
ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.public static final String ARG_GENDER
GENDER_NEUTRAL
, GENDER_MALE
and
GENDER_FEMALE
.public static final String GENDER_NEUTRAL
public static final String GENDER_MALE
public static final String GENDER_FEMALE
public static final String ARG_ANIMACY
ANIMACY_ANIMATE
or
ANIMACY_INANIMATE
public static final String ANIMACY_ANIMATE
public static final String ANIMACY_INANIMATE
public static final String ARG_MULTIPLICITY
MULTIPLICITY_SINGLE
, MULTIPLICITY_DUAL
and
MULTIPLICITY_PLURAL
public static final String MULTIPLICITY_SINGLE
public static final String MULTIPLICITY_DUAL
public static final String MULTIPLICITY_PLURAL
public static final String ARG_CASE
CASE_NOMINATIVE
, CASE_ACCUSATIVE
, CASE_DATIVE
,
CASE_ABLATIVE
, CASE_GENITIVE
, CASE_VOCATIVE
,
CASE_LOCATIVE
and CASE_INSTRUMENTAL
public static final String CASE_NOMINATIVE
public static final String CASE_ACCUSATIVE
public static final String CASE_DATIVE
public static final String CASE_ABLATIVE
public static final String CASE_GENITIVE
public static final String CASE_VOCATIVE
public static final String CASE_LOCATIVE
public static final String CASE_INSTRUMENTAL
public static final String ARG_TEXT
TYPE_TEXT
.public static final String ARG_NUMBER
TYPE_CARDINAL
and TYPE_ORDINAL
.public static final String ARG_INTEGER_PART
TYPE_DECIMAL
and TYPE_FRACTION
.public static final String ARG_FRACTIONAL_PART
TYPE_DECIMAL
.public static final String ARG_QUANTITY
ARG_INTEGER_PART
argument is "10", the
ARG_FRACTIONAL_PART
argument is "4", the ARG_QUANTITY
argument is "1000" and the ARG_CURRENCY
argument is "usd", the
TTS engine may pronounce the span as "ten point four thousand dollars".
With the same example but with the quantity set as "1000000" the TTS
engine may pronounce the span as "ten point four million dollars".
Can be used with TYPE_MONEY
.public static final String ARG_NUMERATOR
TYPE_FRACTION
.public static final String ARG_DENOMINATOR
TYPE_FRACTION
.public static final String ARG_UNIT
TYPE_MEASURE
.public static final String ARG_HOURS
TYPE_TIME
.public static final String ARG_MINUTES
TYPE_TIME
.public static final String ARG_WEEKDAY
WEEKDAY_SUNDAY
,
WEEKDAY_MONDAY
, WEEKDAY_TUESDAY
,
WEEKDAY_WEDNESDAY
, WEEKDAY_THURSDAY
,
WEEKDAY_FRIDAY
and WEEKDAY_SATURDAY
.
Can be used with TYPE_DATE
.public static final int WEEKDAY_SUNDAY
public static final int WEEKDAY_MONDAY
public static final int WEEKDAY_TUESDAY
public static final int WEEKDAY_WEDNESDAY
public static final int WEEKDAY_THURSDAY
public static final int WEEKDAY_FRIDAY
public static final int WEEKDAY_SATURDAY
public static final String ARG_DAY
TYPE_DATE
.public static final String ARG_MONTH
MONTH_JANUARY
,
MONTH_FEBRUARY
, MONTH_MARCH
, MONTH_APRIL
,
MONTH_MAY
, MONTH_JUNE
, MONTH_JULY
,
MONTH_AUGUST
, MONTH_SEPTEMBER
, MONTH_OCTOBER
,
MONTH_NOVEMBER
and MONTH_DECEMBER
.
Can be used with TYPE_DATE
.public static final int MONTH_JANUARY
public static final int MONTH_FEBRUARY
public static final int MONTH_MARCH
public static final int MONTH_APRIL
public static final int MONTH_MAY
public static final int MONTH_JUNE
public static final int MONTH_JULY
public static final int MONTH_AUGUST
public static final int MONTH_SEPTEMBER
public static final int MONTH_OCTOBER
public static final int MONTH_NOVEMBER
public static final int MONTH_DECEMBER
public static final String ARG_YEAR
TYPE_DATE
.public static final String ARG_COUNTRY_CODE
TYPE_TELEPHONE
.public static final String ARG_NUMBER_PARTS
TYPE_TELEPHONE
.public static final String ARG_EXTENSION
TYPE_TELEPHONE
.public static final String ARG_PROTOCOL
TYPE_ELECTRONIC
.public static final String ARG_USERNAME
TYPE_ELECTRONIC
.public static final String ARG_PASSWORD
TYPE_ELECTRONIC
.public static final String ARG_DOMAIN
TYPE_ELECTRONIC
.public static final String ARG_PORT
TYPE_ELECTRONIC
.public static final String ARG_PATH
TYPE_ELECTRONIC
.public static final String ARG_QUERY_STRING
TYPE_ELECTRONIC
.public static final String ARG_FRAGMENT_ID
TYPE_ELECTRONIC
.public static final String ARG_CURRENCY
TYPE_MONEY
.public static final String ARG_DIGITS
TYPE_DIGITS
.public static final String ARG_VERBATIM
TYPE_VERBATIM
.public TtsSpan(String type, PersistableBundle args)
public TtsSpan(Parcel src)
public String getType()
public PersistableBundle getArgs()
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public void writeToParcelInternal(Parcel dest, int flags)
ParcelableSpan
Parcelable.writeToParcel(Parcel, int)
that is not meant to be overridden outside of the framework.writeToParcelInternal
in interface ParcelableSpan
public int getSpanTypeId()
ParcelableSpan
getSpanTypeId
in interface ParcelableSpan
public int getSpanTypeIdInternal()
ParcelableSpan
ParcelableSpan.getSpanTypeId()
that is not meant to
be overridden outside of the framework.getSpanTypeIdInternal
in interface ParcelableSpan