<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- Generated by YaBB on Fri, 10 Sep 2010 17:08:29 +0000 -->
<rss version="2.0">
	<channel>
		<title>10 most Recent Topics - RiveScript.com</title>
		<link>http://www.rivescript.com/yabb2/YaBB.pl</link>
		<description> - RiveScript.com</description>
		<language>en-us</language>

		<copyright>RiveScript.com</copyright>
		<lastBuildDate>Fri, 10 Sep 2010 17:08:29 +0000</lastBuildDate>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<generator></generator>
		<ttl>30</ttl>
		<item>
			<title>Full Bots - shelly the shell bot</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1283371605/0#0</link>
			<category>RiveScript.com/Full Bots</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1283371605/0#0</guid>
			<description>basically, this is a rivescript chatterbot that replies in the shell instead of a command not found error.&#60;br /&#62;&#60;br /&#62;The way this works is the command_not_found_handle function in (newer versions of) bash.&#60;br /&#62;&#60;br /&#62;It needs work and i&#39;m not sure I have a lot of time.  So, people who are good with bash, the idea here is to make a bot in the shell that teaches users how to use it...&#60;br /&#62;&#60;br /&#62;help would be appreciated, otherwise estimated delivery date is december (of 2030).&#60;br /&#62;&#60;br /&#62;echoline.org/talk_to_alice/other_chatterbots/shelly/</description>
		</item>
		<item>
			<title>General Bot Discussion - Question</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1274907383/4#4</link>
			<category>RiveScript.com/General Bot Discussion</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1274907383/4#4</guid>
			<description>I&#39;ll be sure to shoot you the info. I dunno if by chance you ever played everquest, but the servers use a bastard everquest client. Play is free, but the client is like 20$ so I dunno if youll really be able to see it in action. Perhaps I can just toss screencaps your way. Unless that is, if you turn into a fanatic about 11 year old games between now and proof-of-concept. &#38;nbsp;&#60;img src=&#34;http://www.rivescript.com/yabbfiles/Templates/Forum/default/smiley.gif&#34; border=&#34;0&#34; alt=&#34;Smiley&#34; /&#62;</description>
		</item>
		<item>
			<title>Perl RiveScript Interpreter - Feature Suggestion - Custom Object Handlers</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1237155743/1#1</link>
			<category>RiveScript.com/Perl RiveScript Interpreter</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1237155743/1#1</guid>
			<description>Hello. And Bye.</description>
		</item>
		<item>
			<title>General Bot Discussion - Chatbots 3.0 Conference</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1265565690/1#1</link>
			<category>RiveScript.com/General Bot Discussion</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1265565690/1#1</guid>
			<description>The forum blocks links until the poster has a high enough post count.&#60;br /&#62;&#60;br /&#62;Here&#39;s the link:&#60;br /&#62;&#60;br /&#62;&#60;a href=&#34;http://chatbots3.eventbrite.com/&#34; target=&#34;_blank&#34;&#62;http://chatbots3.eventbrite.com/&#60;/a&#62;</description>
		</item>
		<item>
			<title>RiveScript Codes - learn and forget capabilities</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1212476034/2#2</link>
			<category>RiveScript.com/RiveScript Codes</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1212476034/2#2</guid>
			<description>i ported badanswer.aiml to rs. &#38;nbsp;it seems to be working ok.</description>
		</item>
		<item>
			<title>RiveScript Codes - RiveScript Syntax Highlighting for vim</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1238470415/1#1</link>
			<category>RiveScript.com/RiveScript Codes</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1238470415/1#1</guid>
			<description>oh thank god</description>
		</item>
		<item>
			<title>Getting Started - PHP RiveScript-clone interpreter</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1261305539/8#8</link>
			<category>RiveScript.com/Getting Started</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1261305539/8#8</guid>
			<description>All the wildcard symbols should match multiple words (if the perl module doesn&#39;t do this, it&#39;s another bug and will be fixed &#60;img src=&#34;http://www.rivescript.com/yabbfiles/Templates/Forum/default/tongue.gif&#34; border=&#34;0&#34; alt=&#34;Tongue&#34; /&#62;). _ should match letters and spaces, # should match numbers and spaces, and * matches anything.&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Code:&#60;/b&#62;&#60;pre class=&#34;code&#34; style=&#34;margin: 0px; width: 90%; &#160;overflow: auto;&#34;&#62;_ = &#38;#47;&#38;#91;A&#38;#45;Za&#38;#45;z&#38;#92;s&#38;#93;+&#38;#63;&#38;#47;
# = &#38;#47;&#38;#91;0&#38;#45;9&#38;#92;s&#38;#93;+&#38;#63;&#38;#47;
* = &#38;#47;&#38;#46;+&#38;#63;&#38;#47; 

&#60;/pre&#62;&#60;br /&#62;&#60;br /&#62;And when &#38;quot;l o l&#38;quot; is substituted, the &#38;quot;l o l&#38;quot; has to be isolated in the message. So &#38;quot;mill o load&#38;quot; is left unmodified. This can be seen in the `rsdemo` app that comes with the perl RiveScript module, if you run it on some code that has a substitution for &#38;quot;l o l&#38;quot; (the default set doesn&#39;t include this substitution) using `rsdemo --debug`&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Quote:&#60;/b&#62;&#60;br /&#62;&#60;div class=&#34;quote&#34; style=&#34;width: 90%; overflow: auto;&#34;&#62;You&#38;gt; my name is Kirsle l o l&#60;br /&#62;RiveScript: Get reply to [localuser] my name is Kirsle l o l&#60;br /&#62;RiveScript: Checking topic __begin__ for any %previous&#39;s.&#60;br /&#62;RiveScript: Trying to match &#38;quot;request&#38;quot; against request (request)&#60;br /&#62;RiveScript: Found a match!&#60;br /&#62;RiveScript: Processing responses to this trigger.&#60;br /&#62;RiveScript: Reply: &#38;#123;ok&#38;#125;&#60;br /&#62;RiveScript: Checking topic random for any %previous&#39;s.&#60;br /&#62;RiveScript: There&#39;s a %previous in this topic&#60;br /&#62;RiveScript: lastReply: that is interesting please continue&#60;br /&#62;RiveScript: Try to match lastReply (that is interesting please continue) to whats her name&#60;br /&#62;RiveScript: Try to match lastReply (that is interesting please continue) to whats his name&#60;br /&#62;RiveScript: Trying to match &#38;quot;&#60;span style=&#34;color:#0000FF;&#34;&#62;my name is kirsle lol&#60;/span&#62;&#38;quot; against shutdown&#38;#123;weight=10000&#38;#125; (shutdown)&#60;br /&#62;[...]&#60;br /&#62;Bot&#38;gt; Kirsle Lol, nice to meet you.&#60;br /&#62;&#60;br /&#62;and&#60;br /&#62;&#60;br /&#62;You&#38;gt; my name is mill o load&#60;br /&#62;[...]&#60;br /&#62;RiveScript: Trying to match &#38;quot;&#60;span style=&#34;color:#0000FF;&#34;&#62;my name is mill o load&#60;/span&#62;&#38;quot; against my name is * (my name is (.+?))&#60;br /&#62;RiveScript: Found a match!&#60;br /&#62;RiveScript: Processing responses to this trigger.&#60;br /&#62;RiveScript: Reply: &#38;lt;set name=&#38;lt;formal&#38;gt;&#38;gt;Nice to meet you, &#38;lt;get name&#38;gt;.&#60;br /&#62;RiveScript: Set uservar name =&#38;gt; Mill O Load&#60;br /&#62;Bot&#38;gt; Nice to meet you, Mill O Load. &#60;/div&#62;&#60;br /&#62;&#60;br /&#62;PHP is pretty similar to Perl in syntax so you might be able to adapt the substitution code directly over to PHP. Here&#39;s the code:&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Code:&#60;/b&#62;&#60;pre class=&#34;code&#34; style=&#34;margin: 0px; width: 90%; height: 300px; overflow: auto;&#34;&#62;sub _formatMessage &#38;#123;
	my &#38;#40;$self,$string&#38;#41; = @_;

	# Lowercase it&#38;#46;
	$string = lc&#38;#40;$string&#38;#41;;

	# Run substitutions on it&#38;#46;
	foreach my $pattern &#38;#40;@&#38;#123;$self&#38;#45;&#38;gt;&#38;#123;sortlist&#38;#125;&#38;#45;&#38;gt;&#38;#123;subs&#38;#125;&#38;#125;&#38;#41; &#38;#123;
		my $result = $self&#38;#45;&#38;gt;&#38;#123;subs&#38;#125;&#38;#45;&#38;gt;&#38;#123;$pattern&#38;#125;;
		$result =~ tr&#38;#47;A&#38;#45;Za&#38;#45;z&#38;#47;N&#38;#45;ZA&#38;#45;Mn&#38;#45;za&#38;#45;m&#38;#47;;
		my $qm = quotemeta&#38;#40;$pattern&#38;#41;;
		$string =~ s&#38;#47;&#38;#94;$qm$&#38;#47;&#38;lt;rot13sub&#38;gt;$result&#38;lt;bus31tor&#38;gt;&#38;#47;ig;
		$string =~ s&#38;#47;&#38;#94;$qm&#38;#40;&#38;#92;W+&#38;#41;&#38;#47;&#38;lt;rot13sub&#38;gt;$result&#38;lt;bus31tor&#38;gt;$1&#38;#47;ig;
		$string =~ s&#38;#47;&#38;#40;&#38;#92;W+&#38;#41;$qm&#38;#40;&#38;#92;W+&#38;#41;&#38;#47;$1&#38;lt;rot13sub&#38;gt;$result&#38;lt;bus31tor&#38;gt;$2&#38;#47;ig;
		$string =~ s&#38;#47;&#38;#40;&#38;#92;W+&#38;#41;$qm$&#38;#47;$1&#38;lt;rot13sub&#38;gt;$result&#38;lt;bus31tor&#38;gt;&#38;#47;ig;
	&#38;#125;
	while &#38;#40;$string =~ &#38;#47;&#38;lt;rot13sub&#38;gt;&#38;#40;&#38;#46;+&#38;#63;&#38;#41;&#38;lt;bus31tor&#38;gt;&#38;#47;i&#38;#41; &#38;#123;
		my $rot13 = $1;
		$rot13 =~ tr&#38;#47;A&#38;#45;Za&#38;#45;z&#38;#47;N&#38;#45;ZA&#38;#45;Mn&#38;#45;za&#38;#45;m&#38;#47;;
		$string =~ s&#38;#47;&#38;lt;rot13sub&#38;gt;&#38;#40;&#38;#46;+&#38;#63;&#38;#41;&#38;lt;bus31tor&#38;gt;&#38;#47;$rot13&#38;#47;i;
	&#38;#125;

	# Format punctuation&#38;#46;
	$string =~ s&#38;#47;&#38;#91;&#38;#94;A&#38;#45;Za&#38;#45;z0&#38;#45;9 &#38;#93;&#38;#47;&#38;#47;g;
	$string =~ s&#38;#47;&#38;#94;&#38;#92;s+&#38;#47;&#38;#47;g;
	$string =~ s&#38;#47;&#38;#92;s+$&#38;#47;&#38;#47;g;

	return $string;
&#38;#125; 

&#60;/pre&#62;&#60;br /&#62;&#60;br /&#62;Basically, it takes the result text for each substitution (e.g. &#38;quot;what is&#38;quot; for &#38;quot;whats&#38;quot;), rot13-encodes it, and then substitutes &#38;quot;whats&#38;quot; for &#38;quot;&#38;lt;rot13sub&#38;gt;jung vf&#38;lt;/bus31tor&#38;gt;&#38;quot; until it&#39;s all done running substitutions, and then it goes through and looks for the rot13-encoded text it put in and decodes it and removes the temporary tags it put around it.&#60;br /&#62;&#60;br /&#62;quotemeta() is a Perl function that automatically escapes regular expression special characters.&#60;br /&#62;&#60;br /&#62;The regexps themselves:&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Code:&#60;/b&#62;&#60;pre class=&#34;code&#34; style=&#34;margin: 0px; width: 90%; &#160;overflow: auto;&#34;&#62;&#38;#47;&#38;#94;$qm$&#38;#47;
&#38;#47;&#38;#94;$qm&#38;#40;&#38;#92;W+&#38;#41;&#38;#47;
&#38;#47;&#38;#40;&#38;#92;W+&#38;#41;$qm&#38;#40;&#38;#92;W+&#38;#41;&#38;#47;
&#38;#47;&#38;#40;&#38;#92;W+&#38;#41;$qm$&#38;#47; 

&#60;/pre&#62;&#60;br /&#62;&#60;br /&#62;(\W+) matches any character that is not a word character (word characters are numbers and letters, but not spaces). So for &#38;quot;l o l&#38;quot; these regexps match:&#60;br /&#62;&#60;br /&#62;1. if the message consists *only* of the text &#38;quot;l o l&#38;quot;&#60;br /&#62;2. if the message begins with &#38;quot;l o l&#38;quot; &#38;amp; is then followed by a space or other non-word character&#60;br /&#62;3. if the message contains &#38;quot;l o l&#38;quot; as one of its words (surrounded by a space or non-word character on either side)&#60;br /&#62;4. if the message ends with &#38;quot;l o l&#38;quot; and has a space or non-word char before it.&#60;br /&#62;&#60;br /&#62;The reason for the rot13 encoding is to stop the substitutions from undoing each other. This is especially important for person substitutions, where you might have:&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Code:&#60;/b&#62;&#60;pre class=&#34;code&#34; style=&#34;margin: 0px; width: 90%; &#160;overflow: auto;&#34;&#62;&#38;#33; person you are = I am
&#38;#33; person i am = you are 

&#60;/pre&#62;&#60;br /&#62;&#60;br /&#62;If it replaces &#38;quot;you are&#38;quot; with &#38;quot;I am&#38;quot;, and then replaces &#38;quot;I am&#38;quot; with &#38;quot;you are&#38;quot;, you&#39;d end up with the same text you started with. So, it rot13-encodes it when it puts in the substituted text so that the rest of the substitutions don&#39;t interfere with the text that it already replaced. It&#39;s a weak approach, I know; perhaps a better one would be to keep an array of all the substitutions it made and just insert small numbered tags, like &#38;lt;0&#38;gt;, &#38;lt;1&#38;gt;, &#38;lt;2&#38;gt;, etc... and then replace those tags with the items from the array.</description>
		</item>
		<item>
			<title>Getting Started - Stupid Alice</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1259792979/1#1</link>
			<category>RiveScript.com/Getting Started</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1259792979/1#1</guid>
			<description>A lot of that is because Alice is sentence-based and RiveScript is not.&#60;br /&#62;&#60;br /&#62;In an Alicebot the user&#39;s message is split into one or more sentences and each sentence gets its own reply. All the combined replies from Alice are then returned to the user as one response.&#60;br /&#62;&#60;br /&#62;Similarly, Alice&#39;s &#38;quot;last reply&#38;quot; to the user (used for &#38;lt;that&#38;gt; matching on your next pattern) only stores the last sentence that Alice said, and not her full message.&#60;br /&#62;&#60;br /&#62;Here is the relevant AIML code from Alice:&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Code:&#60;/b&#62;&#60;pre class=&#34;code&#34; style=&#34;margin: 0px; width: 90%; &#160;overflow: auto;&#34;&#62;&#38;lt;category&#38;gt;
&#38;lt;pattern&#38;gt;*&#38;lt;&#38;#47;pattern&#38;gt;
&#38;lt;that&#38;gt;WHAT IS YOUR NAME&#38;lt;&#38;#47;that&#38;gt;
&#38;lt;template&#38;gt;&#38;lt;srai&#38;gt;CALL ME &#38;lt;star&#38;#47;&#38;gt;&#38;lt;&#38;#47;srai&#38;gt;
&#38;lt;&#38;#47;template&#38;gt;
&#38;lt;&#38;#47;category&#38;gt; 

&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Java RiveScript Interpreter - Development SVN</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1257375128/0#0</link>
			<category>RiveScript.com/Java RiveScript Interpreter</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1257375128/0#0</guid>
			<description>You can get a highly developmental version of the Java RiveScript interpreter via subversion now:&#60;br /&#62;&#60;br /&#62; &#60;b&#62;Code:&#60;/b&#62;&#60;pre class=&#34;code&#34; style=&#34;margin: 0px; width: 90%; &#160;overflow: auto;&#34;&#62;svn checkout http&#38;#58;&#38;#47;&#38;#47;svn&#38;#46;kirsle&#38;#46;net&#38;#47;repos&#38;#47;RiveScript&#38;#45;java&#38;#47;trunk RiveScript&#38;#45;java 

&#60;/pre&#62;&#60;br /&#62;&#60;br /&#62;At the time of this writing, it doesn&#39;t support a whole lot yet... parsing is mostly complete, most of the tags in replies work... weighted triggers and weighted/random replies work, redirections work, but conditionals do not work yet; nor do topic inheritence/includes or the %previous.&#60;br /&#62;&#60;br /&#62;RiveScript.java is full of &#38;quot;TODO&#38;quot; keywords everywhere around parts that aren&#39;t yet implemented.&#60;br /&#62;&#60;br /&#62;What it can do though is basic chat and learning and repeating user variables. I&#39;m just posting this for anyone who wants to get a super early look at the new Java RS interpreter.</description>
		</item>
		<item>
			<title>RiveScript Codes - AIML's Alice for RiveScript</title>
			<link>http://www.rivescript.com/yabb2/YaBB.pl?num=1248975743/1#1</link>
			<category>RiveScript.com/RiveScript Codes</category>
			<guid>http://www.rivescript.com/yabb2/YaBB.pl?num=1248975743/1#1</guid>
			<description>Cheers!&#60;br /&#62;&#60;br /&#62;Thanks for the work, have been looking for the perfect &#38;quot;entity&#38;quot; to use as part of my little home automation project.&#60;br /&#62;&#60;br /&#62;And given how hard AIML is hard to read and understand, and how most chatbot projects are dead since 2006, and I have no idea how to run scripts from inside them, RiveScript is perfect, esp. with the bot being able to execute Perl out of the box. (i&#39;m not a pro programmer =P )&#60;br /&#62;&#60;br /&#62;will be trying Alice out in RiveScript when I get home. &#38;nbsp;&#60;img src=&#34;http://www.rivescript.com/yabbfiles/Templates/Forum/default/grin.gif&#34; border=&#34;0&#34; alt=&#34;Grin&#34; /&#62;&#60;br /&#62;&#60;br /&#62;</description>
		</item>
	</channel>
</rss>