title: Combinatorially check relationship for all entities in a sentence
body: <p>I have a sentence of the following form:</p>
  
  <pre><code>&lt;sentence&gt; 0
  A sports article in some copies on Sunday about &lt;LOCATION&gt;Boston&lt;/LOCATION&gt; 's 1-0 victory against &lt;LOCATION&gt;San Francisco&lt;/LOCATION&gt; referred incorrectly to the history of the interleague series between the &lt;ORGANIZATION&gt;Red Sox&lt;/ORGANIZATION&gt; and the &lt;ORGANIZATION&gt;Giants&lt;/ORGANIZATION&gt; .
  &lt;/sentence&gt;
  </code></pre>
  
  <p>Within the sentence are references to entities, i.e. </p>
  
  <pre><code>Boston
  San Francisco
  Red Sox
  Giants
  </code></pre>
  
  <p>I want to "combinatorially" evaluate them to determine if they have some relationship.</p>
  
  <p>So I have some function that will tell me if they are related, and I want to write a function that will check, for instance:</p>
  
  <pre><code>Boston        X San Francisco
  Boston        X Red Sox
  Boston        X Giants
  San Francisco X Boston
  San Francisco X Red Sox
  San Francisco X Giants
  Red Sox       X Boston 
  Red Sox       X San Francisco
  Red Sox       X Giants
  Giants        X Boston
  Giants        X San Francisco
  Giants        X Red Sox
  </code></pre>
  
  <p>How to write such a function?</p>