title: How to remove characters which repeat more than twice in a string?
body: <p>For example, I want to remove the duplicate characters like 
  <code>hhhaaappy</code> to <code>hhaappy</code> since <code>h</code> and <code>a</code> repeat twice. 
  I want to remove all the characters which repeat more than twice.
  How to realize it in a fast way in python ?</p>
  
  <p>Besides, is there any python module that can correct the word ?
  like correct <code>hhhaaappy</code> to <code>happy</code> ?</p>