Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
data_structs.output_calcs.BreakdownOutputCalc Class Reference

This type of OutputCalc constructs a table of counts. More...

Inheritance diagram for data_structs.output_calcs.BreakdownOutputCalc:

Public Member Functions

def __init__
 Constructor. More...
 
def reset
 See superclass description. More...
 
def get_db_args
 See superclass description. More...
 
def get_calc_type_str
 See superclass description. More...
 
def add_seg
 See superclass description. More...
 
def add_chain
 See superclass description. More...
 
def write_csv_rows
 See superclass description. More...
 
- Public Member Functions inherited from data_structs.output_calcs.OutputCalc
def __init__
 Constructor. More...
 
def get_db_args
 Retreives an ordered list of args needed to instantiate this object these will be inserted into the DB. More...
 
def get_calc_type_str
 Retreives a short description string that indicates what type of calculation this object is performing (eg. More...
 
def add_seg
 Adds an unlinked segment to be considered in the calculations that this object is performing. More...
 
def add_chain
 Adds a linked segment (i.e. More...
 
def write_csv_rows
 Writes a short description of the calculation, along with the calculation results, to a csv file. More...
 
def reset
 This method clears any cached data from previous run (anything added by add_seg() or add_chain()), in preparation for new run. More...
 
- Public Member Functions inherited from data_structs.base_objects.BLLObject
def __str__
 Builds a nicely formatted string containing all attributes of this object (except those in omit_attr_names), for debugging purposes. More...
 

Public Attributes

 logger
 
 row_criteria
 
 col_criteria
 
 seg_list
 
 chain_list
 

Static Public Attributes

 BREAKDOWN_CRITERIA = None
 

Private Member Functions

def _init_data_structs
 Initializes data structs used to keep track of items added to this OutputCalc. More...
 
def _get_trans_code_index
 Given a row or column criteria selected by the user, provides the corresponding transcriber code index. More...
 
def _get_utter_criteria_code
 Determines the transcriber code index that the specified criteria corresponds to, then returns the code in that index from the specified Utterance. More...
 

Detailed Description

This type of OutputCalc constructs a table of counts.

The user can select two transcriber codes. The first is the row criteria. All elements of the code are enumerated along the left (vertical axis) side of the table. The second is the column criteria. All elements of this code are enumerated along the top (horizontal axis) of the table. Each internal table cell will contain a count of the number of items found that have both the horizontal and vertical codes.

Definition at line 496 of file output_calcs.py.

Constructor & Destructor Documentation

def data_structs.output_calcs.BreakdownOutputCalc.__init__ (   self,
  row_criteria,
  col_criteria 
)

Constructor.

Parameters
self
row_criteria(int) one of the values from the enum BreakdownOutputCalc.BREAKDOWN_CRITERIA. Indicates the row code.
col_criteria(int) one of the values from the enum BreakdownOutputCalc.BREAKDOWN_CRITERIA. Indicates the column code.

Definition at line 504 of file output_calcs.py.

Member Function Documentation

def data_structs.output_calcs.BreakdownOutputCalc._get_trans_code_index (   self,
  criteria 
)
private

Given a row or column criteria selected by the user, provides the corresponding transcriber code index.

Parameters
self
criteria(int) an option from BreakdownOutputCalc.BREAKDOWN_CRITERIA
Returns
(int) the index (zero-based) of the transcriber code corresponding the specified criteria that the user has selected

Definition at line 540 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc._get_utter_criteria_code (   self,
  utter,
  criteria 
)
private

Determines the transcriber code index that the specified criteria corresponds to, then returns the code in that index from the specified Utterance.

(Utterance) the utterance who's code you want to grab (int) an option from BreakdownOutputCalc.BREAKDOWN_CRITERIA

Returns
(string) a transcriber code, or None if the Utterance has no transcriber codes

Definition at line 553 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc._init_data_structs (   self)
private

Initializes data structs used to keep track of items added to this OutputCalc.

Parameters
self

Definition at line 512 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc.add_chain (   self,
  head 
)

See superclass description.

Definition at line 533 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc.add_seg (   self,
  seg 
)

See superclass description.

Definition at line 529 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc.get_calc_type_str (   self)

See superclass description.

Definition at line 525 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc.get_db_args (   self)

See superclass description.

Definition at line 521 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc.reset (   self)

See superclass description.

Definition at line 517 of file output_calcs.py.

def data_structs.output_calcs.BreakdownOutputCalc.write_csv_rows (   self,
  chained,
  csv_writer 
)

See superclass description.

This method writes out the table of counts to a spreadsheet file. The user can select two codes. The first is the row criteria. All elements of the code are enumerated along the left (vertical axis) side of the table. The second is the column criteria. All elements of this code are enumerated along the top (horizontal axis) of the table. Each internal table cell will contain a count of the number of items found that have both the horizontal and vertical codes. In cases where codes can have multiple characters (eg. transcriber code 3), only the single codes will be enumerated in the table headers. If items are found containing multiple character codes, then each character in the code increments one cell (the item will be 'counted once for each character'').

Definition at line 568 of file output_calcs.py.

Member Data Documentation

data_structs.output_calcs.BreakdownOutputCalc.BREAKDOWN_CRITERIA = None
static

Definition at line 498 of file output_calcs.py.

data_structs.output_calcs.BreakdownOutputCalc.chain_list

Definition at line 514 of file output_calcs.py.

data_structs.output_calcs.BreakdownOutputCalc.col_criteria

Definition at line 507 of file output_calcs.py.

data_structs.output_calcs.BreakdownOutputCalc.logger

Definition at line 505 of file output_calcs.py.

data_structs.output_calcs.BreakdownOutputCalc.row_criteria

Definition at line 506 of file output_calcs.py.

data_structs.output_calcs.BreakdownOutputCalc.seg_list

Definition at line 513 of file output_calcs.py.


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