Client side in browser compiling and rendering
Both compilation and rendering are made in the browser: templates can be authored directly in the browser, or dynamically generated, compiled in the browser and the texts can also be rendered in the browser.
To be able to do that, you must use a js version of RosaeNLG that is larger, with comp
at the end, like rosaenlg_tiny_fr_FR*_comp.js
:
-
it includes the templates compiler
-
but also all linguistic resources that are associated with a language
Client side compilation is for exotic usecases. You should favor server side compilation. |
It can be used to create a 100% client side editor and renderer, like in this demo.
For a complete technical POC that effectively generates texts in a browser using RosaeNLG, see separate repo rosaenlg-browser-poc .
|
Packaged version of RosaeNLG for client side usage
RosaeNLG provides browser ready "tinyified" packages per language in dist/browser
:
Language | Compilation | Rendering | Size (approx.) |
---|---|---|---|
|
no |
yes |
780 Kb |
|
no |
yes |
601 Kb |
|
no |
yes |
567 Kb |
|
no |
yes |
553 Kb |
|
no |
yes |
504 Kb |
|
yes |
yes |
1.8 Mb |
|
yes |
yes |
8.7 Mb |
|
yes |
yes |
55 Mb |
|
yes |
yes |
10.5 Mb |
|
yes |
yes |
1.5 Mb |
Well, the German version with compilation support is too large indeed. |
CDN
All versions are available on unpkg.com
CDN, for instance:
https://unpkg.com/rosaenlg@0.18.9/dist/browser/rosaenlg_tiny_en_US_0.18.9_comp.js
https://unpkg.com/rosaenlg@0.18.9/dist/browser/rosaenlg_tiny_en_US_0.18.9.js