Skip to main content

thalovant-languages

Every word a Thalovant component's rule turns on, for every language the fleet supports, in one place and out of every codebase.

A voice satellite waits on "turn off the" because "the" is a continuation word. An intent listing closes "quelle heure est-il" with a question mark because "quelle" opens a question, and reads "volume {level} percent" aloud as "volume cinquante pour cent" in French. A French synthesiser is told to say "onze minutes" where it would swallow a consonant. Each of those is a fact about a language, not about the program that needs it, and each used to be a constant in whichever program needed it first. Here they are data: one directory per language, read by the SDK and by the satellite, and a new language is a directory in this repository rather than an edit to a program.

Layout

src/thalovant_languages/languages/
  scripts.yaml            what a writing system does that no word list can
  en-US/language.yaml     English
  fr-FR/language.yaml     French
  es/language.yaml        Spanish, every region (bare tag)
  de/ it/ pt/ nl/         German, Italian, Portuguese, Dutch
  tr/ az/                 Turkish, Azerbaijani (the dotless i)

A directory is named by a BCP-47 tag: bare (es) when what it says holds for every region, regional (en-US) when it does not. Every key in a language file is optional. A language that states none of them gets no rule at all, never another language's: a wrong question mark reads as a defect, a bare line does not.

Key What a component does with it
continuation_words a partial transcript ending here is mid-thought; the endpoint waits
trailing_words a registered phrase ending here is a prefix waiting for an entity, not a sentence
question_openers a phrase opening here is a question
question_words_anywhere a phrase holding one of these anywhere is a question
question_patterns regular expressions (case-insensitive) that make a phrase a question
written_forms words spelled their own way once a phrase is set as a sentence (i: I)
plural which counts take which form of a counted string; a count listed nowhere is other
slot_examples what a slot becomes when a pattern is read aloud
lowercase_map applied to an all-capitals transcript, in order, before lower()
speech_substitutions rewrites for what a synthesiser is known to mispronounce (pattern, replace, why)

scripts.yaml lists the scripts written without spaces (a partial transcript in one is a single "word", so characters are counted), the scripts where one character is a syllable (how a synthesiser weighs a sentence), and the marks that close a sentence or break a clause, spaced and unspaced.

Use

import thalovant_languages as languages

languages.language("fr-CA")["continuation_words"]   # the French file
languages.words("en", "trailing_words")             # lower-cased, as a set
languages.language("zh")                            # {} -- nothing describes it
languages.script_pattern("unspaced").search("今天") # a character of an unspaced script
languages.marks("sentence_ends", "spaced")          # ".!?…;"

A language is found by the matcher the rest of OVOS uses (ovos_spec_tools.language): fr-CA reads fr-FR, pt-BR reads pt, and a language nothing describes gets an empty mapping.

THALOVANT_LANGUAGES_DIR=/path/to/checkout/src/thalovant_languages/languages reads a checkout instead of the installed data, for trying a language before it is released; languages.refresh() forgets what was read after changing it.

Adding a language

  1. Add src/thalovant_languages/languages/<tag>/language.yaml with the keys the language needs, each with a comment saying why the words are there. Quote a word YAML would read as something else ("on", "no").
  2. Run thalovant-languages check (or pytest). It refuses a key no component reads, a pattern that does not compile, a plural category that is not one, and a list holding a boolean.
  3. Open a pull request. Merging to main releases the package; the SDK and the satellite pick the language up when they move their pin.

Who reads it

  • thalovant (the Python SDK): thalovant.listing sets a registered pattern the way a person reads it, ranks phrases, and reads slots aloud.
  • thalovant-voice (the satellite): the semantic endpoint's continuation words, the lower-casing of an all-capitals transcript, the plural forms of its own counted text, and the synthesiser's pronunciation repairs.

Nothing here parses dates, numbers or colours; the OVOS parsers do that for skills on the hub. Contractions come from ovos-utterance-normalizer, which already carries them.

Metadata

Release files for thalovant-languages 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thalovant-languages 0.1.0
File Size Uploaded
thalovant_languages-0.1.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thalovant-languages 0.1.0
File Interpreter ABI Platform
thalovant_languages-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.8 kB

Release files / thalovant_languages-0.1.0.tar.gz

Download URL thalovant_languages-0.1.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f3ed83b20db6a5cb2db4b0c5c1a3a07c430a61073634bdc22584cdc7a258a3e8
BLAKE2b-256 checksum
How to use checksums
a70a5dc720256fc60ab2c69bbb65184e1db3d1f6da2c9e47035886b4d65e30f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / thalovant_languages-0.1.0-py3-none-any.whl

Download URL thalovant_languages-0.1.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b80052e75733444371127d48e8071dfc7c79a6bbb120ff802280d2694573a87
BLAKE2b-256 checksum
How to use checksums
938d92d197477327a3857e8f9b49639a4c0586132fd412dd4e5d075561997c33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page