title: Ngrams with non-symmetrical padding in NLTK
body: <p>The quad gram of the word <em>TEXT</em> is </p>
  
  <pre><code>&gt;&gt;generated_ngrams = ngrams('TEXT', 4, pad_left=True, pad_right=True, left_pad_symbol=' ', right_pad_symbol=' ')
  
  &gt;&gt;list(generated_ngrams)
  [(' ', ' ', ' ', 'T'), (' ', ' ', 'T', 'E'), (' ', 'T', 'E', 'X'), ('T', 'E', 'X', 'T'), ('E', 'X', 'T', ' '), ('X', 'T', ' ', ' '), ('T', ' ', ' ', ' ')]
  </code></pre>
  
  <p>According to me the output should have been <code>_TEX, TEXT, EXT__, XT__</code>. 
  According to this website (<a href="http://cloudmark.github.io/Language-Detection/" rel="nofollow noreferrer">http://cloudmark.github.io/Language-Detection/</a>) the output is <code>_TEX, TEXT, EXT_, XT__, T___</code><br>
  It also goes on to say "In general a string of length k, padded with blanks, will have k+1 bi-grams, k+1 tri-grams, k+1 quad-grams and so on."<br>
  Based on the output I got from Python I don't think that is valid.<br>
  Kindly explain.</p>