**v0.4.1** is an administrative release. It contains no code changes.
On pypi, it also contains the skipped v0.4.0 release. v0.4.0 release notes follow:
**v0.4.0** drops support for Python 3.5, which is EOL. On current versions of Python, this release contains no breaking changes.
Features
New Languages
* Catalan support added by jmontane
* Slovenian formatters added by filips123
Functionality
* `lingua_franca.config` - **will break in v0.5.0** (see note)
- Adds a `config` file, currently containing one variable, `load_langs_on_demand`
- When `lingua_franca.config.load_langs_on_demand` is `True`, LF will allow you to call functions in languages which aren't loaded. In those cases, it will load the language you've called, run the function, and then unload the language. This has pros and cons. Memory consumption is reduced, and you can call LF functions without knowing the language ahead of time, but it's computationally slower than loading the language up front. This is not intended for voice assistants, though a skill or a plugin might use it at its peril.
**NOTE**: `lingua_franca.config` was originally proposed as a proper API, in issue 128. It was temporarily introduced this way because the absence of `load_langs_on_demand` was blocking certain use cases. Work on the full interface has already begun, and is slated for release in LF v0.5.0. Implementations needing this functionality should expect and be prepared for the interface to change in the future.
For reference, the permanent API is represented in PR 185, and will likely be: `lingua_franca.config.set('load_langs_on_demand', True)`
* **(Internal/localization API)** New decorator:`lingua_franca.internal.lookup_variant()` (`lookup_variant(...)`)
Native support for enum parameters in localized functions
A sane parameter in the wrapped function, specified by a sane parameter in the wrapper, will be mapped to an enum, permitting downstream users to call the function without examining a localization's source. The original use case was for localizations that have many ways of expressing the time; coders should be able to specify this using sensibly-named strings, rather than learning about an internal `TimeVariant` enum and its possible values.
See the docstring for a clearer demonstration, and lang/format_ca.py for an example in action.
Language-specific:
* French: Adds support for `extract_duration()` and datetime formatters (courtesy bboutier)
* Dutch: Improves support for `extract_duration()` (courtesy bartdw)
* Polish: Adds support for relative dates, improves support for datetime-related terms (courtesy r0d0dendr0n)
* English: Improves support for ordinal numbers: `extract_number(n, ordinals=True)` returns more intuitive output. Improvements ongoing.
Bugfixes
* Fixed: `parse.extract_datetime()` was not normalizing numbers
* Fixed: `parse.extract_duration()` was not preserving case
* Fixed: English normalizer mishandled multi-word numbers, especially as digits ("four thirty seven" --> 437, not [4, 30, 7])
* Fixed: Localized function wrapper was performing an unnecessary, mildly expensive sanity check every time it was called, even though it only needs to be run when a certain parameter is a nondefault value
Housekeeping
* Lingua Franca CI moved to GitHub Actions
* Lingua Franca will no longer install its tests at setup, nor package them on pypi. They remain in source distributions.
Credits
Any contributors to this release who were not mentioned inline should contact the maintainers, so we can edit these release notes (where possible) to reflect your contributions!
Core maintainers for this release cycle were:
krisgesling
JarbasAl
ChanceNCounter