title: Pattern finding LZW python
body: <p>LZW algorithm is used to find patterns between input symbols. But can it seek pattern among words ? I mean the alfabet index not to be symbols but words for example for the input :</p>
  
  <pre><code>'abcd', 'abcd', 'fasf' , 'asda', 'abcd' , 'fasf' ...
  </code></pre>
  
  <p>to have an output like :</p>
  
  <pre><code>'abcd', '1', 'fasf' , 'asda' , '1', '2' ...
  </code></pre>
  
  <p>Or is there any compressing algorithm that does the trick ?</p>