Utilities to be used in LibreLingo-related-packages
Project description
librelingo_utils
librelingo-utils contains utility functions that are meant to make it easier to create Python software that works with LibreLingo courses.
librelingo_utils.utils
calculate_number_of_levels
calculate_number_of_levels(nwords, nphrases)
Calculates how many levels a skill should have
get_words_from_phrase
get_words_from_phrase(phrase)
Splits a phrase into its component words/terms. Note that this respects grouping with curly braces, i.e. sets of words surrounded by curly braces will not be split from each other.
remove_control_characters_for_display
remove_control_characters_for_display(phrase)
Removes characters with special LibreLingo functions from a phrase before it is displayed to the user. At the moment, this only applies to curly brackets used to group several words into a single mini-dictionary term.
clean_word
clean_word(word)
Remove punctuation and other special characters from a word.
get_dumb_opaque_id
get_dumb_opaque_id(name, id_, salt="")
Generate a unique, opaque ID based on a name, and id_ and a salt id
get_opaque_id
get_opaque_id(obj, salt="")
Generate a unique, opaque ID based on a type and a type specific id
audio_id
audio_id(language, text)
Generate the ID that will identify the audio file of a sentence.
iterate_phrases
iterate_phrases(course)
"Flatten" a course into a sequence of phrases
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for librelingo_utils-2.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab92ebac06d9d47ea23604debdd6b1b3b96d3458a5db3c7e1ed3b91af122c6a |
|
MD5 | feb7e2b88198efea6e6b28dcadfa1ef8 |
|
BLAKE2b-256 | 2f17531dd4888bb88430b3236e48c16c0ee62ff3f7e4ebb8f8512f10b198ffa9 |