Home | Trees | Indices | Help |
|
---|
|
object --+ | util.AbstractLazySequence --+ | StreamBackedCorpusView --+ | PickleCorpusView
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:
>>> feature_corpus = LazyMap(detect_features, corpus) >>> PickleCorpusView.write(feature_corpus, some_filename) >>> pcv = PickledCorpusView(some_filename)
|
|||
|
|||
list of any |
|
||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
|
|||
|
|
|||
BLOCK_SIZE = 100
|
|||
PROTOCOL = -1
|
|||
Inherited from |
|
|||
Inherited from |
|
|||
Inherited from Inherited from |
|
Create a new corpus view that reads the pickle corpus
|
Read a block from the input stream.
|
If |
Write the given sequence to a temporary file as a pickle corpus; and
then return a
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 27 15:08:53 2008 | http://epydoc.sourceforge.net |