Package nltk :: Module util :: Class LazyConcatenation
[hide private]
[frames] | no frames]

Class LazyConcatenation

source code

          object --+    
                   |    
AbstractLazySequence --+
                       |
                      LazyConcatenation
Known Subclasses:

A lazy sequence formed by concatenating a list of lists. This underlying list of lists may itself be lazy. LazyConcatenation maintains an index that it uses to keep track of the relationship between offsets in the concatenated lists and offsets in the sublists.

Instance Methods [hide private]
 
__init__(self, list_of_lists)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__len__(self)
Return the number of tokens in the corpus file underlying this corpus view.
source code
 
iterate_from(self, start_index)
Return an iterator that generates the tokens in the corpus file underlying this corpus view, starting at the token number start.
source code

Inherited from AbstractLazySequence: __add__, __cmp__, __contains__, __getitem__, __hash__, __iter__, __mul__, __radd__, __repr__, __rmul__, count, index

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Variables [hide private]

Inherited from AbstractLazySequence (private): _MAX_REPR_SIZE

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, list_of_lists)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__len__(self)
(Length operator)

source code 

Return the number of tokens in the corpus file underlying this corpus view.

Overrides: AbstractLazySequence.__len__
(inherited documentation)

iterate_from(self, start_index)

source code 

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.

Overrides: AbstractLazySequence.iterate_from
(inherited documentation)