&ldquo;Go north&rdquo; is not recognized
because of the capital &lsquo;G&rsquo;.
</li>
</ul>
<p>
Writing a good parser is no trivial task,
but here I will give you a relatively simple approach.
We will define a
<a href="http://en.wikipedia.org/wiki/Formal_grammar">grammar</a>
that consists of a list of <b>patterns</b>,
similar to (but much simpler than)
<a href="http://en.wikipedia.org/wiki/Regular_expression">regular expressions</a>.
Examples of patterns:
</p>
<table cellpadding="8"><tr>
<td class="snippet