title: Java - Words and Phrase Frequency Counting
body: <p>This is my dilema. </p>
  
  <p>I need a function which would find the most occurring string pattern in a random text.</p>
  
  <p>So if the input is this:</p>
  
  <pre><code>my name is john jane doe jane doe doe my name is jane doe doe my jane doe name is jane doe I go by the name of john joe jane doe is my name
  </code></pre>
  
  <p>Output sorted by occurrence should look like this (case insensitive):</p>
  
  <pre><code>  Rank    Freq  Phrase
        1       6  jane doe
        2       3  my name
        3       3  name is
        4       2  doe doe
        5       2  doe doe my
        6       2  doe my
        7       2  is jane
        8       2  is jane doe
        9       2  jane doe doe
       10       2  jane doe doe my
       11       2  my name is
       12       2  name is jane
       13       2  name is jane doe
  etc...
  </code></pre>
  
  <p>In my case I need only phrases with 2 and more words.
  Any idea how to approach this issue?</p>