Skip to content
/ tracery Public
forked from galaxykate/tracery

Tracery: a story-grammar generation library for javascript

Notifications You must be signed in to change notification settings

v21/tracery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tracery

Tracery: a story-grammar generation library for javascript

This is my attempt to package up Tracery as a Node library.

Installation

This is hosted at npm, so it can be installed like so:

$ npm install tracery-grammar --save

Example usage

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#.'],
});

grammar.addModifiers(tracery.baseEngModifiers); 

console.log(grammar.flatten('#origin#'));

Sample output:

I am a happy iguana.
I am an angry fox.
I am a sad capybara.

About

Tracery: a story-grammar generation library for javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%