Change log of the RosaeNLG npm module
[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
-