You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've cannot get the capitalize and other modifiers to work in node.js.
Running this code:
var tracery = require('tracery-grammar');
var grammar = tracery.createGrammar({
'animal': ['panda','fox','capybara','iguana'],
'emotion': ['sad','happy','angry','jealous'],
'origin':['I am #emotion.a# #animal.capital#.'],
});
console.log(grammar.flatten('#origin#'));
outputs
I am jealous((.a)) capybara((.capital)).
Tracery was installed via npm and don't seem to include any code for modifiers. Looking at the files on here on Github I see there is a separate branch, tracery2, which has a mods-eng-basic.js package.
I tried downloading the tracery2 branch, creating a NPM package for it and installing but it makes no difference. I'm new to node.js, NPM, and Tracery and cannot find a way to load the mods-eng-basic.js / get the modifiers to work.
How do I get the modifiers working in Node.js?
The text was updated successfully, but these errors were encountered:
I completely missed this, I was working off the Tracery NPM page [ https://www.npmjs.com/package/tracery-grammar ] and the Tracery GitHub Master branch [ https://github.com/galaxykate/tracery/tree/master ] which don't have this line in the example.
Looking the NPM package on GitHub's commit history I see it does include the Tracery2 branch.
Do you (anyone) know if that is up to date with the current Tracery repository?
If I was looking to do some work on the library, which branch / repository / package should I be looking at?
I've cannot get the capitalize and other modifiers to work in node.js.
Running this code:
var tracery = require('tracery-grammar');
var grammar = tracery.createGrammar({
'animal': ['panda','fox','capybara','iguana'],
'emotion': ['sad','happy','angry','jealous'],
'origin':['I am #emotion.a# #animal.capital#.'],
});
console.log(grammar.flatten('#origin#'));
outputs
I am jealous((.a)) capybara((.capital)).
Tracery was installed via npm and don't seem to include any code for modifiers. Looking at the files on here on Github I see there is a separate branch, tracery2, which has a mods-eng-basic.js package.
I tried downloading the tracery2 branch, creating a NPM package for it and installing but it makes no difference. I'm new to node.js, NPM, and Tracery and cannot find a way to load the mods-eng-basic.js / get the modifiers to work.
How do I get the modifiers working in Node.js?
The text was updated successfully, but these errors were encountered: