title: How do I find words in a body of text?
body: <p>I'm doing some text processing and I'm interested in finding and scoring paragraphs of text based on frequency of words and/or phrases, using Ruby ideally.</p>
  
  <p>An example of the problem would be: I have "apple", "banana", "fruit salad", and "orange". This list is likely to be several thousand words and/or phrases long.</p>
  
  <p>I have a body of text to search:</p>
  
  <blockquote>
    <p>I have a set of apples, and apple computer, and an account on Apple.com but never a fruit salad. Why they never released an Apple Computer that doubled as an orange was beyond me.</p>
  </blockquote>
  
  <p>This would spit out an array that said:</p>
  
  <pre>
  Apple 4
  Orange 1
  Banana 0
  Fruit salad 1
  </pre>
  
  <p>Ideally, I'd be able to apply different weights, like the domain "apple.com" gets two points, etc.</p>
  
  <p>Is there a library that is particularly useful for doing this?</p>