Previous topic

speect.g2p – G2P Class

Next topic

speect.addendum – Addendum Class

speect.phoneset – Phoneset Class

class speect.phoneset.SPhoneset

An phoneset class, for accessing a defined phoneset.

SPhoneset.name() Get the name of the phoneset.
SPhoneset.description() Get a description of the phoneset.
SPhoneset.language() Get the phoneset language.
SPhoneset.lang_code() Get the phoneset’s ISO 639-2 language code.
SPhoneset.version() Get the phoneset’s version.
SPhoneset.phone_has_feature(phone, feature) Query if the phone in the phoneset has the named feature.
SPhoneset.has_phone(phone) Query if the phone is present in the phoneset.
SPhoneset.features Get the features that are defined for the phoneset.
SPhoneset.name()

name()

Get the name of the phoneset.

Returns:The phoneset name.
Return type:string
SPhoneset.description()

description()

Get a description of the phoneset.

Returns:The phoneset description.
Return type:string
SPhoneset.language()

language()

Get the phoneset language.

Returns:The phoneset language.
Return type:string
SPhoneset.lang_code()

lang_code()

Get the phoneset’s ISO 639-2 language code.

Returns:The ISO 639-2 language code of the phoneset.
Return type:string
SPhoneset.version()

version()

Get the phoneset’s version.

Returns:The version of the phoneset (major, minor).
Return type:tuple
SPhoneset.phone_has_feature()

phone_has_feature(phone, feature)

Query if the phone in the phoneset has the named feature. The phones in the phoneset have binary features, i.e. a phone either has a specific named feature or it doesn’t.

Parameters:
  • phone (string) – The phone for which the feature presence is queried.
  • feature (string) – The feature for which the query is done.
Returns:

True if the feature is defined for the given phone, else False. If the given phone is not in the phoneset then False is returned.

Return type:

bool

SPhoneset.has_phone()

has_phone(phone)

Query if the phone is present in the phoneset.

Parameters:phone (string) – The phone for which the query is done.
Returns:True if the phone is defined in the phoneset , else False.
Return type:bool
SPhoneset.features

Get the features that are defined for the phoneset.

Returns:A map of the phoneset features.
Return type:SMap

See also

speect.SMap