Not being able to substitute words like in English is not a real problem, because while in English you have this problem less often, it is still there:
"There was a man named %name%. He liked kids..." - female names won't work here.
Instead you could try to have fun with a more complex approach.
"There was a %person1.sexAndAge%. %person1.personalPronoun% liked kids... But they didn't like %person1.personalPronounGenitive%."
Now if you create a random object:
var person1 = {}
person1.age = random(80)+10;
person1.sex = randomFromList( ['man', 'woman'] );
if ( person1.age < 20 ) person1.ageDescription = 'young';
else if ( person1.age > 50 ) person1.ageDescription = 'old'; //sorry to all guys here above 50!
if ( person1.sex == 'man' ) {
person1.personalPronoun = 'he';
person1.personalPronoun = 'him';
if ( person1.ageDescription == 'young' ) person1.sexAndAge = 'boy';
else person1.sexAndAge = 'man';
}
if ( person1.sex == 'woman' ) {
person1.personalPronoun = 'she';
person1.personalPronounGenitive = 'her';
if ( person1.ageDescription == 'young' ) person1.sexAndAge = 'girl';
else person1.sexAndAge = 'woman';
}
Now, whatever random functions will return, the sentence will work (at least grammatically!)
- There was a boy. He liked kids... But they didn't like him.
- There was a woman. She liked kids... Buth they didn't like her.
but you're limited and you can't add "old man" to your sexAndAge possible values:
- There was a old man ...
- should be: There was an old man...
This is easy to solve, but it complicates your code even more. You could also go a step further and make functions randomizing a group of people, e.g. a married couple, where there would be only like 1% chance that this is a gay marriage. Then you could make a story about a %person1.name% being in love with %person2.nameLocative%. You should write a few stories, some variants of these stories and see what functionality you need.