class_docstr: A stream backed corpus view for corpus files that consist of
  sequences of serialized Python objects (serialized using
  ``pickle.dump``).  One use case for this class is to store the
  result of running feature detection on a corpus to disk.  This can
  be useful when performing feature detection is expensive (so we
  don't want to repeat it); but the corpus is too large to store in
  memory.  The following example illustrates this technique:
  
      >>> from nltk.corpus.reader.util import PickleCorpusView
      >>> from nltk.util import LazyMap
      >>> feature_corpus = LazyMap(detect_features, corpus) # doctest: +SKIP
      >>> PickleCorpusView.write(feature_corpus, some_fileid)  # doctest: +SKIP
      >>> pcv = PickleCorpusView(some_fileid) # doctest: +SKIP
class_docstr_tok: ["A","stream","backed","corpus","view","for","corpus","files","that","consist","of","sequences","of","serialized","Python","objects","(","serialized","using","``","pickle.dump","``",")",".","One","use","case","for","this","class","is","to","store","the","result","of","running","feature","detection","on","a","corpus","to","disk",".","This","can","be","useful","when","performing","feature","detection","is","expensive","(","so","we","do","n't","want","to","repeat","it",")",";","but","the","corpus","is","too","large","to","store","in","memory",".","The","following","example","illustrates","this","technique",":",">",">",">","from","nltk.corpus.reader.util","import","PickleCorpusView",">",">",">","from","nltk.util","import","LazyMap",">",">",">","feature_corpus","=","LazyMap","(","detect_features",",","corpus",")","#","doctest",":","+SKIP",">",">",">","PickleCorpusView.write","(","feature_corpus",",","some_fileid",")","#","doctest",":","+SKIP",">",">",">","pcv","=","PickleCorpusView","(","some_fileid",")","#","doctest",":","+SKIP"]
docstr: If ``delete_on_gc`` was set to true when this
  ``PickleCorpusView`` was created, then delete the corpus view's
  fileid.  (This method is called whenever a
  ``PickledCorpusView`` is garbage-collected.
docstr_tok: ["If","``","delete_on_gc","``","was","set","to","true","when","this","``","PickleCorpusView","``","was","created",",","then","delete","the","corpus","view's","fileid",".","(","This","method","is","called","whenever","a","``","PickledCorpusView","``","is","garbage-collected","."]
code: def __del__(self):
      """
      If ``delete_on_gc`` was set to true when this
      ``PickleCorpusView`` was created, then delete the corpus view's
      fileid.  (This method is called whenever a
      ``PickledCorpusView`` is garbage-collected.
      """
      if getattr(self, "_delete_on_gc"):
          if os.path.exists(self._fileid):
              try:
                  os.remove(self._fileid)
              except OSError:
                  pass
      self.__dict__.clear()
  
imports: import bisect
  import os
  import pickle
  import re
  import tempfile
  from functools import reduce
  from xml.etree import ElementTree
  from nltk.data import FileSystemPathPointer, PathPointer, SeekableUnicodeStreamReader, ZipFilePathPointer
  from nltk.internals import slice_bounds
  from nltk.tokenize import wordpunct_tokenize
  from nltk.util import AbstractLazySequence, LazyConcatenation, LazySubsequence
label_desc: Use image node_id 3 for calling the PickleCorpusView obj's underlying member method code with example usage: obj.__del__() without return types