title: Find all recurrent substrings of length more then 1 in a huge string using Ruby/Python/C++/C
body: <p>I have a complex problem at hand i.e. I have a huge(more than 200000 characters) :-</p>
  
  <pre><code>'1213 1242 1213 49 1213 12134 4561213 154816 4631 154816'
  </code></pre>
  
  <p>Output to be something like :-</p>
  
  <pre><code>1. No. of distinct recurrent patterns
  2. Each's pattern's repitition count #=&gt; ([12], 6), ([121], 6), ([1213], 6), ([213], 6), ((21), 6), ((13), 6), .....
  </code></pre>
  
  <p>There are lots of solutions on finding longest repeating string using ruby/c/c++ but very few for finding all recurring substrings.</p>
  
  <p>I am looking for some conventional algorithm to perform this operation. like we have Floyd's cycle finding algo. for identifying cycles, etc. Something of that sort would be great to get started with.</p>