Location: PHPKode > projects > Program E > docs/developer/Interpreter/Engine/_graphnew_php.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>Docs for page graphnew.php</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
						<script src="../../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../../media/images/plus.png";
				imgMinus.src = "../../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			

<h2 class="file-name"><img src="../../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/graphnew.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">GraphMaster</p>
<p class="description"><p>Contains the AIML matching functions for Program E</p></p>
	<ul class="tags">
				<li><span class="field">filesource:</span> <a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html">Source Code for this file</a></li>
				<li><span class="field">version:</span> 0.0.8</li>
				<li><span class="field">copyright:</span> 2002</li>
				<li><span class="field">author:</span> Paul Rydell</li>
			</ul>
		
			</div>
</div>
		

	
	
	
	<a name="sec-functions"></a>	
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">	
			<a name="functionaddtostar" id="functionaddtostar"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">addtostar</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a501">501</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Deals with creating and adding to the star arrays</p>
<p class="description"><p>If a * or _ is part of the matched pattern, what is covered by that variable is then stored in the 'star arrays'. This function creates and adds words to that array or array element.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> info is returned via call-by-reference variables.</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			addtostar
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$parton</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$word</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$inputstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$thatstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$topicstarvals</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$action</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$parton</span><span class="var-description">: Can be input, that, topic.</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$word</span><span class="var-description">: The word that needs to be stored</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$inputstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern input string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$thatstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern that string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$topicstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern topic string</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$action</span><span class="var-description">: what action needs to be done, append to existing or create new.</span>			</li>
				</ul>
		
	
</div>
<a name="functionarraytostring" id="functionarraytostring"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">arraytostring</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a673">673</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Turn an array into a string</p>
<p class="description"><p>take each element of the array and put all of them into one big string; one after the other.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> the contents of the array into a string.</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			arraytostring
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$myarray</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$myarray
</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$myarray
</span>			</li>
				</ul>
		
	
</div>
<a name="functioncheckcache" id="functioncheckcache"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">checkcache</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a607">607</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Check to see if exact input-that-topic exists in cache</p>
<p class="description"><p>GmCache is a log that contains all unique entries. If the exact same input-that-topic is requested that is found in GmCache, then it's template reference is used instead of traversing the binary AIML tree. Saving response time.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> true/false Note, info is also transfere through the call-by-reference variables.</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongettemplate">gettemplate()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			checkcache
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$combined</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">&$template</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$inputstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$thatstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$topicstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$patternmatched</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$inputmatched</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$combined</span><span class="var-description">: the complete input in &lt;input&gt;word word&lt;that&gt;word word&lt;topic&gt;word word format.</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$inputstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern input string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$thatstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern that string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$topicstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern topic string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$patternmatched</span><span class="var-description">: all the patterns that match input, i.e. multiple sentences are kept seperate.</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$inputmatched</span><span class="var-description">: all the matched input.</span>			</li>
				</ul>
		
	
</div>
<a name="functiondebugger" id="functiondebugger"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">debugger</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a52">52</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The debugger function</p>
<p class="description"><p>When uncommented, it will print the messages several functions will call.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Prints to HTML.</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/_respond_php.html#functionrespond">respond()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/_respond_php.html#functionhandlenode">handlenode()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiondographquery">dographquery()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongettemplate">gettemplate()</a></li>
				<li><span class="field">todo:</span> the entire debug mechanism should be overhauled, this simple one line function doesn't cut it. Perhaps make use of several levels, function names and or timing to spefiy which part to debug.</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			debugger
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$msg</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$val</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$msg</span><span class="var-description">: The message to be printed in debugger mode</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$val</span><span class="var-description">: no idea what this does, it's used in every function call but not in the function itself</span>			</li>
				</ul>
		
	
</div>
<a name="functiondographquery" id="functiondographquery"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">dographquery</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a392">392</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Does a database query for <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></p>
<p class="description"><p>Retrieves the ID, ordera, isend of the word to be searched  $query=&quot;select id,ordera,isend from patterns where word='&quot; . addslashes($word) . &quot;' or word is null and parent=$parent&quot;;</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> contains ID, ordera and isend from the query. note: call-by-reference array exists too.</li>
				<li><span class="field">global:</span> integer $numselects: The number of queries that have been executed</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiondebugger">debugger()</a></li>
				<li><span class="field">todo:</span> The array returned is also returned via call-by-reference. Investigate which should be chosen.</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			dographquery
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">&$whichresult</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$word</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$parent</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$query</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$query</span><span class="var-description">: The SQL code to be executed</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$whichresult</span><span class="var-description">: contains ID, ordera and isend from the query. note: call-by-reference</span>			</li>
				</ul>
		
	
</div>
<a name="functionfastforward" id="functionfastforward"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">fastforward</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a556">556</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Fast forward to the processing of the next context</p>
<p class="description"><p>Remainder of the user's input covered by a *. So so add everything up to the next context (&lt;that&gt; &amp; &lt;topic&gt;) to the star.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> words to be saved by <a href="../../Interpreter/Engine/_graphnew_php.html#functionaddtostar">addtostar()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
				<li><span class="field">todo:</span> $newremains is a variable that is created, and filled but not returned. It is perhaps old code that        pre dates <a href="../../Interpreter/Engine/_graphnew_php.html#functionaddtostar">addtostar()</a> that saves the returned value in graphmaster().</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			fastforward
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$word</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$ffremains</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$word</span><span class="var-description">: Current processed word</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$ffremains</span><span class="var-description">: Words that remain to be processed.</span>			</li>
				</ul>
		
	
</div>
<a name="functionfillcache" id="functionfillcache"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">fillcache</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a651">651</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Add an entry in the GMcache table</p>
	<ul class="tags">
				<li><span class="field">global:</span> integer $selectbot: The selected bot.</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongettemplate">gettemplate()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			fillcache
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$combined</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$mytemplate</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$inputstarvals</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$thatstarvals</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$topicstarvals</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$patternmatched</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$inputmatched</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$combined</span><span class="var-description">: the complete input in &lt;input&gt;word word&lt;that&gt;word word&lt;topic&gt;word word format.</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$mytemplate</span><span class="var-description">: the reply to the input</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$inputstarvals</span><span class="var-description">: contents of the input star</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$thatstarvals</span><span class="var-description">: contents of the that star</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$topicstarvals</span><span class="var-description">: contents of the topic star</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$patternmatched</span><span class="var-description">: the AIML category pattern that matches the input</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$inputmatched</span><span class="var-description">: the input that matched the category.</span>			</li>
				</ul>
		
	
</div>
<a name="functionfindtemplate" id="functionfindtemplate"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">findtemplate</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a467">467</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Retrieve the template from the templates table</p>
<p class="description"><p>Get the template from the templates table. and return it.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The contents of &lt;template/&gt; for this category.</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongettemplate">gettemplate()</a></li>
				<li><span class="field">todo:</span> The name <a href="../../Interpreter/Engine/_graphnew_php.html#functiongettemplate">gettemplate()</a> and findtemplate() are too similar.</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			findtemplate
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$id</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$id</span><span class="var-description">: The ID of the template to be returned</span>			</li>
				</ul>
		
	
</div>
<a name="functiongettemplate" id="functiongettemplate"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">gettemplate</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a83">83</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the template for the input, that, and topic</p>
<p class="description"><p>Get the template for a paticular pattern and dialogue situation. If the pattern, including topic and that, was found in the cache, the mathcing routine is circumvented and that template used. This saves time.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The template belonging to the matching pattern.</li>
				<li><span class="field">global:</span> integer $selectbot: the Bot's ID.</li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functionfillcache">fillcache()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/_respond_php.html#functionrespond">respond()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functionfindtemplate">findtemplate()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiondebugger">debugger()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functioncheckcache">checkcache()</a></li>
				<li><span class="field">todo:</span> The name gettemplate() and <a href="../../Interpreter/Engine/_graphnew_php.html#functionfindtemplate">findtemplate()</a> are too similar.</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			gettemplate
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$input</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$that</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$topic</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$inputstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$thatstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$topicstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$patternmatched</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$inputmatched</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$input</span><span class="var-description">: The user's input</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$that</span><span class="var-description">: The bot's previous output</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$topic</span><span class="var-description">: The contents of the AIML tag &lt;topic&gt;</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$inputstarvals</span><span class="var-description">: contains the contents of the *'s when they are part of the matching pattern input string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$thatstarvals</span><span class="var-description">: contains the contents of the *'s when they are part of the matching pattern that string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$topicstarvals</span><span class="var-description">: contains the contents of the *'s when they are part of the matching pattern topic string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$patternmatched</span><span class="var-description">: contains all patterns that were found. An input can have more than one sentence which are processed seperately.</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$inputmatched</span><span class="var-description">: contains all the individual sentences of a user's input.</span>			</li>
				</ul>
		
	
</div>
<a name="functiongraphwalker" id="functiongraphwalker"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">graphwalker</span> (line <span class="line-number"><a href="../..//__filesource/fsource_Interpreter_Engine_graphnew.php.html#a152">152</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The graphwalker function finds the pattern that matches the combined input of input, that, and topic.</p>
<p class="description"><p>Then it returns the template that matches. It is recursive.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> the Template ID to be returned.</li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongettemplate">gettemplate()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiongraphwalker">graphwalker()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functionaddtostar">addtostar()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiondographquery">dographquery()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functionfastforward">fastforward()</a></li>
				<li><span class="field">uses:</span> <a href="../../Interpreter/Engine/_graphnew_php.html#functiondebugger">debugger()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			graphwalker
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$input</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$parent</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$timesthrough</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$onwild</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$parton</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$inputstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$thatstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$topicstarvals</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$patternmatched</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$input</span><span class="var-description">: The user's input</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$parent</span><span class="var-description">: The word's parent ID</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$timesthrough</span><span class="var-description">: Number of recursions????</span>			</li>
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$onwild</span><span class="var-description">: whether or not a wildcard is processed (Anne: I think)</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$parton</span><span class="var-description">: Can be input, that, topic.</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$inputstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern input string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$thatstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern that string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$topicstarvals</span><span class="var-description">: contents of the *'s when they are part of the matching pattern topic string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$patternmatched</span><span class="var-description">: contains all patterns that were found. A user's input can have more than one sentence.</span>			</li>
				</ul>
		
	
</div>
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Wed, 12 Jan 2005 12:24:46 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: Program E