Module Command :: Class linecountclass
[hide private]

Class linecountclass

source code

        object --+    
                 |    
              pype --+
                     |
        object --+   |
                 |   |
           stacker --+
                     |
    object --+       |
             |       |
    linebuffer --+   |
                 |   |
outputfilterbuffer --+
                     |
                    linecountclass

An example of a blockprocessor.

It produces all sorts of statistics for consumed text. Example:

   infile('my.txt') | linecount() > stdout
Nested Classes [hide private]

Inherited from outputfilterbuffer (private): _nullblock

Instance Methods [hide private]
 
__init__(self, **kw)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_freq(self) source code
 
_split(self, line) source code
 
_stats(self, dd) source code
 
process(self, reader) source code
 
results(self) source code

Inherited from pype: __gt__, __or__, __repr__, __str__

Inherited from stacker: __call__, __sub__

Inherited from outputfilterbuffer: __iter__

Inherited from linebuffer: write

Inherited from linebuffer (private): _buffer

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  _wordpattern = re.compile(r'\W+')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kw)
(Constructor)

source code 

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

Parameters:
  • filter - an instance of a class with 2 methods:
    • process(self,data) stores the data
    • results(self) returns results. To be usefull in a pipeline this returned result should be an iterable.
Overrides: object.__init__
(inherited documentation)