Filter mechanism
After the NLG text is generated by Pug and RosaeNLG, you most often have various small defects in your texts regarding spacing, capitalization and punctuation.
While you could put extra care in your NLG templates to avoid these defects, we think that this is tedious and that the cleaning task can be automated. Thus, once the NLG text is generated, a filtering function will automatically clean your texts. See Filter mixins and functions.
Type | Original string ⇒ After filtering |
---|---|
capitalization |
|
remove extra spacing |
|
remove doubled punctuation |
|
contractions (in French and Italian) |
|
un / uno, i / gli (in Italian) |
|
a / an |
|