title: Extracting a country name from a text string
body: <p>I'm looking at writing a mashup app that will take submission titles from a subreddit and attempt to plot them on a map based on where they are likely to be relevant. I'd also like to add on things like Twitter later on.</p>
  
  <p>What I'm having difficulty planning is how to detect the most likely to be relevant country from the title. My first guess is to have a list of countries, along with their matching permutations (e.g. "English" matches "England", etc.) and check for occurrences of those items in the text. However this is probably going to be quite slow and will require me listing the possessive* name for each country.</p>
  
  <p>I'm planning on doing this in Python (so as to learn to use it) so I'm wondering is there a) a library that does this (and that I can learn from it) or b) a more obvious way to do this?</p>
  
  <p>To give an idea of the types of input I'm working with here are some samples and what I'm trying to get out of them:</p>
  
  <ul>
  <li>"Well they can't arrest all of us - Giving the middle finger to the British legal system (pic)"
  <ul>
  <li>Keyword: <strong>British</strong> (Great Britain)</li>
  </ul></li>
  <li>"Poll: Wikileaks Assange leading Time 'Person of the Year' - Assange, an Australian who has become a thorn in the side of the Pentagon with his releases of secret US military documents about the wars in Iraq and Afghanistan, had received 21,736 votes as of Friday."
  <ul>
  <li>Keywords: <strong>Afghanistan, Iraq, [Australian]</strong> (Afghanistan, Iraq, [Australia]) - Australia would be difficult to catch out as mainly irrelevant but this is acceptable for my purposes</li>
  </ul></li>
  <li>"Cyber attack on Nobel peace prize website launched. Stay classy, China."
  <ul>
  <li>Keyword: <strong>China</strong> (China)</li>
  </ul></li>
  <li>"A Jewish surgeon refuses to operate on a patient and walks out of the operating room after discovering a nazi tattoo on the patient's arm."
  <ul>
  <li>Keywords: <strong>none</strong> - acceptable for my purposes</li>
  </ul></li>
  </ul>
  
  <p>* This is probably the wrong word to use</p>