alkove.Lex
class Lex(models: Models)Text to phonemes in fr, en, es, pt, it, ca, ro: Lex’s beam search, word by word.
Methods
Section titled “Methods”phonemize()
Section titled “phonemize()”phonemize(text: Union[str, Sequence[str]], lang: str) -> listThe likeliest pronunciations first, [{ipa, p}]; a list of them for a list of texts.
compile()
Section titled “compile()”compile( text: str, lang: Union[str, Sequence[str]], *, chain: Optional[str] = None,) -> Wordcompile with this Lex: a typed word in one or more of its languages.
distance()
Section titled “distance()”Lex.distance(a: str, b: str) -> float0 = the same sound; a substitution between interchangeable phonemes costs half.
Attributes
Section titled “Attributes”| Attribute | Type | Description |
|---|---|---|
langs |
tuple |
The languages Lex reads. |
inventory |
tuple |
Spot’s 58 phonemes in IPA: the symbols a word between slashes may use (stress and length marks are ignored). |