!7 sS questions = [[ Do you ship to Norway? => Yes Do you ship to Oslo? => Yes Do you ship to Australia? => Sorry, we cannot ship there. Do you ship to Melbourne? => Sorry, we cannot ship there. ]]; sS facts = [[ We ship to Norway We don't ship to Australia Melbourne is in Australia Oslo is in Norway ]]; sS rules = [[ Q: Do you ship to X? (We ship to X) => A: Yes (We don't ship to X) => A: Sorry, we cannot ship there. (We ship to X for a fee of Y) => A: Yes, for a fee of Y we will ship to X. (X is in Y) => Replace question with: Do you ship to Y? Always: (Replace question with: X) => Q: X lvjqbruihqmsgckd - Do you ship to X? aileauajpxpgymdj - We ship to X siacyutikdvksvwp - We don't ship to X zlrmmqtlczxnjabk - Sorry, we cannot ship there. vzfbivkrprmgghhp - Replace question with: X wmwqvagqbsfenmtf - X is in Y ]]; p { rules = rules_unfoldIndented(rules, "Always: "); print(rules); myTruthNonPersist(facts + standardConcepts() + rules); lispCheckQuestionsVerbose(questions); lispBot(); } static Lisp englishToLisp_best(S s) { s = trim(s); S x = dropPunctuationAtEnd(s); ret englishToLisp_bestParse(s, endsWith(s, "?") ? null : s + "?", x, endsWith(x, "?") ? null : x + "?"); }