title: How to cluster search engine keywords?
body: <p>From Google Analytics I have a (long) list of keywords that people used in search engines to find my website. I want to find the 'core keywords', hypothetical example:</p>
  
  <pre><code>java online training
  learning java
  scala training
  training for java
  online training java
  learn scala programming
  </code></pre>
  
  <p>The ideal result would be: 'java', 'online training', 'training', 'scala' and 'learn'.</p>
  
  <p>The difficulty seems to be detecting complete phrases, ignoring common words (for) and handling variations (learn-learning).</p>
  
  <p><em>Is there a library that can do that (preferably for JVM)? Or is there a suitable algorithm I can implement myself?</em></p>