title: Forming Bigrams of words in list of sentences with Python
body: <p>I have a list of sentences:</p>
  
  <pre><code>text = ['cant railway station','citadel hotel',' police stn']. 
  </code></pre>
  
  <p>I need to form bigram pairs and store them in a variable. The problem is that when I do that, I get a pair of sentences instead of words. Here is what I did: </p>
  
  <pre><code>text2 = [[word for word in line.split()] for line in text]
  bigrams = nltk.bigrams(text2)
  print(bigrams)
  </code></pre>
  
  <p>which yields </p>
  
  <pre><code>[(['cant', 'railway', 'station'], ['citadel', 'hotel']), (['citadel', 'hotel'], ['police', 'stn'])
  </code></pre>
  
  <p>Can't railway station and citadel hotel form one bigram. What I want is </p>
  
  <pre><code>[([cant],[railway]),([railway],[station]),([citadel,hotel]), and so on...
  </code></pre>
  
  <p>The last word of the first sentence should not merge with the first word of second sentence.
  What should I do to make it work?</p>