Conversation Framework for Sand-dancer

version 2 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter 1b - Listing Suggested Topics (for use without Complex Listing by Emily Short)

    [ This version uses regular expression substitution in indexed text to end the list with "or" rather than "and" --Eric]

    Carry out listing suggested topics:
    consider the suggestion list construction rules;
    let ask-suggs be the number of entries in sugg-list-ask;
    let tell-suggs be the number of entries in sugg-list-tell;
    let other-suggs be the number of entries in sugg-list-other;
    if ask-suggs + tell-suggs + other-suggs is 0 begin;
    say "[nothing specific]";
    rule succeeds;
    end if;
    let sugg-rep be an indexed text;
    say "[if topic-request is implicit]([end if]You could ";
    if other-suggs > 0 begin;
    let sugg-rep be "[sugg-list-other]";
    replace the regular expression "\band\b" in sugg-rep with "or";
    say "[sugg-rep][if tell-suggs + ask-suggs > 0]; or [end if]";
    end if;
    if ask-suggs > 0 begin;
    let sugg-rep be "[sugg-list-ask with definite articles]";
    replace the regular expression "\band\b" in sugg-rep with "or";
    say "ask [it-them of the current interlocutor] about [sugg-rep][if tell-suggs > 0]; or [end if]";
    end if;
    if tell-suggs > 0 begin;
    let sugg-rep be "[sugg-list-tell with definite articles]";
    replace the regular expression "\band\b" in sugg-rep with "or";
    say "tell [it-them of the current interlocutor] about [sugg-rep]";
    end if;
    say "[if topic-request is implicit].)[paragraph break][otherwise].[end if]"