title: Algorithm to find the most common substrings in a string
body: <p>Is there any algorithm that can be used to find the most common phrases (or substrings) in a string? For example, the following string would have "hello world" as its most common two-word phrase:</p>
  
  <p><code>"hello world this is hello world. hello world repeats three times in this string!"</code></p>
  
  <p>In the string above, the most common string (after the empty string character, which repeats an infinite number of times) would be the space character <code></code>.</p>
  
  <p>Is there any way to generate a list of common substrings in this string, from most common to least common?</p>