A lexicon class, for accessing a defined lexicon.
SLexicon.name() | Get the name of the lexicon. |
SLexicon.description() | Get a description of the lexicon. |
SLexicon.language() | Get the lexicon language. |
SLexicon.lang_code() | Get the lexicon’s ISO 639-2 language code. |
SLexicon.version() | Get the lexicon’s version. |
SLexicon.get_word(word, features) | Get a word from the lexicon. |
SLexicon.features | Get the features that are defined for the lexicon. |
name()
Get the name of the lexicon.
Returns: | The lexicon name. |
---|---|
Return type: | string |
description()
Get a description of the lexicon.
Returns: | The lexicon description. |
---|---|
Return type: | string |
language()
Get the lexicon language.
Returns: | The lexicon language. |
---|---|
Return type: | string |
lang_code()
Get the lexicon’s ISO 639-2 language code.
Returns: | The ISO 639-2 language code of the lexicon. |
---|---|
Return type: | string |
version()
Get the lexicon’s version.
Returns: | The version of the lexicon (major, minor). |
---|---|
Return type: | tuple |
get_word(word, features)
Get a word from the lexicon.
Parameters: |
|
---|---|
Returns: | The return value is dependent on the word definition in the lexicon, and can be:
As well as a bool value, specifying if the returned list is phones or syllables. If True then syllables were returned, else if False a list of phones were returned. For example: list, syllabified = mylexicon.get_word("hello", None)
|
Return type: | list, bool |
Get the features that are defined for the lexicon.
Returns: | A map of the lexicon features. |
---|---|
Return type: | SMap |