C:\trane\logicagent>ruby logicbot.rb Hello I have loaded C:/trane/logicagent/logicagent-api.yaml. > Christopher married Penelope. Okay, Christopher married Penelope. > Christopher is male. Okay, Christopher is male. > Christopher and Penelope had Arthur. Okay, Christopher and Penelope had Arthur. > Christopher and Penelope had Victoria. Okay, Christopher and Penelope had Victoria. > are Arthur and Victoria siblings? Yes, Arthur and Victoria are siblings. > logicbot: if input =~ /who is (.*)'s father/ then r1,s = self.send("who had #{$1}"); if /(.*) and (.*) had/ =~ r1 then f1 = $1.to_s; f2 = $2.to_s; rf1,s = self.send("is #{f1} male?"); if rf1 =~ /Yes/ then response = "#{f1}" end; rf2,s = self.send("is #{f2} male?"); if rf2 =~ /Yes/ then response = "#{f2}" end; end; end Okay [...] > who is arthur's father? christopher > Christine and Andrew had James. Okay, Christine and Andrew had James. > Andrew is male. Okay, Andrew is male. > who is James's father? andrew > Victoria and James had Colin Okay, Victoria and James had Colin. > who is Colin's grandfather? I don't know > logicbot: if input =~ /who is (.*)'s grandfather/ then r1,s = self.send("who is #{$1}'s father"); r2,s = self.send("who is #{r1}'s father"); response = r2; end Okay [...] > who is Colin's grandfather? you don't know what you don't know what Colin's father is.'s father is. > James is male. Okay, James are male. > James is singular Okay I have recorded James as a singular form. > is James male? Yes, James is male. > who is Colin's grandfather? andrew >