Public
Edited
Feb 11
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
// the rules for the grammar

rules = ({
start: '$kaminoku <br> $shimonoku',

kaminoku: '$five <br> $sevenFive(. | ...[3])',
shimonoku: '(($sevenB1 <br> $sevenC) | ($doubleA | $doubleB)).cap.',

four: 'look for water | look to the $n | pray for quiet',
five:
'((the $nnnn | $nnnnn | $vp4 again) | (last | red)\
(mountain|wilting) flower).cap',
sevenFive: 'I (rise | wake) and $four <br> $vp5 | $twelve $tree',
sevenB1:
'(no one (need | can) understand) \
| (no one can forget | everyone forgets | no one misunderstands).cap',
sevenC: 'the (vastness|stillness) of this (garden | universe | morning)',
twelve:
'(((beetle|termite) eats | ant burrows).art() (silently | placidly) \
<br> into the) | ((spider | inchworm).art() dangles <br> from the)',

n: 'clouds | trees | leaves',
nn: 'the (stars | moon | sun | sky)',
nnn:
'a black rose | white daisies | sakura | rosemary \
| cool moonlight | dark forest | tall mountain',
nnnn:
'(mountain | silent) village | (evening | morning) sunlight \
| (winter | summer) flower | (star | moon)light above',
nnnnn: 'the (autumn | summer | winter) moonlight',

tree: '(chestnut | cedar | old (gum | tea)) tree',
vp4: 'drifting like (snow|clouds) | falling like (rain | leaves) ',
vp5:
'crying like a child | singing like a bird | drifting like the snow \
| falling like (the rain | a leaf)',

$doubleA: 'not (quite|) far enough away<br>but closer than $nn',
$doubleB: 'close enough to touch <br> but farther even than $nn',

a: 'sad | tall | hot | plain | grey',
v: 'sing | cry | rise | bloom | dance | fall'
})
Insert cell
Insert cell
Insert cell
RiTa = require('rita')
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more