Commit 82ec51dd authored by Ludan Stoecklé's avatar Ludan Stoecklé

1.8.3

parent 730d3808
......@@ -20,7 +20,7 @@ stages:
# variables etc.
variables:
ROSAENLG_VERSION: 1.8.2
ROSAENLG_VERSION: 1.8.3
DOCKER_REGISTRY: registry.gitlab.com/rosaenlg-projects/rosaenlg
DOCKER_CLI_ROOT: ${DOCKER_REGISTRY}/cli
DOCKER_SERVER_ROOT: ${DOCKER_REGISTRY}/server
......
{
"name": "browser-ide-demo",
"version": "1.8.2",
"version": "1.8.3",
"description": "Client side demo of NLG templates compilation and rendering using RosaeNLG",
"main": "index.js",
"scripts": {
......@@ -10,7 +10,7 @@
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]:rosaenlg-projects/browser-ide-demo.git"
"url": "git@gitlab.com:rosaenlg-projects/rosaenlg.git"
},
"keywords": [
"RosaeNLG",
......@@ -21,9 +21,9 @@
"author": "Ludan Stoecklé",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/rosaenlg-projects/browser-ide-demo/issues"
"url": "https://gitlab.com/rosaenlg-projects/rosaenlg/issues"
},
"homepage": "https://gitlab.com/rosaenlg-projects/browser-ide-demo#readme",
"homepage": "https://rosaenlg.org",
"devDependencies": {
"codemirror": "^5.49.2",
"codemirror-minified": "^5.48.2",
......@@ -33,7 +33,7 @@
"gulp-inject-string": "^1.1.2",
"gulp-rename": "^1.4.0",
"merge-stream": "^2.0.0",
"rosaenlg": "1.8.2",
"rosaenlg": "1.8.3",
"vue-codemirror": "^4.0.6"
}
}
{
"name": "content-deduplicate",
"version": "0.3.2",
"version": "0.3.3",
"description": "Calculates distances between texts to prevent duplicate content",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -54,6 +54,6 @@
},
"dependencies": {
"k-medoids": "^1.0.6",
"synonym-optimizer": "2.8.2"
"synonym-optimizer": "2.8.3"
}
}
{
"name": "english-determiners",
"version": "2.8.2",
"version": "2.8.3",
"description": "English determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "english-verbs-gerunds",
"version": "0.0.3",
"version": "0.0.4",
"description": "English irregular gerunds list (-ing), based on WordNet",
"main": "dist/gerunds.json",
"scripts": {
......
{
"name": "english-verbs-helper",
"version": "0.0.3",
"version": "0.0.4",
"description": "English verbs conjugation",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -45,8 +45,8 @@
}
},
"devDependencies": {
"english-verbs-gerunds": "0.0.3",
"english-verbs-irregular": "0.0.3",
"english-verbs-gerunds": "0.0.4",
"english-verbs-irregular": "0.0.4",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
......
{
"name": "english-verbs-irregular",
"version": "0.0.3",
"version": "0.0.4",
"description": "English irregular verbs list (JSON)",
"main": "dist/verbs.json",
"scripts": {
......
{
"name": "french-adjectives",
"version": "2.8.2",
"version": "2.8.3",
"description": "Agreement of adjectives in French",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -46,7 +46,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.8.2"
"french-h-muet-aspire": "2.8.3"
},
"keywords": [
"french",
......
{
"name": "french-determiners",
"version": "2.8.2",
"version": "2.8.3",
"description": "French determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-h-muet-aspire",
"version": "2.8.2",
"version": "2.8.3",
"description": "List of French words that are 'aspiré' (vs. 'muet')",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-ordinals",
"version": "2.8.2",
"version": "2.8.3",
"description": "Ordinal numbers in French: 12 => douzième",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-verbs-intransitive",
"version": "0.1.2",
"version": "0.1.3",
"description": "list of intransitive French verbs",
"main": "dist/intransitive.json",
"scripts": {
......
{
"name": "french-verbs-lefff",
"version": "0.1.2",
"version": "0.1.3",
"description": "French verbs conjugation data, based on the Lefff content",
"main": "dist/conjugations.json",
"scripts": {
......
{
"name": "french-verbs-transitive",
"version": "0.1.2",
"version": "0.1.3",
"description": "French transitive verbs, based on Wikipedia",
"main": "dist/transitive.json",
"scripts": {
......
{
"name": "french-verbs",
"version": "2.8.2",
"version": "2.8.3",
"description": "French verbs conjugation",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -46,11 +46,11 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.8.2",
"french-verbs-transitive": "0.1.2"
"french-h-muet-aspire": "2.8.3",
"french-verbs-transitive": "0.1.3"
},
"devDependencies": {
"french-verbs-lefff": "0.1.2",
"french-verbs-lefff": "0.1.3",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
......
{
"name": "french-words-gender-lefff",
"version": "0.1.2",
"version": "0.1.3",
"description": "French words gender, based on the Lefff content",
"main": "dist/words.json",
"scripts": {
......
{
"name": "french-words-gender",
"version": "2.8.2",
"version": "2.8.3",
"description": "Gender of French words",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -48,7 +48,7 @@
"debug": "^4.1.1"
},
"devDependencies": {
"french-words-gender-lefff": "0.1.2",
"french-words-gender-lefff": "0.1.3",
"gulp": "^4.0.2",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
......
{
"name": "german-adjectives-dict",
"version": "0.1.2",
"version": "0.1.3",
"description": "German adjectives dictionnary, based on the german-pos-dict content",
"main": "dist/adjectives.json",
"scripts": {
......
{
"name": "german-adjectives",
"version": "2.8.2",
"version": "2.8.3",
"description": "German adjectives agreement",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -45,7 +45,7 @@
}
},
"devDependencies": {
"german-adjectives-dict": "0.1.2",
"german-adjectives-dict": "0.1.3",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
......
{
"name": "german-determiners",
"version": "2.8.2",
"version": "2.8.3",
"description": "German determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-dict-helper",
"version": "2.8.2",
"version": "2.8.3",
"description": "Helper functions on an included database derived from german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-ordinals",
"version": "2.8.2",
"version": "2.8.3",
"description": "Ordinal numbers in German: 12 => zwölfte",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-verbs-dict",
"version": "0.1.2",
"version": "0.1.3",
"description": "German verbs dictionnary, based on the german-pos-dict content",
"main": "dist/verbs.json",
"scripts": {
......
{
"name": "german-verbs",
"version": "2.8.2",
"version": "2.8.3",
"description": "German verbs, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -45,7 +45,7 @@
}
},
"devDependencies": {
"german-verbs-dict": "0.1.2",
"german-verbs-dict": "0.1.3",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
},
......
{
"name": "german-words-dict",
"version": "0.1.2",
"version": "0.1.3",
"description": "German words dictionnary, based on the german-pos-dict content",
"main": "dist/words.json",
"scripts": {
......
{
"name": "german-words",
"version": "2.8.2",
"version": "2.8.3",
"description": "Gender and case of German words",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -48,7 +48,7 @@
}
},
"devDependencies": {
"german-words-dict": "0.1.2",
"german-words-dict": "0.1.3",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
......
{
"name": "gulp-rosaenlg",
"version": "2.8.2",
"version": "2.8.3",
"description": "RosaeNLG client side packaging helper",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -60,6 +60,6 @@
"browserify": "^16.5.0",
"debug": "^4.1.1",
"minify-stream": "^1.2.1",
"rosaenlg": "1.8.2"
"rosaenlg": "1.8.3"
}
}
{
"name": "italian-adjectives-dict",
"version": "0.1.2",
"version": "0.1.3",
"description": "Italian adjectives dictionnary, based on the morph-it linguistic resource",
"main": "dist/adjectives.json",
"scripts": {
......
{
"name": "italian-adjectives",
"version": "2.8.2",
"version": "2.8.3",
"description": "Italian adjectives helper",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -41,7 +41,7 @@
}
},
"devDependencies": {
"italian-adjectives-dict": "0.1.2",
"italian-adjectives-dict": "0.1.3",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
......@@ -54,6 +54,6 @@
"license": "MIT",
"dependencies": {
"debug": "^4.1.1",
"rosaenlg-filter": "2.8.2"
"rosaenlg-filter": "2.8.3"
}
}
{
"name": "italian-determiners",
"version": "2.8.2",
"version": "2.8.3",
"description": "Italian determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-ordinals-cardinals",
"version": "2.8.2",
"version": "2.8.3",
"description": "Ordinal and cardinal numbers in Italian",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-verbs-dict",
"version": "0.1.2",
"version": "0.1.3",
"description": "Italian verbs dictionnary, based on morph-it",
"main": "dist/verbs.json",
"scripts": {
......
{
"name": "italian-verbs",
"version": "2.8.2",
"version": "2.8.3",
"description": "Italian verbs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -41,7 +41,7 @@
}
},
"devDependencies": {
"italian-verbs-dict": "0.1.2",
"italian-verbs-dict": "0.1.3",
"mocha": "^6.2.2",
"nyc": "^14.1.1"
},
......
{
"name": "italian-words-dict",
"version": "0.1.2",
"version": "0.1.3",
"description": "Italian words dictionnary, based on the morph-it linguistic resource",
"main": "dist/words.json",
"scripts": {
......
{
"name": "italian-words",
"version": "2.8.2",
"version": "2.8.3",
"description": "Gender and plural of Italian words",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -41,7 +41,7 @@
}
},
"devDependencies": {
"italian-words-dict": "0.1.2",
"italian-words-dict": "0.1.3",
"nyc": "^14.1.1",
"typescript": "^3.7.2"
},
......
{
"name": "lefff-helper",
"version": "2.8.2",
"version": "2.8.3",
"description": "Helper functions on an included database derived from Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "morph-it-helper",
"version": "2.8.2",
"version": "2.8.3",
"description": "Helper functions on an included database derived from morph-it (Free Morphological Lexicon for the Italian Language)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
# RosaeNLG Browser POC
Client side (in browser) NLG using RosaeNLG.
This technical POC shows how to generate texts in client side, _in a browser_, with RosaeNLG, and _without `node.js`_. This project exists for demo and test purposes.
See `browser-ide-demo` for both compiling and rendering in the browser.
## Client side rendering
Compilation occurs on server side when packaging the app. Rendering is made in the browser.
### How it works
The general idea is:
* to author text templates in a defined environment (for instance `node.js` based)
* then to compile and pack the templates
* and to run them in browser based environment, with no connection to the authoring environment (without using `node.js`)
The process is the following:
* `compile_templates_*` in `gulpfile.js/index.js` compiles and packages the template thanks to `gulp-rosaenlg` module
* RosaeNLG provides a browser ready package per language, here `rosaenlg_tiny_en_US_VERSION.js` for `en_US`
* `browser_en_US.html` or `browser_fr_FR.html` simply renders the template using sample data, and shows the result
### Usage
* `npm run build` to pack everything
* open `dist/browser_en_US.html` in a browser
* you should see `<p>Apples, bananas and apricots</p>` in the text area - this text is generated on the fly in the browser
const { src, dest, parallel, series } = require('gulp');
const fs = require('fs');
const gulpRosaenlgHelpers = require('gulp-rosaenlg');
const rosaeNlgVersion = require('../rosaenlg/package.json').version;
console.log(`rosaenlg-browser-poc: using RosaeNLG version ${rosaeNlgVersion}`);
function init(cb) {
const folders = ['dist'];
folders.forEach(dir => {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
console.log('📁 folder created:', dir);
}
});
cb();
}
const dataPerLanguage = [
['fr_FR', `, data: ['pommes', 'bananes', 'abricots', 'pêches']`],
['en_US', `, data: ['apples', 'bananas', 'apricots']`],
['de_DE', `, data: ['Äpfel', 'Bananen', 'Aprikosen', 'Birnen']`],
['it_IT', ``],
['OTHER', `, data: ['appels', 'bananen', 'abrikozen', 'peren']`],
];
function copyStaticElts() {
return src([`../rosaenlg/dist/rollup/rosaenlg_tiny_*_${rosaeNlgVersion}.js`]).pipe(dest('dist/'));
}
function html(cb) {
const demoHtml = fs.readFileSync('src/browser.html', 'utf-8');
for (let i = 0; i < dataPerLanguage.length; i++) {
const line = dataPerLanguage[i];
const language = line[0];
const data = line[1];
const htmlLanguage = demoHtml
.replace(/\$lang\$/g, language)
.replace(/\$version\$/g, rosaeNlgVersion)
.replace(/\$data\$/g, data);
fs.writeFileSync(`dist/browser_${language}.html`, htmlLanguage);
}
cb();
}
function compile(lang) {
return gulpRosaenlgHelpers.compileTemplates(
[{ source: `src/template_${lang}.pug`, name: `template_${lang}` }],
lang,
`dist/compiled_${lang}.js`,
'templates_holder',
true,
);
}
function compFr() {
return compile('fr_FR');
}
function compEn() {
return compile('en_US');
}
function compDe() {
return compile('de_DE');
}
function compIt() {
return compile('it_IT');
}
function compOther() {
return compile('OTHER');
}
exports.all = series(init, parallel(copyStaticElts, html, compIt, compOther, compDe, compFr, compEn));
{
"name": "rosaenlg-browser-poc",
"version": "1.0.1",
"description": "Browser side NLG using RosaeNLG (rendering only).",
"main": "index.js",
"private": true,
"scripts": {
"clean": "rm -rf dist",
"build": "gulp all",
"test": "echo \"No test specified on rosaenlg-browser-poc\" && exit 0"
},
"repository": {
"type": "git",
"url": "[email protected]:rosaenlg-projects/rosaenlg.git"
},
"keywords": [
"RosaeNLG",
"NLG",
"browser"
],
"author": "Ludan Stoecklé",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/rosaenlg-projects/rosaenlg/issues"