Change log of RosaeNLG
[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.
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.
[2.1.8] - 2021-03-30
[2.1.7] - 2021-03-08
Fixed
-
\#57 highlight js works again, reduced list of supported languages by highlight, and tried to remove favicon requests
-
\#58 gerund of 'to be' is 'being', not 'bing'
-
\#55 'to be' formally added to the list of irregular verbs in
english-verbs-irregular
(though is not not used to conjugate 'to be', as it is an auxiliary) -
issues on Lambda version deployment
[2.1.3] - 2021-01-17
Added
-
configuration and doc for Vercel pkg to generate an .exe file for the server
-
governance in GOVERNANCE.md
[2.1.2] - 2020-12-29
[2.1.1] - 2020-12-26
Added
-
yeoman generator to easily bootstrap RosaeNLG projects
-
patreon funding link: https://www.patreon.com/ludan
-
in API,
randomSeed
is now automatically present in the output
Changed
-
boilerplate project is archived
[2.1.0] - 2020-12-10
Added
-
new parameter
renderDebug
to follow the rendering path in the html output; see new debugging manual -
performance monitoring in the CI
[2.0.0] - 2020-11-29
moment
, which was used to format dates, was replaced by date-fns
, essentially to reduce the size of render only browser bundled packages.
You must update dateFormat
everywhere you used it following date-fns format.
Also, util.moment
not available no more. If you used it, alternatives are:
-
import
moment
in your node project and inject moment yourself inutil
-
or prepare dates upstream from generating texts (and avoid
moment
in templates)
Added
-
issue templates on GitHub
-
standard guides: README.md, DEVELOPER_GUIDE.md, CONTRIBUTING.md, COMMUNITY.md etc.
-
Observable HQ integration doc
-
doc on synonyms explaining best approach to generate all alternatives
Fixed
-
browser IDE demo: German is blocked when using Firefox (https://github.com/RosaeNLG/rosaenlg/issues/3)
-
bug on context unstack
-
big bug on empty synonyms: empty alternatives could be triggered when they contained only spaces
[1.18.1] - 2020-10-31
Changed
-
github migration:
-
all project repositories moved to github, including documentation related subprojects (
antora-ui
,antora-playbook
,docs-site
,boilerplate
): see RosaeNLG organization on Github -
dictionary.zip
storage forgerman-pos-dict
instead ofdictionary.dump
, which was too large for github -
github worklows generated using
gulp workflows
-
-
docker registry moved from
registry.gitlab.com
tohub.docker.com
for cli, node.js server images and java server images
[1.18.0] - 2020-10-23
Changed
-
license change to Apache 2.0:
-
most original packages switch to Apache 2.0 license
-
packages derived from original Pug packages
rosaenlg-pug-…
remain under MIT -
other packages that are forks from MIT packages remain under MIT as well:
english-ordinals
,rosaenlg-gender-es
,rosaenlg-pluralize-es
-
-
documentation in separate module
rosaenlg-doc
-
updated logo (font is Soft Elegance)
[1.16.6] - 2020-07-17
[1.16.2] - 2020-07-04
[1.16.0] - 2020-06-12
Added
-
on both node.js and Lambda API:
-
/templates/version
to get the current RosaeNLG version deployed -
accepts JWT token for authorisation
-
[1.15.1] - 2020-05-08
Added
-
numerous tags now accept lists parameters instead of a single element, and will choose one randomly; use that feature instead of an embedded
syn_fct
call:-
agreeAdj
andsubjectVerbAdj
now accept a list of adjectives -
value
accepts a list of elements as first parameter -
verb
,subjectVerb
andsubjectVerbAdj
as well for the subject -
verb
,subjectVerb
andsubjectVerbAdj
as well for the verb
-
-
noSubject
flag onsubjectVerb
andsubjectVerbAdj
mixins to silent the subject
[1.15.0] - 2020-05-05
Added
-
Spanish support: verbs, words (gender, plural), adjectives, determiners
-
SEP_BEFORE
andSEP_AFTER
to provide separators when multiple adjectives; is practical to override default, e.g.value('árbol', { det:'DEFINITE', adj:{BEFORE:['primero', 'grande'], SEP_BEFORE:''} })
will generate el primer gran árbol
Fixed
-
bug in
BEFORE
adjective list:value('homme', {det:'INDEFINITE', adj: { BEFORE:['vieux'] } })
now produces un vieil homme -
bug in Lambda functions: forced embedded resources (in compile options) were ignored
-
bug in
browser-ide-demo
: JSON export was wrong (templateId
insrc
and not a top level element) -
bug in
french-adjectives
when adjective was placed before noun and plural: generatedvieil alsaciens
instead ofvieux alsaciens
Changed
-
removed
substantive
mixin: usevalue
instead withnumber
param, see Value for Nominal Groups -
english-ordinals
is now a separate module -
pluralize-fr
removed from tiny runtime (automatically embeds a list of words with their plural instead) -
french-adjectives
is not embedded no more in tiny version (using lists instead) -
doc organization for verb and value mixins
[1.14.0] - 2020-04-05
[1.13.0] - 2020-03-29
Added
-
ability to include raw js files (e.g.
include somejs.js
), which is handy to be able to both lint and package these files in a json package
Changed
-
gulp-rosaenlg now automatically includes all files to be included by reading the templates content
-
as a consequence, in the
packageTemplateJson
function:-
folderWithTemplates
is removed -
entryTemplate
must now also contain the path
-
[1.12.0] - 2020-03-16
Added
-
(almost) ready to deploy Lambda functions for AWS
-
common content for
rosaenlg-node-server
androsaenlg-lambda
in separate packagerosaenlg-server-toolkit
-
tested (successfully) on different Node.js versions, see here
[1.10.2] - 2020-02-26
Added
-
(much) better Italian ordinal support (up to 1 millions) thanks to Marco Riva
-
in
value
, useagree
forORDINAL_TEXTUAL
init_IT
to have prima and not primo
[1.10.0] - 2020-02-18
[1.9.0] - 2020-02-10
Changed
-
more reliable
a
/an
filtering in English: use ofenglish-a-an
andenglish-a-an-list
instead ofcompromise
inrosaenlg-filter
-
more reliable Englisn plurals: use of
english-plurals
andenglish-plurals-list
instead ofcompromise
-
now using
n2words
for textual numbers in all languages, replacingwritten-number
for French,write-int
for German,compromise
for English anditalian-ordinals-cardinals
for Italian textual -
replaced
compromise
byn2words
+ custom code inspired by number-to-words for English ordinal numbers -
completely removed
compromise
lib
[1.8.1] - 2020-02-05
Added
-
en_US
:-
for verbs, replaced
comprise
lib withenglish-verbs
,english-verbs-irregular
andenglish-verbs-gerunds
-
12 standard tenses are now available:
SIMPLE_PAST
,SIMPLE_PRESENT
,SIMPLE_FUTURE
,PROGRESSIVE_PAST
,PROGRESSIVE_PRESENT
,PROGRESSIVE_FUTURE
,PERFECT_PAST
,PERFECT_PRESENT
,PERFECT_FUTURE
,PERFECT_PROGRESSIVE_PAST
,PERFECT_PROGRESSIVE_PRESENT
,PERFECT_PROGRESSIVE_FUTURE
-
[1.7.0] - 2020-01-20
Added
-
rosaenlg-node-server
is now more ready to use on a cluster:-
ROSAENLG_LAZY_STARTUP
: env variable, if set it prevents loading saved templates at startup (they will be loaded when needed only) -
ROSAENLG_FORGET_TEMPLATES
: env variable, if set to true loaded templates will be forgotten after a while (and reloaded when needed)
-
[1.6.0] - 2020-01-11
Added
-
rosaenlg-node-server
:-
S3 support for persistence
-
ability to put a user in the request, and have separate environments
-
/health
path -
time elapsed (performance) in the response and in the logging
-
static swagger published here
-
[1.5.8] - 2020-01-06
Fixed
-
rosaenlg-node-server
: when using persistent templates, templates were not reloaded when server was restarted
Changed
-
rosaenlg-node-server
: http codes are now more precise; like in Return 404 instead of 500 when template does not exist -
rosaenlg-node-server
:reload
now usesPUT
http method, and notGET
no more
[1.5.5] - 2019-12-13
[1.5.4] - 2019-12-04
Added
-
new additional independant module content-deduplicate; it is not used by RosaeNLG while rendering texts but you can use it afterwards to assess the quality of your texts
[1.5.3] - 2019-11-24
Added
-
list of standard stop words in the documentation
-
Developer experience documentation
-
with CLI, templates can now be rendered in stdout (not systematically in a file)
-
examples of templates showing the added value of a Natural Language Generator compared to a plain template engine like Pug
[1.5.2] - 2019-11-18
Changed
-
docker images (command line interface and server) are not built through main CI and available here
-
browser-ide-demo
is now a package of the project
[1.3.2] - 2019-10-27
[1.3.0] - 2019-10-13
Added
-
fat js packaged version, with compilation ability on each language, to be used in GraalVM
[1.2.0] - 2019-10-12
Added
-
recordSaid
hasSaid
anddeleteSaid
existed to safely record booleans; now there isrecordValue
getValue
anddeleteValue
to safely record numbers or strings -
compare with CoreNLG in the documentation
[1.1.1] - 2019-10-09
Fixed
-
Dev dependancies security issues thanks to Snyk
-
More French contractions (j’ai, lorsqu’il, puisqu’elle, jusqu’à etc.) thanks to CoreNLG source code
[1.0.0] - 2019-09-10
Added
-
search engine available in RosaeNLG doc thanks to Algolia DocSearch (awesome product and support btw)
[0.18.1] - 2019-07-12 (private version)
Added
-
adj
invalue
mixin accepts more: can be a listadj:['beau', 'grand']
, or an objectadj:{ BEFORE: ['beau', 'intelligent'], AFTER: ['brun'] }
-
DEMONSTRATIVE
determiner type in Italian -
possessive adjective param in value
possessiveAdj
for Italian possessives -
boilerplate documentation see boilerplate project
[0.16.0] - 2019-05-11 (private version)
Fixed
-
de #[+value(9000)]
(or any number) would contract intod'9 000
. Now generatesde 9000
properly. -
Punctuation on French and English when using
?
or!
. -
French possessives issues.
Added
-
Added dates formatting thanks to moment lib
-
Filtering can be explicitely disabled with
disableFiltering: true
inrenderFile
-
Numbers formatting: use
FORMAT
invalue
to set a format directly used bynumeral
. See numeral.js formats. Very practical for currencies, %, etc. For instance+value(104000, {'FORMAT': '0a$'})
will output 104k€ when generating French. -
det
to add a determiner (French and German); current determiners areDEFINITE
andDEMONSTRATIVE
. -
It is now easier to complete the
params
object with new values withaddToParams
:addToParams({xxx:yyy})
is equivalent toObject.assign({}, params, {xxx:yyy}
. -
adj
property invalue
to add an adjective. -
owner
property invalue
to manage possessives. Does the same thing asthirdPossession
. -
recordSaid
anddeleteSaid
do not need a `- ` before them no more. -
Ability to globally choose the best synonymic alternatives with
choosebest
: see [choosebest]. -
Ability to compile and/or just render texts in browser, without using
node.js
. See [inbrowser]. -
Tutoriels can be run directly in the browser.
-
Improved French support, see below.
-
Partial support of German (
de_DE
), see below. -
Ability to generate Yseop templates. Yseop is a NLG software vendor. See [yseop.adoc].
French
-
Cardinal numbers in letters (5 → cinq etc.) support thanks to written-number lib
-
Numbers formatting:
-
Basic support for French ordinal numbers:
+value(1, {'ORDINAL_NUMBER':true })
= 1er thanks tonumeral
lib -
Support for French cardinal numbers up to 100:
+value(21, {'ORDINAL_TEXTUAL':true })
= vingt et unième
-
-
Improved French verbs support:
-
Any verb of all 3 verb groups are available thanks to
lefff
derived resource. -
Supported tenses:
PRESENT
FUTUR
IMPARFAIT
PASSE_SIMPLE
CONDITIONNEL_PRESENT
IMPERATIF_PRESENT
SUBJONCTIF_PRESENT
SUBJONCTIF_IMPARFAIT
PASSE_COMPOSE
PLUS_QUE_PARFAIT
. -
For
PASSE_COMPOSE
andPLUS_QUE_PARFAIT
: useaux
property (ETRE
orAVOIR
) andagree
property:elles #[+verb(getAnonFP(), {verb: 'sortir', tense:'PASSE_COMPOSE', aux:'ETRE', agree: getAnonFP()})]
generates elles sont sorties. Ifaux
is not set, some rules will apply (transitive verbs rather takeAVOIR
, etc.). -
Use
pronominal:true
for pronominal form.
-
-
French gender shortcuts:
-
setRefGender(PRODUCT, 'bague');
will look forbague
in the dictionnary and setPRODUCT
gender toF
. -
#[+value('bague', {represents: PRODUIT})]
will output bague and set the gender ofPRODUIT
toF
via the dictionnary.
-
-
French contractions:
-
now manage ce/cet: ce arbre becomes cet arbre
-
manages "h aspiré": le hérisson vs l’hebdomadaire
-
-
French adjectives:
-
adjPos
invalue
to set the position of the adjective -
manages "h aspiré":
-
#[+value('homme', {det:'INDEFINITE', adj:'vieux', adjPos:'BEFORE'})]
outputs un vieil homme -
#[+value('hollandais', {det:'INDEFINITE', adj:'vieux', adjPos:'BEFORE'})]
outputs un vieil hollandais
-
-
-
Very simple integrated POS tagger-like to simplify syntax:
[+value('<un vieil hollandais>')]
(or[+value('<une vieux hollandais>')]
) outputs un vieil hollandais. See value.adoc#simplified.
German
-
German is
de_DE
. -
Ponctuation (like English).
-
Dates and numbers.
-
Gender of words (M/F/N) thanks to german-pos-dict.
-
Cases thanks to
german-pos-dict
. -
Determiners.
-
getMFN
helper (makes the same job thangetMorF
). -
Possessives (die Farbe der Gurke).
-
Adjectives (der alten Gurke).
-
Very simple integrated POS tagger-like to simplify syntax:
#[+value("<der alte Gurke>", {case:'GENITIVE'})]
outputs der alten Gurke. See value.adoc#simplified. -
Verbs thanks to german-pos-dict - all tenses are supported
Changed
-
Some speed optimizations (which are not significant)
-
Refactoring: switched to TypeScript for most of the code
-
Some renaming: please impact your templates
-
shuffle
renamed tomix
-
REPRESENTANT: 'ana'
renamed toREPRESENTANT: 'refexpr'
-
-
Updated librairies and linguistic resources documentation: see index.adoc#resources
-
Replaced
better-title-case
, which was deprecated on npm, bybetter-title-case
. Changed the test case (titlecase rules seem to be complex). -
monthName(date)
(which generated the name of the month january february etc.) is deprecated as we now havemoment
lib. Use#[+value(date, 'MMMM')]
instead. -
Removed
format-number-french
(replaced bynumeral
). -
Removed
jslingua
(replaced by custom lefff extract). -
valWithUnit
is deprecated and removed. -
loadDict
param is removed; ressources a just loaded when necessary. -
Removed
registerSubst
. UsesetRefGenderNumber
directly. -
updated many libs: copyfiles mocha rimraf better-sqlite3 compromise moment written-number
[0.15.4] - 2018-04-20
Fixed
-
French support for month names did not work - fixed
-
getNextRep
(used in French) didn’t work properly: the chosen representant was often not the one thatgetNextRep
had predicted. -
anaphoras: after forcing referential representant output, the next one was still the representant; now it is the anaphoric one.
[0.15.0] - 2018-04-14
Added
-
to raise the probability of a specific synonymic alternative to be triggered, use
syn {weight:4}
(4 times higher chances - default is 1) -
to force a specific synonym to trigger, use
synz {force:3}
(to trigger the 3rd one)-
this is useful while developping
-
force
is not compatible with{mode:'sequence'}
-
if the forced alternative is empty, it will still not trigger it
-
Changed
-
synz 'sequence'
syntax is not valid no more: usesynz {mode:'sequence'}
-
changed the random algorithm: it is still random but does not provide exactly the same numbers as before; you shall update your regression tests (and I’m sorry for that).
-
defaultSynoType
renamed todefaultSynoMode
-
setSynoProps
,setSize
,getSize
removed
[0.14.0] - 2018-04-09
Changed
-
titlecase
is now a structure element and no more a mixin:
titlecase | what is this thing?
-
FYI the titlecase npm package, which is used in en_US, is no longer maintained
[0.10.0] - 2018-04-05
RosaeNLG is now a fork of Pug and not only a Pug add-on. Usage is easier, but maintenance is not.
Changed
-
easier integration:
-
include lib via
const rosaenlgPug = require('rosaenlg');
-
then any pug method can be called, for instance
rosaenlgPug.renderFile
-
no more (visible)
NlgLib
object -
in your template, use
include node_modules/rosaenlg/main.pug
-
-
automatic filtering unless
noFilter
is set totrue
Added
-
new boolean parameter
noFilter
if don’t want to automatically filter the whole outputs -
new structure keywords:
-
synz
/syn
to define synonyms: replaces+assemble
-
itemz
/item
to define list of items: replaces+syno_sentences
-
Fixed
-
a
could be transformed intothe
by compromise in some situations
- setSize('listElts', 2) mixin listElts(pos) case pos when 1 | A when 2 | B t #[+assemble('listElts', {separator: ', ', last_separator: 'and'})]
is now:
t itemz {separator: ', ', last_separator: 'and'} item | A item | B
- setSize('synos', 2) mixin synos(rnd) case rnd when 1 | A when 2 | B t #[+syno_sentences('synos')]
is now:
t synz syn | A syn | B
[0.9.0] - 2018-03-27
[0.8.1] - 2018-03-26
Added
-
a first version of the tutorial Tutorial
Fixed
-
in
assemble
, when the mixin is not set, will automatically try to usevalue
-
in
assemble
andforeach
: shuffle was done too late (after evaluation) -
filter: remove spaces at the very end of the text
-
filter: capitalize the very beginning of the text
-
filter: capitalize after exclamation mark
-
filter: removes extra ponctuation when "!" and "." are combined
[0.6.1] - 2018-03-20
Added
-
synonym mode is now a global parameter (
random
- default, orsequence
), viadefaultSynoType
in the constructor ; can be overridden locally usingsetSynoType
; see mixins_ref.adoc#synonyms_mode
[0.5.0] - 2018-03-19
Added
-
uses
compromise
lib inen_US
which was the basis for multiple new features in English:-
plural of nouns: cranberry → cranberries
-
pretty print of numbers: 562,407
-
textual numbers: five thousand five hundred
-
textual and numbered ordinals: 21st, twentieth
-
verbs conjugation with
PRESENT
PAST
FUTURE
tenses
-
-
direct access to
compromise
lib viautil.compromise
-
empty prediction mechanism improvements:
-
better empty prediction mechanism that stops faster using exceptions. PS: it should have improded performance, but it didn’t.
-
user function
isNotEmpty()
to tell a specific structure is not empty. -
new mode for synonyms: instead of choosing them randomly, you can trigger then in sequence (first then second etc.). Use
setSynoType('syno mixin name', 'sequence')
to do that. See mixins_ref.adoc#synonyms_sequence
-