Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
parsers.csv_parser.CSVParser Class Reference

Parses Segment objects out a CSV file (one segment per row). More...

Inheritance diagram for parsers.csv_parser.CSVParser:

Public Member Functions

def __init__
 Constructor. More...
 
def parse
 Parses the CSV file row by row, generating Segment objects. More...
 

Public Attributes

 logger
 
 filename
 
 segments
 
 parsed
 

Private Member Functions

def _parse
 Goes through the file row by row. More...
 

Detailed Description

Parses Segment objects out a CSV file (one segment per row).

Each row must contain the columns "Elapsed_Time, Segment_Duration, Speaker_ID".

Definition at line 13 of file csv_parser.py.

Constructor & Destructor Documentation

def parsers.csv_parser.CSVParser.__init__ (   self,
  filename 
)

Constructor.

Parameters
self
filename(string) full path to csv file to parse

Definition at line 17 of file csv_parser.py.

Member Function Documentation

def parsers.csv_parser.CSVParser._parse (   self,
  progress_update_fcn = None,
  seg_filters = [] 
)
private

Goes through the file row by row.

Parameters
self
progress_update_function(see parse())
seg_filters(see parse())

Definition at line 40 of file csv_parser.py.

def parsers.csv_parser.CSVParser.parse (   self,
  progress_update_fcn = None,
  seg_filters = [] 
)

Parses the CSV file row by row, generating Segment objects.

Parameters
self
progress_update_fcn(function=None) function that updates the progress bar, accepting a single parameter, a real number in [0.0, 1.0]
seg_filters(list=[]) list of SegFilter objects. These filters are applied to the internal segments list in a permanent manner (i.e. anything they filter out will not be returned by this parser)
Returns
(list) List of the segments parsed out of the file - this list is also saved internally as self.segments

Definition at line 28 of file csv_parser.py.

Member Data Documentation

parsers.csv_parser.CSVParser.filename

Definition at line 19 of file csv_parser.py.

parsers.csv_parser.CSVParser.logger

Definition at line 18 of file csv_parser.py.

parsers.csv_parser.CSVParser.parsed

Definition at line 21 of file csv_parser.py.

parsers.csv_parser.CSVParser.segments

Definition at line 20 of file csv_parser.py.


The documentation for this class was generated from the following file: