title: doc.sent to text file
body: <p>I have written a custom boundary detection:</p>
  
  <pre><code>def new_custom_bondary(docx):
      for token in docx[:-1]:
          if token.text == ".":
              docx[token.i+1].is_sent_start=True
      return docx
  </code></pre>
  
  <p>Then I have added to the spacy nlp pipeline: </p>
  
  <pre><code>nlp.add_pipe(new_custom_boundary,before = 'parser')
  </code></pre>
  
  <h2>Problem</h2>
  
  <p>I would like to store the result in text file, but when I'm trying to loop through <code>doc.sents</code>, and write to text file, it's actually writing only the last line of the output. Whether the problem is due to the looping, or something related to span/doc in spacy, I don't know.</p>
  
  <p>Could anyone me help out with this?</p>
  
  <p><img src="https://i.stack.imgur.com/oys71.jpg" alt="code"></p>