title: Creating a new corpus with NLTK
body: <p>I reckoned that often the answer to my title is to go and read the documentations, but I ran through the <a href="http://www.nltk.org/book" rel="noreferrer">NLTK book</a> but it doesn't give the answer. I'm kind of new to Python.</p>
  
  <p>I have a bunch of <code>.txt</code> files and I want to be able to use the corpus functions that NLTK provides for the corpus <code>nltk_data</code>. </p>
  
  <p>I've tried <code>PlaintextCorpusReader</code> but I couldn't get further than:</p>
  
  <pre><code>&gt;&gt;&gt;import nltk
  &gt;&gt;&gt;from nltk.corpus import PlaintextCorpusReader
  &gt;&gt;&gt;corpus_root = './'
  &gt;&gt;&gt;newcorpus = PlaintextCorpusReader(corpus_root, '.*')
  &gt;&gt;&gt;newcorpus.words()
  </code></pre>
  
  <p>How do I segment the <code>newcorpus</code> sentences using punkt? I tried using the punkt functions but the punkt functions couldn't read <code>PlaintextCorpusReader</code> class?</p>
  
  <p>Can you also lead me to how I can write the segmented data into text files?</p>