123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- gender:= Male | Female | Unspec;
- byGender := { [m,f,n] => { [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;
- name := { [g] => (vowel | "") rep[1..3, cons vowel] cons ending[g] };
- hairColor ::= black brown blonde;
- eyeColor ::= brown green blue;
- job := { [g] =>
- "stonemason"
- | "baker"
- | "accountant"
- | case g in
- { Male => "fisherman"
- ; Female => "fisherwoman"
- ; _ => "fisher"
- } };
- tool := { ["stonemason"] => "chisel"
- ; ["baker"] => "bowl"
- ; ["accountant"] => "tablet"
- ; [_] => "fishing pole"
- };
- adjective ::= happy cheerful focused quiet meek rash;
- person :=
- let fix my-gender := gender in {
- let 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;
|