Releases: MycroftAI/lingua-franca
سلام دنیا (Salaam Donya)
Hallo Wereld
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
isTrue
, 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 ofload_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)
- Adds a
-
(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
Hola Món
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
isTrue
, 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 ofload_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)
- Adds a
-
(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
v0.3.1 Witaj świecie II
Hotfix: Patches a severe bug in v0.3.0 causing default arguments to throw DeprecationWarnings.
Also fixed:
- Czech tests were re-running tests from other languages (@Tony763)
- Hard-to-reach bug in a warning routine
- Ensure key files are included in source distribution packages
Version 0.3.0 release notes follow:
v0.3.0 of Lingua Franca brings a significant restructure to the code base courtesy of @ChanceNCounter. This provides a strong basis for adding new languages and expanding the available functions.
Anyone interested in contributing to Lingua Franca, please see the new project-structure.md. This covers the new file structure, how to add localized versions of existing functions, and how to add new top-level functions. The primary README.md also contains a detailed step by step guide to get started contributing to the project.
This version also brings initial support for the Polish language, courtesy of @rafaljanicki.
Breaking change:
-
You must now explicitly load one or more languages. Functions will default to whichever language is loaded first, unless a new default is specified.
lingua_franca.load_language('en') # 'primary' lang code (package's terminology) lingua_franca.load_language('pt-pt') # full lang code lingua_franca.load_languages(['en', 'es']) # multiple languages at once, first will be default lingua_franca.set_default_lang('es') # self-explanatory
Deprecated:
- Explicitly passing
None
for arguments (eglang=None
) in order to fallback to a default is no longer supported. This was previously included to handle some edge case in Mycroft-core that no longer exists. If nolang
is passed then the default language will be used. - Direct imports from
lingua_franca.lang
have been deprecated. Getter and setter methods are now available to perform these functions.
Other:
- Code is now tested against Python 3.9. Please note that Python 3.5 support will soon be dropped as it has reached end of life.
- Thanks also to @YuukanOO for improvements to
extract_number()
across a number of languages.
v0.3.0 Witaj świecie
v0.3.0 of Lingua Franca brings a significant restructure to the code base courtesy of @ChanceNCounter. This provides a strong basis for adding new languages and expanding the available functions.
Anyone interested in contributing to Lingua Franca, please see the new project-structure.md. This covers the new file structure, how to add localized versions of existing functions, and how to add new top-level functions. The primary README.md also contains a detailed step by step guide to get started contributing to the project.
This version also brings initial support for the Polish language, courtesy of @rafaljanicki.
Breaking change:
-
You must now explicitly load one or more languages. Functions will default to whichever language is loaded first, unless a new default is specified.
lingua_franca.load_language('en') # 'primary' lang code (package's terminology) lingua_franca.load_language('pt-pt') # full lang code lingua_franca.load_languages(['en', 'es']) # multiple languages at once, first will be default lingua_franca.set_default_lang('es') # self-explanatory
Deprecated:
- Explicitly passing
None
for arguments (eglang=None
) in order to fallback to a default is no longer supported. This was previously included to handle some edge case in Mycroft-core that no longer exists. If nolang
is passed then the default language will be used. - Direct imports from
lingua_franca.lang
have been deprecated. Getter and setter methods are now available to perform these functions.
Other:
- Code is now tested against Python 3.9. Please note that Python 3.5 support will soon be dropped as it has reached end of life.
- Thanks also to @YuukanOO for improvements to
extract_number()
across a number of languages.
v0.2.3 Hallo Welt
This is the final v0.2.x release and provides a few improvements and fixes that are fully compatible with prior versions. The next v0.3.0 release will include a major refactor so upgrades from this release should be well tested.
Improvements:
extract_duration()
runtime reduced by combining regexes (fixed by @maxbachmann in PR #124)- Installation instructions clarified to suggest the users install
wheel
andpytest
(by @adocampo in PR #115)
Fixes:
- A debug print left in the code by mistake (fixed by @maxbachmann in PR #123)
- SyntaxWarning caused by inappropriate use of 'is' in a formatter (fixed by @PureTryOut in PR #127)
Typos:
v0.2.2 Saluton Mondo
This release contains two hotfixes and a new localization. No breaking changes.
Fixes:
- Bug: In certain languages,
parse.extract_datetime()
returns 08:00 when no datetime is found, instead of returningNone
(Issue #117, PR #118) - Error: SyntaxWarnings in newer Python releases, caused by misuse of
is
inlingua_franca.format
(PR #112)
New Localizations:
parse.extract_duration()
localized for German/primary lang codede
(PR #119)
Contributors:
- @forslund (
extract_datetime()
fix) - @PureTryOut (
SyntaxWarning
fix) - @emphasize (
extract_duration()
to German)
and a big thanks to @ChanceNCounter for facilitating the release!
v0.2.1 Hola Mundo
This release fixes a couple of issues regarding extracting numbers.
- Handle capital letters properly #85
- Fix issue with leading hundreds #86
- Fix even multiples of 10 #81
- Make language versions of extract_number use the same signature #77
In addition a couple of other minor fixes:
- Fix pronounce_number for numbers < 1.0
- Fix broken Spanish test #78
v0.2.0 Hej världen
Sync with mycroft-core changes.
- Improved Swedish datetime parsing
- Fix handling % characters for English and Portuguese
- Improved Spanish datetime parsing
v0.1.0 Bom Dia
The first official release of Lingua Franca as a stand alone package.