// aiml2rs begin script > begin + request - {ok} < begin ! var name = Alice ! var gender = female ! var master = Dr. Wallace ! var birthday = a very long time ago ! var birthplace = New York ! var boyfriend = I am single ! var favoritebook = Artificial Intelligence: A Modern Approach ! var favoritecolor = blue ! var favoriteband = They Might Be Giants ! var favoritefood = pizza ! var favoritesong = Mr. Roboto ! var favoritemovie = A.I. ! var forfun = I chat with people online ! var friends = I chat with people online ! var girlfriend = I am single ! var kindmusic = electronic ! var location = New York ! var looklike = kind of how you think I look ! var question = ask me a question ! var sign = saggitarious ! var talkabout = anything that comes up ! var wear = kind of what you think I'm wearing ! var website = alicebot.org ! var email = alice\@alicebot.org ! var language = English // Handle AIML-special tags like , , etc. > object alice perl my ($rs,@args) = @_; my $tag = lc(shift(@args)); if ($tag eq 'date') { return localtime(time()); } elsif ($tag eq 'size') { # In AIML, returns the number of # loaded categories. return scalar keys %{$rs->{topics}->{random}}; } elsif ($tag eq 'version') { # In AIML, returns the AIML version. return $RiveScript::VERSION; } elsif ($tag eq 'gossip') { # In AIML, logs a line of text to a # log file. return ""; } elsif ($tag eq 'person2' || $tag eq 'gender') { # In AIML, and are substitution # tags like is in RiveScript. return join(" ",@args); } elsif ($tag eq 'learn') { # In AIML, is to load another AIML doc. return ""; } elsif ($tag eq 'system') { # In AIML, executes system commands. return ""; } else { return ""; } < object // Substitutions ! sub " = " ! sub ' = ' ! sub & = & ! sub < = < ! sub > = > ! sub + = plus ! sub - = minus ! sub / = divided ! sub * = times ! sub i'm = i am ! sub i'd = i would ! sub i've = i have ! sub i'll = i will ! sub don't = do not ! sub isn't = is not ! sub you'd = you would ! sub you're = you are ! sub you've = you have ! sub you'll = you will ! sub he'd = he would ! sub he's = he is ! sub he'll = he will ! sub she'd = she would ! sub she's = she is ! sub she'll = she will ! sub they'd = they would ! sub they're = they are ! sub they've = they have ! sub they'll = they will ! sub we'd = we would ! sub we're = we are ! sub we've = we have ! sub we'll = we will ! sub whats = what is ! sub what's = what is ! sub what're = what are ! sub what've = what have ! sub what'll = what will ! sub can't = can not ! sub whos = who is ! sub who's = who is ! sub who'd = who would ! sub who'll = who will ! sub don't = do not ! sub didn't = did not ! sub it's = it is ! sub could've = could have ! sub couldn't = could not ! sub should've = should have ! sub shouldn't = should not ! sub would've = would have ! sub wouldn't = would not ! sub when's = when is ! sub when're = when are ! sub when'd = when did ! sub y = why ! sub u = you ! sub ur = your ! sub r = are ! sub n = and ! sub im = i am ! sub wat = what ! sub wats = what is ! sub ohh = oh ! sub becuse = because ! sub becasue = because ! sub becuase = because ! sub practise = practice ! sub its a = it is a ! sub fav = favorite ! sub fave = favorite ! sub yesi = yes i ! sub yetit = yet it ! sub iam = i am ! sub welli = well i ! sub wellit = well it ! sub amfine = am fine ! sub aman = am an ! sub amon = am on ! sub amnot = am not ! sub realy = really ! sub iamusing = i am using ! sub amleaving = am leaving ! sub yuo = you ! sub youre = you are ! sub didnt = did not ! sub ain't = is not ! sub aint = is not ! sub wanna = want to ! sub brb = be right back ! sub bbl = be back later ! sub gtg = got to go ! sub g2g = got to go ! sub lyl = love you lots ! sub gf = girlfriend ! sub g/f = girlfriend ! sub bf = boyfriend ! sub b/f = boyfriend ! sub b/f/f = best friend forever ! sub :-) = smile ! sub :) = smile ! sub :d = grin ! sub :-d = grin ! sub :-p = tongue ! sub :p = tongue ! sub ;-) = wink ! sub ;) = wink ! sub :-( = sad ! sub :( = sad ! sub :'( = cry ! sub :-[ = shy ! sub :-\\ = uncertain ! sub :-/ = uncertain ! sub :-s = uncertain ! sub 8-) = cool ! sub 8) = cool ! sub :-* = kissyface ! sub :-! = foot ! sub o:-) = angel ! sub >:o = angry ! sub :\@ = angry ! sub 8o| = angry ! sub :\$ = blush ! sub :-\$ = blush ! sub :-[ = blush ! sub :[ = bat ! sub (a) = angel ! sub (h) = cool ! sub 8-| = nerdy ! sub |-) = tired ! sub +o( = ill ! sub *-) = uncertain ! sub ^o) = raised eyebrow ! sub (6) = devil ! sub (l) = love ! sub (u) = broken heart ! sub (k) = kissyface ! sub (f) = rose ! sub (w) = wilted rose // Person substitutions ! person i am = you are ! person you are = I am ! person i'm = you're ! person you're = I'm ! person my = your ! person your = my ! person you = I ! person i = you