class LazySubsequence(AbstractLazySequence): (source)
Constructor: LazySubsequence(source, start, stop)
A subsequence produced by slicing a lazy sequence. This slice keeps a reference to its source sequence, and generates its values by looking them up in the source sequence.
Method | __init__ |
Undocumented |
Method | __len__ |
Return the number of tokens in the corpus file underlying this corpus view. |
Method | __new__ |
Construct a new slice from a given underlying sequence. The start and stop indices should be absolute indices -- i.e., they should not be negative (for indexing from the back of a list) or greater than the length of ... |
Method | iterate |
Return an iterator that generates the tokens in the corpus file underlying this corpus view, starting at the token number start. If start>=len(self), then this iterator will generate no tokens. |
Constant | MIN |
The minimum size for which lazy slices should be created. If LazySubsequence() is called with a subsequence that is shorter than MIN_SIZE, then a tuple will be returned instead. |
Instance Variable | _source |
Undocumented |
Instance Variable | _start |
Undocumented |
Instance Variable | _stop |
Undocumented |
Inherited from AbstractLazySequence
:
Method | __add__ |
Return a list concatenating self with other. |
Method | __contains__ |
Return true if this list contains value. |
Method | __eq__ |
Undocumented |
Method | __getitem__ |
Return the i th token in the corpus file underlying this corpus view. Negative indices and spans are both supported. |
Method | __hash__ |
No summary |
Method | __iter__ |
Return an iterator that generates the tokens in the corpus file underlying this corpus view. |
Method | __lt__ |
Undocumented |
Method | __mul__ |
Return a list concatenating self with itself count times. |
Method | __ne__ |
Undocumented |
Method | __radd__ |
Return a list concatenating other with self. |
Method | __repr__ |
Return a string representation for this corpus view that is similar to a list's representation; but if it would be more than 60 characters long, it is truncated. |
Method | __rmul__ |
Return a list concatenating self with itself count times. |
Method | count |
Return the number of times this list contains value. |
Method | index |
Return the index of the first occurrence of value in this list that is greater than or equal to start and less than stop. Negative start and stop values are treated like negative slice bounds -- i.e., they count from the end of the list. |
Constant | _MAX |
Undocumented |
Construct a new slice from a given underlying sequence. The start and stop indices should be absolute indices -- i.e., they should not be negative (for indexing from the back of a list) or greater than the length of source.
Return an iterator that generates the tokens in the corpus file underlying this corpus view, starting at the token number start. If start>=len(self), then this iterator will generate no tokens.