!759 concepts. !include #1004972 // Text AI Include // application-specific interpretations sconcept NewPerson extends Interpretation {} sconcept PersonIs extends Interpretation { S x; // text of what person is new Ref concept; // optional concept for x bool neg; // neg = person is not that thing } sconcept PictureIs extends Interpretation { S imageID; bool neg; // neg = person is not on the picture } sconcept ThatsTheOne extends Interpretation {} sconcept ThatsNotTheOne extends Interpretation {} // application database sconcept Person { bool current; new RefL guesses; } static Person person; static Map initialLines() { ret lithashmap( Hello.class, "Hello AI!", Praise.class, "Nicely done, AI.", NotForMe.class, "[Statement not meant for me]", Unclear.class, "[Unclear statement]", ByeBye.class, "Bye AI!", NewPerson.class, "Let's discuss another person.", ThatsTheOne.class, "That's the one!", ThatsNotTheOne.class, "No, that's not the one."); } static ImageSurface imageSurface; static S dbName = "Identify Persons DB."; p-substance { loadAndAutoSaveConcepts(); initialUnaryConcepts(initialLines()); concepts_quietSave = true; print("Lines: " + l(conceptsOfType("Line"))); makeBot("Identify Persons."); methodsBot(dbName, listPlus( exposedDBMethods, "xfindLine")); initConsole(); print("AI ready to rock. Go \"Admin\" to see my commands."); kevin("Hello"); print(); } static S answerInterpreted(S s, Interpretation ip) { if (ip instanceof Praise) ret kevin("Thank you :)"); if (ip instanceof Hello) ret kevin("Hello! :)"); if (ip instanceof ByeBye) { kevin("Bye user! :)"); sleepSeconds(1); cleanKillVM(); } if (ip instanceof NotForMe) ret kevin("Talk to the hand"); if (ip instanceof Unclear) ret "[Unclear statement]"; null; } svoid admin { thread "Admin" { O o = hotwire("#1004926"); set(o, "dbName", dbName); set(o, "interpretations", splitAtSpace( "Praise NotForMe Hello ByeBye Unclear NewPerson ThatsTheOne ThatsNotTheOne")); callMain(o); } }