7 #define CHOOSE(x) (x[(R)%(sizeof x / sizeof x[0])])
8 #define EQ(a,b) (strcmp(a,b)==0)
9 #define LAST(x) (x[strlen(x)-1])
10 #define VOWEL(x) (x=='a'||x=='e'||x=='i'||x=='o'||x=='u')
21 char *number, *ending, *tense, *an, *unspec, *passive;
24 char *tense(), *number();
28 int eqn=0, tbl=0, pic=0;
71 char *splitup(char *);
77 if (EQ(env->number, "sing")) {
78 if (EQ(tense(), "past"))
79 v->list.s[0] = "there was";
81 v->list.s[0] = "there is";
83 if (EQ(tense(), "past"))
84 v->list.s[0] = "there were";
86 v->list.s[0] = "there are";
89 v->list.s[1] = " not";
95 static char *c[] = {"that", "which"};
98 v->list.s[0] = CHOOSE(c);
105 sentv->type = "sent";
108 sentv->list.x[1] = np(env);
109 sentv->list.x[3] = aux(env);
110 sentv->list.x[4] = vp(env);
111 sentv->list.x[0] = nomq(env);
112 sentv->list.x[2] = rel();
115 sentv->list.x[0] = np(env);
116 sentv->list.x[1] = aux(env);
117 sentv->list.x[2] = vp(env);
125 v->list.s[0] = "the fact that";
139 npv->list.x[0] = nomy();
140 npv->list.x[1] = sent(&nenv);
141 if (env->number == 0)
142 env->number = "sing";
145 npv->list.x[1] = nounal(env);
146 npv->list.x[0] = art(env);
156 env->tense = env->ending = tense();
158 auxv->list.x[i++] = modal(env);
160 auxv->list.x[i++] = perf(env);
162 auxv->list.x[i++] = prog(env);
172 v->type = "-passive";
174 env->tense = env->ending = tense();
175 if (env->number == 0)
176 env->number = number();
177 if (EQ(env->ending, "modal"))
179 else if (EQ(env->ending, "-en"))
180 v->list.s[0] = "been";
181 else if (EQ(env->ending, "-ing"))
182 v->list.s[0] = "being";
184 if (EQ(env->tense, "past"))
185 v->list.s[0] = EQ(env->number, "sing") ? "was" : "were";
187 v->list.s[0] = EQ(env->number, "sing") ? "is" : "are";
189 env->passive = env->ending = "pass";
196 v->type = "-passprep";
209 vpv->list.x[i++] = passive(env);
210 vpv->list.x[i++] = verbal(env);
211 vpv->list.x[i++] = comp(env);
213 vpv->list.x[i++] = advp(env);
222 static char *aspecsg[] = {"the", "the", "the", "the", "the", "this", "this", "that"};
223 static char *aspecpl[] = {"the", "the", "the", "the", "the", "these", "those"};
224 static char *aunssg[] = {"a", "a", "a", "a", "a", "a", "a", "much", "each", "any"};
225 static char *aunspl[] = {"some", "a few", "a couple", "several", "many", "all",
227 "an undue number of",
231 if (env->number == 0)
232 env->number = number();
233 if (env->unspec == 0 && prob(0.33)) {
234 if (EQ(env->number, "sing"))
235 artv->list.s[0] = CHOOSE(aspecsg);
237 artv->list.s[0] = CHOOSE(aspecpl);
238 } else if (prob(0.50) || env->an && EQ(env->number, "sing")) {
239 if (EQ(env->number, "sing"))
240 artv->list.s[0] = env->an ? "a" : CHOOSE(aunssg);
242 artv->list.s[0] = CHOOSE(aunspl);
243 if (env->an && EQ(artv->list.s[0], "all"))
244 artv->list.s[0] = "";
246 artv->list.s[0] = "";
248 if (env->an && EQ(env->an, "an") && EQ(artv->list.s[0], "a"))
249 artv->list.s[0] = "an";
258 static char *pres[] = {"can", "may", "must", "shall", "will"};
259 static char *past[] = {"could", "might", "should", "would"};
261 modalv->type = "-modal";
263 env->tense = env->ending = tense();
264 if (EQ(env->ending, "pres"))
265 modalv->list.s[0] = CHOOSE(pres);
267 modalv->list.s[0] = CHOOSE(past);
268 env->ending = "modal";
277 perfv->type = "-perf";
279 env->tense = env->ending = tense();
280 if (env->number == 0)
281 env->number = number();
282 if (EQ(env->ending, "past")) {
283 perfv->list.s[0] = "had";
284 } else if (EQ(env->ending, "pres")) {
285 if (EQ(env->number, "sing"))
286 perfv->list.s[0] = "had";
288 perfv->list.s[0] = "have";
290 perfv->list.s[0] = "have";
300 progv->type = "-prog";
302 env->tense = env->ending = tense();
303 if (env->number == 0)
304 env->number = number();
305 if (EQ(env->ending, "pres")) {
306 if (EQ(env->number, "sing"))
307 progv->list.s[0] = "is";
309 progv->list.s[0] = "are";
310 } else if (EQ(env->ending, "past")) {
311 if (EQ(env->number, "sing"))
312 progv->list.s[0] = "was";
314 progv->list.s[0] = "were";
315 } else if (EQ(env->ending, "-en")) {
316 progv->list.s[0] = "been";
317 } else if (EQ(env->ending, "modal")) {
318 progv->list.s[0] = "be";
320 env->ending = "-ing";
328 /* they pres, he pres, they past, they perf, they prog, they pass */
329 static char *ends[][6] = {{"ate", "ates", "ated", "ated", "ating", "ated"},
330 {"en", "ens", "ened", "ened", "ening", "ened"},
331 {"esce", "esces", "esced", "esced", "escing", "esced"},
332 {"fy", "fies", "fied", "fied", "fying", "fied"},
333 {"ize", "izes", "ized", "ized", "izing", "ized"}};
336 verbv->type = "-verb";
338 env->tense = env->ending = tense();
339 if (env->number == 0)
340 env->number = number();
341 if (0 && prob(0.1) && EQ(env->tense, env->ending)) {
342 if (EQ(env->number, "sing")) {
343 if (EQ(env->tense, "pres"))
344 verbv->list.s[0] = "is";
346 verbv->list.s[0] = "was";
348 if (EQ(env->tense, "pres"))
349 verbv->list.s[0] = "are";
351 verbv->list.s[0] = "were";
354 verbv->list.s[0] = prefix();
355 verbv->list.s[1] = root();
356 if (EQ(env->ending, "pres") && EQ(env->number, "sing"))
358 else if (EQ(env->ending, "pres") || EQ(env->ending, "modal"))
360 else if (EQ(env->ending, "past"))
362 else if (EQ(env->ending, "-en"))
364 else if (EQ(env->ending, "-ing"))
366 else if (EQ(env->ending, "pass"))
370 verbv->list.s[2] = ends[R % (sizeof ends / sizeof *ends)][i];
376 static char *nounlist[] = {"final completion",
377 "final ending", "final outcome",
378 "adaptation", "appearance", "argument", "circumstance",
379 "confession", "confidence", "delimitation", "dilution",
380 "dissertation", "distribution", "duplication",
381 "entertainment", "equipment", "evolution",
382 "existence", "expression", "generation", "impression",
383 "integration", "interaction", "investment", "judgment",
384 "population", "provision", "solution", "statement",
385 "tradition", "transmission",
386 "final result", "added increment", "assistance",
387 "beneficial assistance", "mutual cooperation",
388 "projection", "future projection",
389 "capability", "conjecture", "consensus of opinion",
390 "general consensus", "absence", "deficiency",
391 "inadequacy", "insufficience", "insufficiency",
392 "growing importance", "renewed emphasis",
393 "renewed interest", "changing behavior",
394 "critical thinking", "careful thinking",
395 "comprehensive survey", "high standard",
396 "basic foundation", "system testing",
397 "serious discussion", "serious concern",
398 "organizational framework", "prototype model",
399 "uniform nomenclature", "greater cooperation",
400 "uniform consistency", "early expectation",
401 "standardization", "great similarity",
402 "shortage", "presence", "sufficiency",
403 "consequent result", "construct", "disutility",
404 "early beginning", "emotional feeling", "endeavor",
405 "authorization", "order of magnitude", "preference",
406 "impact", "joint cooperation", "joint partnership",
407 "main essential", "methodology", "modification",
408 "necessary requisite", "past history", "situation",
409 "effectuation", "clarification", "new doubt",
410 "policy", "encouragement", "preparation",
411 "criterion", "material", "interest", "acceptance",
412 "rejection", "publication", "circulation",
413 "protection", "insurance",
414 "assignment", "identification",
415 "submission", "request",
416 "guidance", "correspondence", "inclusion",
417 "attachment", "assumption",
418 "recommendation", "prescription", "approval",
419 "discretion", "responsibility", "relevance",
420 "issuance", "termination", "total effect",
421 "deleterious effect", "consolidation",
422 "aggregation", "definiteness", "commencement",
423 "actual experience", "experience",
424 "combination", "accord", "filing",
425 "idea", "abstraction", "method", "procedure",
426 "complaint", "maintenance", "finance", "travel",
427 "purchase", "repair", "routine",
428 "development", "cancellation",
429 "partitioning", "development effort",
430 "project", "automation", "multilevel architecture",
431 "multilevel heirarchy", "data stream",
433 "individual assignment", "mode of operation",
434 "clear community", "attendant interest",
435 "task division", "well defined interfacing",
436 "team report", "meeting time", "effective use",
438 "major objective", "ownership",
439 "overall project time constraint",
440 "functional division", "requirements analysis",
441 "code development", "charter",
442 "requirements definition", "vertical division",
443 "broad range", "strong feeling",
444 "considerable latitude", "overall project constraint",
445 "sufficient resource", "assigned task", "expectation",
446 "critical aspect", "clear understanding",
447 "computing load", "clean interfacing", "natural basis",
448 "team activity", "team responsibility",
449 "main function", "predominant portion",
450 "work plan", "major breakpoint", "work module",
451 "achievable accuracy", "supplementary work",
452 "field version", "internal establishment",
453 "internal communication", "development progress",
454 "internal meeting", "experience level",
455 "high level autonomy", "adherence",
456 "feasibility demonstration", "persistent problem",
457 "internal objective", "idea sharing",
458 "improved performance", "unfamiliar methodology",
459 "new methodology", "development experience",
460 "module specification", "good progress",
461 "optimal number", "natural division",
462 "good relationship", "cross attendance",
463 "attendance", "necessary communication",
464 "evolving organization", "basic principle",
465 "complete revision", "general information",
466 "primary objective", "load-carrying capacity",
467 "necessary revision", "major change",
468 "clarified interpretation", "subsequent attempt",
469 "basic objective", "full utilization",
470 "practical consideration",
471 "proportionate quantity", "substantial change",
472 "database design", "unified framework",
473 "customer service", "strong interest",
474 "unified description", "necessary background information",
475 "provisioning", "physical coverage", "general observation",
476 "new technology", "validity determination",
477 "relation", "regulation", "verification",
478 "impediment", "portal", "practice", "premise",
479 "basis", "movement", "question",
480 "issue", "input", "output", "observation",
481 "input", "output", "input", "output",
482 "mechanization", "function", "evaluation",
483 "result", "further consideration", "category",
484 "performance indicator", "early warning",
485 "analysis purpose", "measurement", "replacement",
486 "utilitarian purpose",
487 "quota", "proposed enhancement", "enhancement",
488 "interfacing", "team organization", "module",
489 "guideline", "continuing study",
490 "required assistance", "major advance",
491 "proposal", "hierarchy",
492 "current view", "refinement", "activity",
493 "external description", "tight schedule pressure",
494 "internal conflict", "internal issue",
495 "reasonable compromise", "next phase",
496 "goal", "time constraint", "constraint",
497 "outcome", "important outcome",
498 "considerable experience", "intelligent choice",
499 "deliverable documentation", "discussion",
500 "timely delivery", "design issue", "large quantity",
501 "general environment", "protocol",
502 "transitioning", "modeling",
503 "considerable difficulty", "abstract interfacing",
504 "data structure", "consideration", "difficulty",
505 "statistical accuracy",
506 "agenda", "technique", "reordering",
507 "reauthorization", "current proposal",
508 "significant change", "criteria", "validation",
510 "terminology", "current understanding",
511 "incorporation", "staffing impact",
512 "schedule impact", "cost tradeoff",
513 "system architecture",
514 "adequate capacity", "centralization",
515 "current task", "system deployment",
516 "attendant uncertainty", "process",
517 "potential usefulness", "proposed method",
518 "basic assumption", "anomaly",
519 "available data", "potential improvement",
520 "registration", "exemption", "exception",
521 "follow-up", "service",
522 "installation", "construction", "necessity",
523 "occasion", "instrumentation", "disposal",
525 "convenience", "sponsoring",
526 "signification", "meaningfulness",
527 "significantness", "individuality",
528 "specification", "determination", "affirmation",
529 "recruitment", "supervision", "management",
530 "oversight", "overview", "environment",
531 "effectation", "circumvention", "location",
532 "execution", "effectiveness", "consciousness",
533 "notation", "confirmation", "restriction",
534 "organization", "realization", "actification",
535 "activation", "reification", "beginning", "conclusion",
536 "ending", "finishing", "teamwork", "motivation",
537 "attitude", "good attitude",
538 "progress", "milestone", "deadline", "schedule",
539 "allocation", "resource", "command", "concern",
540 "time", "time frame", "reality",
541 "behaviour", "ability", "advent", "increment",
542 "opportunity", "accomplishment", "aggregate",
543 "analysis", "totality", "matter",
544 "date", "duration", "centrality",
545 "proximity", "collection", "elimination",
546 "investigation", "opinion", "debate",
547 "decision", "benefit", "difference", "discontinuity",
548 "fabrication", "plan", "chart", "forecast",
549 "simplicity", "simplification", "maximization",
550 "minimization", "direction",
552 "amount", "quantity", "quality", "essence",
553 "description", "violation", "purpose",
554 "primary purpose", "automatic control", "redefinition",
555 "uniform emphasis", "study activity", "work activity",
556 "concept stage", "concept activity",
557 "possible potential", "summarization", "system function",
558 "rationale", "significant enhancement", "diverse need",
559 "diverse organization", "comprehensive plan", "interim",
560 "functional overview", "system configuration",
561 "configuration", "failure", "quantitative result",
562 "major obstacle", "conception",
563 "effectiveness", "final evaluation",
564 "interrelationship", "functional requirement",
565 "system philosophy", "verbal interchange",
566 "perceived inadequacy", "primary emphasis",
567 "intermingling", "cooperation", "partnership",
568 "adjustment", "application", "implementation",
569 "contact", "mention", "power",
570 "nature", "invention", "importance",
571 "ground", "reason", "permission", "size",
572 "report", "documentation", "priority",
573 "pursuance", "recurrance", "resumption",
574 "presupposition", "continuance",
575 "substantiation", "success", "action", "truth",
576 "past experience", "greater acceptability",
577 "organizational structure", "clear distinction",
579 "significant use", "unmet need", "centralized organization",
580 "vague concept", "negative impact", "detrimental effect",
581 "modularization", "submodularization",
582 "effect", "consistancy",
583 "inconsistancy", "completion", "utilization",
584 "reference", "doubt", "evidence",
587 "true fact", "underlying purpose", "viable alternative"};
589 static char *adjlist[] = {"concrete", "abstract", "procedural",
590 "real", "ideal", "functional", "prototype",
591 "effective", "capable", "incremental",
592 "perceived", "associated", "interdepartmental",
593 "diverse", "characteristic", "worst-case",
594 "qualitative", "fully automatic", "candidate",
595 "consensual", "consequential", "conjectural",
596 "constructive", "initial", "cooperative",
597 "essential", "methodological", "requisite",
598 "historical", "situational", "political",
599 "prepared", "material", "defined", "well defined",
600 "organizational", "projected", "overall",
601 "accepted", "rejected", "corresponding",
602 "committed", "environmental", "typical", "working", "timely",
603 "growing", "unprecedented", "new", "renewed", "fresh",
604 "rapid", "changing", "careful", "comprehensive", "broad",
605 "massive", "huge", "enormous",
606 "evaluated", "discresionary",
607 "durable", "beneficial",
608 "maximal", "tremendous", "minimal",
609 "on-site", "standardized", "standard",
610 "powerful", "natural", "necessary",
611 "reasonable", "successful",
612 "doubtful", "dubious", "certain",
613 "unified", "different", "similar", "utilitarian",
614 "realizable", "organizable", "motivated",
615 "topical", "valuable", "feasible",
616 "intelligent", "deliverable", "nontrivial",
617 "worthwhile", "complicated",
618 "organized", "organizing", "progressing",
619 "schedulable", "resourceful", "commanding",
620 "important", "allocatable", "temporal",
621 "ponderable", "understandable", "comprehendable",
622 "past", "present", "future",
623 "obvious", "considerable", "finished", "completed",
624 "unique", "abovementioned",
625 "major", "minor", "tendentious", "activating",
626 "actual", "added", "adequate", "affordable",
627 "analyzable", "additional", "intuitive",
628 "artificial", "good", "better",
629 "worse", "bad", "basic", "fundamental", "brief",
630 "general", "very unique", "extreme", "most unique",
631 "central", "proximate", "approximate", "collected",
632 "conductable", "comtemplatable",
633 "continuing", "demonstrable", "desirable",
634 "correctable", "foreseeable",
635 "discontinued", "early", "beginning",
636 "effectuated", "elucidated", "emotional",
637 "enclosed", "enthused", "entire", "exact",
638 "experimental", "fearful", "final",
639 "following", "informative",
640 "full", "complete", "indicated", "authorized",
641 "modularized", "submodularized",
642 "particular", "preferred", "satisfactory",
643 "measurable", "referenced", "literal",
645 "correct", "prioritized", "prolonged",
646 "regrettable", "apparent",
647 "continued", "subsequent", "sufficient",
648 "suggestive", "true", "ultimate", "separate",
649 "purposeful", "regarded", "resulting",
650 "doubtful", "evident", "interesting", "worthy",
651 "uniform", "vital", "viable",
652 "worthwhile", "alternative",
653 "sophisticated", "employed",
654 "clear", "lucid", "simple", "perspicuous",
655 "incomplete", "concerned"};
661 static char *suff[] = {"ion", "sion", "tion", "age",
662 "ness", "ment", "ure",
663 "ity", "iety", "ty", "ence", "ency", "ance",
664 "ancy", "tude", "hood", "ture", "ate", "art", "ard",
665 "ism", "ine", "stress", "trix", "ess",
666 "dom", "ship", "eer", "ster", "ant", "ent", "ary",
667 "ery", "ory", "ette", "let", "ling", "ule", "kin",
668 "ar", "or", "ist", "fulness",
669 "kin", "cule", "icle", "y", "ability", "iosos"};
672 nounv->type = "-noun";
673 if (env->number == 0)
674 env->number = number();
677 nounv->list.s[i++] = CHOOSE(adjlist);
678 nounv->list.s[i++] = "ness";
680 nounv->list.s[i++] = CHOOSE(nounlist);
682 nounv->list.s[i++] = prefix();
683 nounv->list.s[i++] = root();
684 nounv->list.s[i++] = CHOOSE(suff);
686 if (EQ(env->number, "plural")) {
687 if (LAST(nounv->list.s[i - 1]) == 's')
688 nounv->list.s[i] = "es";
689 else if (LAST(nounv->list.s[i - 1]) == 'y')
690 nounv->list.s[i] = "ies";
692 nounv->list.s[i] = "s";
701 adjvalv->type = "adjval";
703 adjvalv->list.x[i++] = adverb();
706 adjvalv->list.x[i++] = adjective();
707 } while (i < N - 1 && prob(0.25));
718 nounalv->type = "nounal";
720 nounalv->list.x[i++] = adjval();
722 nounalv->list.x[i++] = noun(env);
724 nounalv->list.x[i] = adjph(env);
727 for (p = nounalv; p->type[0] != '-'; p = p->list.x[0]);
728 for (i = 0; p->list.s[i]; i++) {
729 if (p->list.s[i][0] == 0)
731 if (VOWEL(p->list.s[i][0])) {
741 static char *pref[] = {
742 "amb", "ambi", "super", "hyper", "an", "tra", "trans", "post", "palim",
743 "omni", "pan", "circ", "circum", "peri", "a", "ab", "abs", "de", "apo",
744 "re", "ana", "mal", "ante", "pre", "fore", "pro", "infra", "para",
745 "inter", "ultra", "extra", "trans", "cata", "de", "oct", "octa",
746 "octo", "equi", "pseudo", "prim", "prot", "proto", "pent", "penta",
747 "quin", "quint", "quinque", "pro", "tetr", "tetra", "quad", "quadr",
748 "quadri", "quartet", "off", "bene", "hemi", "demi", "semi", "crypto",
749 "cent", "centi", "hecto", "en", "em", "in", "im", "intro", "be",
750 "macro", "poly", "mult", "multi", "neo", "nona", "novem", "ennea",
751 "in", "un", "im", "il", "ir", "non", "a", "nil", "paleo", "mon", "mono",
752 "uni", "e", "ex", "ec", "ef", "super", "supr", "sur", "hyper", "vic",
753 "vice", "hept", "hepta", "sept", "septe", "septem", "septi", "hex",
754 "hexa", "sex", "dis", "deca", "deka", "deci", "kilo", "mill", "milli",
755 "tri", "per", "dia", "ad", "com", "di", "amphi", "bi", "bin", "bis",
756 "sub", "hypo", "epi", "eu", "holo"};
764 static char *root[] = {
765 "pan", "omni", "arch", "zo", "rog", "rogat", "cred", "flect", "flex",
766 "test", "hem", "hemato", "nasc", "nat", "bibl", "fer", "voc", "port", "lat",
767 "fortuna", "ped", "chrom", "vinc", "vict", "crea", "cise", "mort", "mors",
768 "necr", "claim", "clam", "hetero", "pel", "puls", "vac", "iso", "phobe",
769 "phobia", "prim", "prime", "flu", "flux", "sequ", "liber", "liver", "theo",
770 "magna", "medi", "man", "manu", "pen", "pend", "pens", "eu", "capit",
771 "iatr", "aud", "aus", "cor", "cord", "cour", "grav", "ten", "tain",
772 "tent", "sacr", "sacer", "heiro", "sanct", "cide", "mega", "ultima",
773 "ridi", "risi", "leg", "jus", "jur", "nom", "duc", "duct", "duce",
774 "bio", "viv", "vivi", "vita", "lus", "lum", "luc", "photo",
775 "min", "philo", "phile", "phila", "amic", "anthrop", "poly", "multi",
776 "fac", "fact", "fic", "fect", "meter", "psych", "mod", "mot", "mov",
777 "nov", "neo", "neg", "uni", "alter", "ali", "idio", "pop", "dem",
778 "demo", "lic", "licit", "poten", "posse", "potes", "mem", "simul",
779 "arch", "homo", "mar", "mer", "vis", "vid", "scope", "auto", "mitt",
780 "miss", "ac", "acr", "brev", "clud", "clus", "dorm", "micro", "aster",
781 "astro", "rect", "recti", "forc", "fort", "path", "cap", "cep", "cept",
782 "put", "tempo", "tempor", "dent", "dont", "ver", "veri",
783 "feder", "fide", "feal", "fid", "cosm", "migra", "hydro", "aqu",
784 "endo", "gyn", "logo", "opus", "oper", "graph", "scrib", "scrip",
785 "mis", "miso", "anni", "annu", "enni", "ced", "cede", "ceed", "cess"};
792 return (R) < (f * 32767.0);
798 return prob(0.5) ? "pres" : "past";
804 return prob(0.25) ? "plural" : "sing";
813 rv = (X) malloc(sizeof *rv);
815 fprintf(stderr, "festoon: outa space\n");
828 verbalv->type = "verbal";
830 verbalv->list.x[i++] = adverb();
831 verbalv->list.x[i] = verb(env);
835 static char *advlist[] = {"absolutely", "functionally",
836 "accordingly", "broadly", "actionably", "actually",
838 "ambiguously", "amply",
841 "apparently", "appreciably",
842 "appropriately", "approximately",
848 "badly", "barely", "basically",
851 "capably", "carefully", "carelessly",
852 "casually", "causally", "cautiously",
853 "centrally", "certainly",
854 "cheaply", "cleanly",
855 "closely", "coarsely", "cognizantly",
856 "coincidentally", "collectively", "collaterally",
858 "competently", "completely", "comprehensibly",
859 "concededly", "conceivably",
860 "concisely", "conclusively", "concretely",
861 "concurrently", "conjecturally",
863 "conscientously", "consequently", "consequentially",
864 "consistently", "constantly",
865 "contemporaneuosly", "constructively",
866 "continually", "continuously", "contractually",
867 "contrarily", "contributatively", "conveniently",
875 "deficiently", "demandingly",
876 "dependably", "desireably",
877 "determinately", "diagnostically",
878 "differentially", "differently",
879 "directly", "discernibly",
880 "distinctly", "doubtfully", "dramatically",
883 "effecaciously", "efficiently",
885 "emphatically", "encouragingly",
886 "endlessly", "endurably",
887 "entirely", "epistomologically",
888 "functionally", "immediately",
889 "equably", "equally", "equitably", "erroneously",
890 "esoterically", "eternally", "evenly", "eventfully",
891 "eventually", "evidently",
892 "exceedingly", "exactly", "excellently",
893 "exceptionally", "excessively", "exclusively",
895 "explicitly", "extremely",
896 "factually", "faithfully",
897 "faultlessly", "feasibly",
898 "finitely", "firmly", "forcefully",
899 "formally", "formerly", "frankly", "freely",
900 "frugally", "fully", "generally",
901 "globally", "gradually",
904 "highly", "homogeneously",
906 "ideally", "identically", "ideologically",
907 "idiomatically", "idiosyncratically", "idly",
908 "imaginably", "immaterially", "immensely",
909 "impartially", "imperceptably", "imperfectly", "importantly",
910 "improperly", "imprudently", "inaccurately", "inappropriately",
912 "inclusively", "incompletely", "incorrectly",
913 "increasingly", "independently",
914 "indirectly", "ineffectively", "ineffectually", "inefficiently",
915 "infallibly", "instantaneously", "instantly",
916 "insufficiently", "internally", "likely", "only",
917 "invaluably", "inversely", "irrelevantly", "irrespectively",
918 "largely", "lastly", "legitimately", "literally",
919 "locally", "loosely", "manageably", "markedly",
920 "memorably", "mildly", "mindfully", "moderately",
921 "momentarily", "naturally", "needfully", "needlessly",
922 "nominally", "normally", "objectively", "occasionally",
924 "officially", "oppositely", "ordinarily", "ostensibly",
925 "partially", "permissibly",
926 "personally", "pertinently",
927 "physically", "plainly", "plainly",
928 "pleasingly", "politically",
929 "potentially", "predictively",
930 "predominantly", "prematurely", "preparedly", "presently",
931 "previously", "primarily",
932 "primely", "principally", "problematically",
933 "productively", "promptly", "proportionately",
934 "provably", "purely", "quickly", "radically", "randomly", "recently",
935 "repeatedly", "secondarily", "separately",
936 "usually", "specifically",
937 "redundantly", "regardlessly", "reliably",
938 "remarkably", "remotely", "respectively",
940 "robustly", "seemingly",
941 "sensibly", "singularly", "steadily",
942 "strikingly", "substantially", "successfully",
943 "supposedly", "systematically", "understandably",
944 "necessarily", "unfortunately",
945 "unnecessarily", "unmistakably", "usefully", "weakly"};
949 static char *wordy[] = {"very ", "extremely ", "generally ",
950 "reasonably ", "fundamentally ", "essentially ", "particularly ",
960 "rather ", "fairly ", "relatively ", "comparatively ",
962 "totally ", "very ", "quite "};
963 static char *suff[] = {"wardly", "ably", "wisely",
964 "ably", "ily", "ly", "ly", "ly"};
969 adverbv->type = "-adverb";
971 adverbv->list.s[i] = prob(.5) ? "simply" : "easily";
975 adverbv->list.s[i++] = CHOOSE(wordy);
977 adverbv->list.s[i] = CHOOSE(advlist);
979 adverbv->list.s[i++] = prefix();
980 adverbv->list.s[i++] = root();
981 adverbv->list.s[i] = CHOOSE(suff);
988 static char *suff[] = {"ive", "ful", "ous", "some", "oid",
989 "ine", "esque", "en", "an",
990 "ile", "able", "ible", "istic", "ic",
991 "an", "ian", "ish", "ite", "al", "less"};
995 adjv->type = "-adjective";
997 adjv->list.s[i++] = "not ";
998 adjv->list.s[i++] = "un";
1001 adjv->list.s[i] = CHOOSE(adjlist);
1004 adjv->list.s[i++] = prefix();
1005 adjv->list.s[i++] = root();
1006 adjv->list.s[i] = CHOOSE(suff);
1018 adjv->type = "adjph";
1022 adjv->list.x[i++] = rel();
1023 adjv->list.x[i++] = aux(&nenv);
1024 adjv->list.x[i] = vp(&nenv);
1028 adjv->list.x[i++] = prep();
1029 adjv->list.x[i] = np(&nenv);
1033 static char *preplist[] = {"across", "by", "in", "of",
1034 "near", "under", "over",
1035 "in back of", "below", "behind", "of", "of", "of", "of",
1036 "centered around", "centered about",
1037 "in close proximity to", "following after",
1038 "in between", "in conflict with", "in conjunction with",
1039 "in the area of", "in the neighborhood of", "in the proximity of",
1040 "in the field of", "for the purpose of",
1041 "giving rise to", "based upon", "being caused by",
1042 "of", "of", "of", "of",
1043 "being effectuated by", "being aggrevated by",
1045 "being collected together with", "being combined together with",
1046 "connected up to", "exhibiting a tendency towards",
1047 "being facilitated by",
1048 "being employed with",
1049 "having a deleterious effect upon", "impacting",
1050 "being joined together with", "being merged together with",
1051 "in the vicinity of"};
1057 pv->list.s[0] = CHOOSE(preplist);
1071 if (0 && prob(0.001))
1072 v->list.x[i++] = adjective();
1074 v->list.x[i++] = advp(&nenv);
1077 v->list.x[i++] = passprep();
1078 v->list.x[i++] = np(&nenv);
1081 if (0 && prob(0.05))
1082 v->list.x[i++] = adverb();
1093 v->list.x[0] = vprep();
1094 v->list.x[1] = np(env);
1098 static char *vpreplist[] = {"to", "at", "by", "from", "with", "for"};
1104 v->list.s[0] = CHOOSE(vpreplist);
1113 v = (E) malloc(sizeof *v);
1115 printf("outa room\n");
1135 static char *conjadvlist[] = {"we believe", "naturally", "therefore",
1136 "moreover", "obviously"};
1142 v->type = "-conjadv";
1143 v->list.s[0] = CHOOSE(conjadvlist);
1147 static char *lconjlist[] = {"therefore", "however", "nevertheless",
1148 "consequently", "also", "in addition", "moreover",
1149 "accordingly", "essentially", "presumably", "actually",
1150 "basically", "importantly", "clearly", "obviously",
1151 "needless to say", "as already stated",
1152 "generally", "approximately", "presently",
1153 "hopefully", "usually", "in the great majority of cases",
1154 "seen in the above light", "most significantly",
1155 "when the need arises",
1156 "in a large number of cases", "after this is accomplished",
1158 "having been made aware concerning these matters",
1159 "as an example of this", "as a consequence of this",
1160 "as a matter of fact", "as is often the case",
1161 "as of this date", "assuming that this is the case",
1162 "at the present moment in time", "at this time",
1163 "as a consequent result of this", "as a desireable benefit of this",
1164 "if at all possible", "similarly", "in the same connection",
1165 "in large measure", "in many cases", "in rare cases",
1166 "in some cases", "in the interim", "in the last analysis",
1167 "in light of these facts", "in the majority of instances",
1168 "in the not too distant future", "in the same way as described above",
1169 "in this case", "for all intents and purposes",
1170 "to arrive at an approximation", "for this reason",
1171 "for many reasons, then",
1172 "as is often the case", "last but not least",
1173 "later on", "on a few occasions", "on this occasion",
1174 "in summary", "taking this into consideration",
1175 "with this in mind",
1176 "substantially", "ultimately"};
1182 v->type = "-lconjadv";
1183 v->list.s[0] = CHOOSE(lconjlist);
1189 static char *conjsublist[] = {"although", "even though",
1190 "despite the fact that",
1191 "for the simple reason that",
1192 "because", "due to the fact that", "since",
1197 v->type = "-conjsub";
1198 v->list.s[0] = CHOOSE(conjsublist);
1202 static char *lconjsublist[] = {"although", "even though",
1203 "despite the fact that",
1204 "because", "due to the fact that", "since",
1205 "if", "anytime that", "in the case that",
1206 "as a consequence of the fact that",
1207 "as regards the fact that",
1208 "as a desireable benefit of the fact that",
1209 "with reference to the fact that",
1211 "as an important essential of the fact that",
1212 "in conjunction with the fact that",
1213 "in the light of the fact that",
1214 "if", "if", "if", "if",
1215 "leaving out of consideration the fact that",
1217 "inasmuch as", "until such time as",
1218 "as soon as", "being as", "in the same way as",
1219 "with the exception of the fact that",
1220 "notwithstanding the fact that",
1221 "on the grounds that",
1222 "on the basis of the fact that",
1223 "persuant to the fact that",
1224 "although it seems apparent that",
1225 "with regard to the fact that",
1226 "as can be seen from the fact that",
1232 v->type = "-lconjsub";
1233 v->list.s[0] = CHOOSE(lconjsublist);
1237 static char *conjlist[] = {"and", "but", "yet", "and", "and"};
1243 v->list.s[0] = CHOOSE(conjlist);
1246 static char *nomzlist[] = {"it is easy to see that",
1247 "it is a basic fact that",
1248 "it is obvious that", "it is not unimportant that",
1249 "it is easy to overlook the fact that",
1250 "it is within the realm of possibility that",
1251 "it is apparent that",
1252 "this is indicitive of the fact that",
1253 "this is in substantial agreement with the fact that",
1254 "this demonstrates the fact that",
1255 "this leaves out of consideration the fact that",
1256 "it is of the utmost importance that",
1257 "the truth is that",
1259 "it turns out that", "it will turn out to be true that",
1260 "it should be noted that",
1261 "it stands to reason that",
1262 "it would not be unreasonable to assume that",
1263 "it is interesting to note that",
1264 "this can be proved by:",
1265 "this is a trivial consequence of",
1266 "it is assumed that",
1267 "it remains to be shown that",
1268 "it is left to the reader to prove"
1275 v->list.s[0] = CHOOSE(nomzlist);
1282 static char eqnbuff[100], x;
1283 static char *eqnelem[] = {"int", "sum", "prod", "union", "inter"};
1284 static char *eqnfn[] = { "sin", "cos", "tan", "arc", "det",
1285 "log", "exp", "f", "g", "sinh", "O", "J sub 0", "J sub 1",
1286 "P sub i", "gamma", "zeta" };
1287 static char *eqnval[] = { "0", "DELTA", "GAMMA", "LAMBDA",
1288 "OMEGA", "PHI", "PSI", "SIGMA", "THETA", "UPSILON",
1289 "XI", "alpha", "beta", "gamma", "delta", "epsilon",
1290 "eta", "kappa","lambda", "mu", "omega", "x", "zeta", "inf"};
1291 static char *eqnrel[] = {"=", "<=", ">=", "==", "!=", "approx"};
1295 sprintf(eqnbuff,"$%s from %c=%d to %s %s ( %c ) d%c %s %s$",
1296 CHOOSE(eqnelem), x, (R)&077, CHOOSE(eqnval), CHOOSE(eqnfn),
1297 x, x, CHOOSE(eqnrel), CHOOSE(eqnval));
1298 v->list.s[0] = eqnbuff;
1310 if (prob(T * 1.5)) {
1311 v->list.x[i++] = lconjadv();
1312 v->list.x[i++] = comma(env);
1313 v->list.x[i++] = sent(env);
1314 } else if (prob(2 * T)) {
1315 v->list.x[i++] = turgid(env);
1316 v->list.x[i++] = comma(env);
1317 v->list.x[i++] = conj();
1318 v->list.x[i++] = sent(env);
1319 } else if (prob(1.5 * T)) {
1320 v->list.x[i++] = lconjsub();
1321 v->list.x[i++] = sent(env);
1322 v->list.x[i++] = comma(env);
1323 v->list.x[i++] = sent(env);
1324 } else if (prob(T * .5)) {
1325 v->list.x[i++] = sent(env);
1326 v->list.x[i++] = comma(env);
1327 v->list.x[i++] = conjadv();
1328 } else if (prob(T)) {
1329 v->list.x[i++] = turgid(env);
1330 v->list.x[i++] = comma(env);
1331 v->list.x[i++] = conjsub();
1332 v->list.x[i++] = sent(env);
1333 } else if (prob(.5 * T)) {
1334 v->list.x[i++] = nomz();
1335 if (eqn && prob(.5)) {
1336 v->list.x[i++] = equation();
1337 v->list.x[i++] = comma(env);
1338 v->list.x[i++] = conj();
1340 v->list.x[i++] = sent(env);
1342 v->list.x[i++] = sent(env);
1348 splitup(char *strlab) {
1349 static char label[64];
1354 (c = *strlab++) != '\0'; j++)
1362 label[j++] = '"'; label[j] = '\0';
1368 fprintf(stderr, "usage: festoon [-pet] [-sSEED] [SENTENCES] [%%-invented-nouns]\n");
1375 for (i = 1; i < io; i++)
1376 if (buff[i - 1] == ' ' && buff[i] <= 'z' && buff[i] >= 'a')
1377 buff[i] += 'A' - 'a';
1381 main(int argc, char *argv[]) {
1382 static char *furniture[] = {"WASTEBASKET", "ASHTRAY", "TABLE",
1383 "DESK DRAWER", "COAT LOCKER", "BOOKSHELF"};
1385 static char *ccto[] = {
1389 "H. V. Bandersnatch",
1424 static char *picelem[] = { "box", "ellipse", "box", "box"};
1425 static char *piccon[] = { "arrow", "line", "line <-", "line <->",
1426 "spline", "spline <-", "spline <->"};
1427 static char *picdir[] = { "right", "down right", "down",
1428 "left", "up left", "left", "down", "down right", NULL};
1431 int i, j = 0, k = 0;
1437 for (i = 1, ++argv; i < argc; i++, argv++)
1438 if (*argv[0] == '-') /* -pet -snnn */
1439 while (c = *++argv[0])
1454 t = atoi(argv[0]+1); argv[0][1] = '\0';
1457 abo(); /* illegal option */
1460 lim = atoi(argv[0]);
1462 makeup = 1.0 - (float) atoi(argv[0]) / 100.0;
1466 if (makeup < 0. || makeup > 1.0)
1479 printf("%s\n", buff);
1480 printf(".AU \"C. C. Festoon\" CCF Headquarters %d\n", t);
1482 printf(".EQ\ndelim $$\n.EN\n");
1491 printf("%s.\n", buff);
1493 } while (prob(0.75));
1495 printf(".MT \"MEMORANDUM FOR %s\"\n.hy 1\n",
1498 if (i % 23 == 0) { /* Time for a section header */
1506 printf("%s\"\n", buff);
1509 if (i % 27 == 0 && pic) { /* Time for a picture */
1510 printf(".DS CB\n.ps -1\n.PS\n");
1511 str = &(CHOOSE(picdir));
1512 if (*str == NULL) str = &picdir[0];
1514 for(junk = 1; junk < junk2; junk++) {
1515 printf("%s; ", *str);
1516 if (str == &picdir[0]) {
1517 pic = 2; printf("A: ");
1519 printf("%s %s ht %3.1f wid %3.1f\n",
1520 CHOOSE(picelem), splitup(CHOOSE(nounlist)),
1521 0.4+0.5/junk2, 0.8+0.6/junk2);
1522 printf("%s %s %3.1f ",
1523 CHOOSE(piccon), *str, 0.2+.3/junk2);
1524 if (*++str == NULL) str = &picdir[0];
1525 printf("then %s %3.1f %s\n",
1527 splitup(CHOOSE(adjlist)));
1529 printf("circle rad .3 \"process\" \"completion\"\n");
1532 printf("line <- dashed up .25 from A.n\n");
1533 printf("circle rad .3 \"process\" \"start\"\n");
1535 printf(".PE\n.ps +1\n.DE\n");
1536 printf(".ce\n\\fBFigure %d\\fP\n", i/27);
1538 if (i % 41 == 0 && tbl) { /* Time for a table */
1540 printf("box, center;\nc\ts\ts\n");
1541 printf("n | l | lw(%3.1fi).\n", 2.0+(41.0+(t&07))/i);
1542 printf("Action Plan %d\n=\n", i);
1543 printf("Item\tWho\tAction\n");
1544 for (junk = 1; junk < (i&17)+4; junk++) {
1545 printf("_\n%d\t", t/i+junk);
1546 printf("%s\tT{\n", CHOOSE(ccto));
1552 printf("%s.\nT}\n", buff);
1556 printf(".ce\n\\fBTable %d\\fP\n", i/41);
1563 if (++k % 13 == 0 && prob(0.35)) { /* Bullet list */
1564 printf("%s:\n", buff);
1574 printf("%s.\n", buff);
1575 } while (prob(.83));
1579 if (k % 11 == 0 && prob(.21)) { /* do as footnote */
1580 printf("%s\\*F.\n", buff);
1587 printf(".FS\n%s.\n.FE\n", buff);
1589 else printf("%s.\n", buff); /* normal flush */
1591 if (++j > 2 && prob(0.4))
1592 printf(".P\n"), j = 0;
1598 for (j = 0; j == 0;) {
1599 for (i = 0; i < sizeof ccto / sizeof *ccto; i++) {
1601 j = 1, printf("%s\n", ccto[i]);
1619 if (tree->type[0] == '-') {
1621 for (i = 0; tree->list.s[i]; i++) {
1622 out(tree->list.s[i]);
1625 for (i = 0; tree->list.x[i]; i++) {
1626 pr(tree->list.x[i]);
1637 if (io == 0 && *s == ' ')
1642 buff[0] += 'A' - 'a';
1645 if ((buff[io - 1] == ' ' || buff[io - 1] == '\n' ) && *s == ' ')
1647 if (buff[io - 1] == ' ' && *s == ',') {
1652 if (buff[io - 1] == 'y' && *s == 'i' && s[1] == 'e')
1654 else if (*s == buff[io - 1] && *s != 's' && *s != 'n')
1656 else if (*s == 'e' && buff[io - 1] == 'a')