Changelog

This is the documentation for 4.2.0 version, which is not the latest version. Consider upgrading to 4.3.0.

[4.2.0] - 2023-07-16

Added

  • fix mode synonym once when calling runSynz using rosaenlg-lib

Changed

  • changed to node 16

  • switched to TypeScript 5 - which should have not impact at runtime

  • now uses Antora 5 to generate the documentation website - which should have not impact except potentially on documentation

[4.1.0] - 2023-04-07

Added

  • For French only, in sentence mixin, ability to insert a adverb modifier before the direct object, using modifierAdverb, e.g. to generate Le directeur ne prête pas souvent sa camionnette à ses élèves.

Fixed

  • fix inconsistent space in value function in no-pug mode

  • fix French possessive determiners in case of vowel hiatus

  • updated transitive verbs list for French

  • rosaenlg-parallel-poc works again

Changed

[4.0.0] - 2023-03-08

Added

  • new getters in noPugmode to provide smoother integration with typescript

  • For French and English only, in sentence mixin, ability to generate a negative sentence, using negative: true, e.g. to generate she is not giving it, she hasn’t it in English, and il ne les lui a pas données, ils n’ont jamais conduit in French.

  • For French and English only, in sentence mixin, ability to generate a subject personal pronoun (I, you etc. in English, je, tu etc. in French), using person property in subjectGroup.

  • For French only, in value and sentence mixins, ability to generate a possessive determiner, using personOwner: 1, e.g. to generate ma maison, ta maison. The personOwner parameter is also available in the sentence mixin subject and object groups.

Changed

  • #174: the initial rosaenlg package is split in two packages: a rosaenlg-lib package, without any Pug dependency, to be used (1) in 'noPug' mode, and (2) by the rosaenlg package (for templates), and a rosaenlg package, using the rosaenlg-lib package for usage within templates, and having the Pug dependencies. For 'noPug' mode users, this requires to now use the rosaenlg-lib package.

  • Documentation from versions below 3.0.0 is no more published. 3.0.0 was released 2021-05-06. Main driver is build performance: building the full doc on all versions took ages.

[3.4.0] - 2023-02-27

Added

  • sentence mixin to generate complete sentences using a description tree with subject, verb, complement. Support is beta (work in progress) and limited to French and English. See Sentences documentation.

Fixed

  • The rosaenlg/cli docker image did not exist for the previous version

  • #161: tests on dates were creating dates using UTC, then displaying them locally, which could lead to inconsistencies when running the tests in some time zones

[3.3.1] - 2023-02-12

Fixed

  • #158: nested protect structures are now properly handled; they became common because of the auto protection of numbers (from 3.2.4)

Changed

  • The html tags are now cleanup up before calling chooseBest, which can have an impact on regression testing (yet the text output should be improved)

[3.3.0] - 2023-02-07

Added

  • #154: it is now possible to reuse the context from one run to another, e.g. keeping the knowledge of what was said, the synonyms triggered etc. See Save context documentation.

Fixed

  • Morph-it! italian linguistic resource: explicit use of Creative Commons Attribution ShareAlike 2.0 License (vs the GNU Lesser General Public License)

[3.2.6] - 2022-10-30

Fixed

  • #152: Hn tags (<h1>, <h2> etc.) are now considered as structure tags (like <p>), thus having capitalization

  • #150: when we had a span around a word, the space after that word were eaten (thanks blegaut)

Changed

  • #148: on bulleted lists, use list_last_end_item to have a specific ending for the last item in the list

[3.2.5] - 2022-08-02

Added

  • #100: adds official names of the countries, instead of just common names, e.g. French Republic while France is the common name

Fixed

  • #131: suppressed wrong dependencies of english-verb-helper

  • dependency updates to solve some security issues

[3.2.4] - 2022-07-08

Added

  • #127: in French, "de des" contracts in "de"

  • #128: (most) raw numbers are automatically protected from filtering

[3.2.3] - 2022-06-18

Added

  • added zh_CN language, with only one feature: no extra spaces added when enumerating elements

Changed

  • cleaned space management

[3.2.2] - 2022-04-21

Added

  • #124: #[+value(1, {'TEXTUAL':true, agree: getAnonFS() })] now outputs une in French

Fixed

  • Empty bullet lists no longer write ul start and end tag

  • eatSpace symbol can now work without space before or after

  • clearer error message when giving a gender instead of an object that should have a gender

[3.2.1] - 2022-03-15

Added

  • doc: adding the docker recipe from reinoldus to cook templates into a new docker image

Fixed

  • ` with ` keyword for an assembly in eachz no longer matching if it appears as text in the assembly

[3.2.0] - 2022-01-22

Added

Fixed

  • #112: in French, "ainsi que à les" now contracts as "ainsi qu’aux"

[3.1.2] - 2022-01-04

Fixed

Changed

  • doc: indexation will remain every 48 hours and automatic

[3.1.1] - 2022-01-04

Changed

  • doc: newer version of Algolia for search

  • doc: changelog cut in different parts for better indexation

[3.1.0] - 2021-12-28

Added

  • support for PARTICIPLE_PRESENT and PARTICIPLE_PAST in English tenses (as requested in #84)

  • synonyms: {mode: 'once'} now avoids to trigger last triggered alternative after a reset (#110)

[3.0.4] - 2021-12-23

Added

  • #103: value tag now accepts a mixin as first argument

Fixed

  • dependencies update

[3.0.3] - 2021-12-04

Fixed

  • bug #97: fixes spaces in tag name interpolation and attributes (thanks Mathias)

[3.0.2] - 2021-10-19

Fixed

  • curl example is fixed

  • checking asm mode for 'paragraph' before throwing a paragraph error

[3.0.1] - 2021-07-25

Added

  • pug_mixins documentation

Fixed

  • tok var definition fix in tag function (thanks Mathias Winckel)

  • added the exception 'cama' (Spanish gender)

[3.0.0] - 2021-05-06

It is a major version because there are breaking changes.

Added

  • you may use RosaeNLG without using templates, accessing directly the low level JavaScript API; support is experimental. See Usage without Pug templates

  • there are now some "universal tenses" defined, which work for multiple languages; see Universal tenses table

Changed

There are 3 breaking changes that affect existing templates.

ref and refexpr must be reference to mixins

ref and refexpr must now be reference to mixins (and no more strings), and they must be referenced after being declared.

Table 1. Change on ref and refexpr
Before
- var PRODUCT = {};
- PRODUCT.ref = 'PRODUCT_ref';
mixin PRODUCT_ref(obj, params)

the ring …​.

After

- var PRODUCT = {};
mixin PRODUCT_ref(obj, params)

the ring - PRODUCT.ref = PRODUCT_ref; …​.

Your templates will probably fail at runtime if you don’t change them. To migrate:

  • search for .ref and .refexpr in your templates

  • put references instead of strings

  • move them after the referenced mixin declaration

when referencing a mixin, assembly separators properties must not use a string

Assembly separators (last_separator, begin_with_general, etc.) can either be a string or reference a mixin. When referencing a mixin, you must now put the mixin as a reference (no more as a string), and the mixin must have been defined before.

If you don’t migrate, your templates will not fail, but the text will be wrong: you will have the mixin name in the output.

To migrate, search for all assemblies (eachz and itemz) and change their properties if they reference mixins.

mixins and objects cannot have the same name

Mixins are now functions, which have a name; you cannot have mixins and objects having the same name, e.g.

mixin phone
  | bla bla
- var phone = {};

is now invalid.

Your templates will probably fail at runtime if you don’t change them. Rename conflicting mixins or objects.