title: Compare strings by matching words
body: <p>I'd like to know if such an algorithm exists and is implemented in any database (ideally Postgres).</p>
  
  <p>Levenstein matches strings, but I'd like to compare strings based on the number of matching words. For example, having:</p>
  
  <pre>
  the quick brown fox jumps over the lazy dog
  </pre>
  
  <p>I should come with a result of <em>2</em> if i try to match it against</p>
  
  <pre>
  the pen lies over the table
  </pre>
  
  <p>because it matched "the" and  "over" on both the sentences</p>