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

type LazyConcatenation

source code

          object --+    
                   |    
AbstractLazySequence --+
                       |
                      LazyConcatenation

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) 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

Class Variables [hide private]

Inherited from AbstractLazySequence (private): _MAX_REPR_SIZE

Method Details [hide private]

__init__(self, list_of_lists)
(Constructor)

source code 
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)