1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- gender:= Male | Female | Unspec;
- fn byGender[m,f,n] => fn {
- [Male] => m;
- [Female] => f;
- [_] => n;
- };
- ending := byGender["o","a","e"];
- pronoun := byGender["he","she","they"];
- noun := byGender["man","woman","person"];
- are := byGender["is","is","are"];
- have := byGender["has", "has", "have"];
- cons ::= p t c d g r l m n x;
- vowel ::= a e i o u;
- fn name[g] => (vowel | "") rep[1..3, cons vowel] cons ending[g];
- hairColor ::= black brown blonde;
- eyeColor ::= brown green blue;
- fn job[g] =>
- "stonemason"
- | "baker"
- | "accountant"
- | case g in
- { Male => "fisherman"
- ; Female => "fisherwoman"
- ; _ => "fisher"
- };
- fn tool { ["stonemason"] => "chisel"
- ; ["baker"] => "bowl"
- ; ["accountant"] => "tablet"
- ; [_] => "fishing pole"
- };
- adjective ::= happy cheerful focused quiet meek rash;
- person :=
- let fix my-gender := gender;
- fix my-job := job[my-gender] in {
- se[
- "You come across",
- str/capitalize[name[my-gender]],
- ", a",
- noun[my-gender],
- "from the city of",
- str/capitalize[name[Female]]
- "."
- ]
- " "
- se[
- pronoun[my-gender],
- are[my-gender],
- "a hardworking",
- my-job,
- "with",
- hairColor,
- "hair and",
- eyeColor,
- "eyes."
- ]
- " "
- se[
- pronoun[my-gender],
- have[my-gender],
- "a",
- tool[my-job],
- "and",
- are[my-gender],
- "very",
- adjective,
- "."
- ]
- };
- puts person;
|